diff --git a/config/go.sum b/config/go.sum index fd672e20286..e91289bf27f 100644 --- a/config/go.sum +++ b/config/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/credentials/go.sum b/credentials/go.sum index 0cd7164dc96..625759526c2 100644 --- a/credentials/go.sum +++ b/credentials/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= diff --git a/ec2imds/go.mod b/ec2imds/go.mod index 939b54dd61f..0e111439557 100644 --- a/ec2imds/go.mod +++ b/ec2imds/go.mod @@ -4,7 +4,7 @@ go 1.15 require ( github.com/aws/aws-sdk-go-v2 v0.29.0 - github.com/awslabs/smithy-go v0.3.1-0.20201103180816-d4c6ec013e15 + github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 github.com/google/go-cmp v0.4.1 ) diff --git a/ec2imds/go.sum b/ec2imds/go.sum index c669e324b14..32595049f96 100644 --- a/ec2imds/go.sum +++ b/ec2imds/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/example/service/s3/listObjects/go.sum b/example/service/s3/listObjects/go.sum index c669e324b14..5912fa6728c 100644 --- a/example/service/s3/listObjects/go.sum +++ b/example/service/s3/listObjects/go.sum @@ -1,3 +1,6 @@ +github.com/awslabs/smithy-go v0.3.0/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/feature/s3/manager/go.sum b/feature/s3/manager/go.sum index b9e71324395..d4252855102 100644 --- a/feature/s3/manager/go.sum +++ b/feature/s3/manager/go.sum @@ -1,3 +1,6 @@ +github.com/awslabs/smithy-go v0.3.0/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= diff --git a/go.sum b/go.sum index b9e71324395..d5bdf8df7f8 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= diff --git a/internal/protocoltest/awsrestjson/go.sum b/internal/protocoltest/awsrestjson/go.sum index c669e324b14..32595049f96 100644 --- a/internal/protocoltest/awsrestjson/go.sum +++ b/internal/protocoltest/awsrestjson/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/internal/protocoltest/awsrestjson/types/enums.go b/internal/protocoltest/awsrestjson/types/enums.go index 0cd80d8cc7a..a0088b218b8 100644 --- a/internal/protocoltest/awsrestjson/types/enums.go +++ b/internal/protocoltest/awsrestjson/types/enums.go @@ -6,11 +6,11 @@ type FooEnum string // Enum values for FooEnum const ( - FooEnumFoo FooEnum = "Foo" - FooEnumBaz FooEnum = "Baz" - FooEnumBar FooEnum = "Bar" - FooEnum1 FooEnum = "1" - FooEnum0 FooEnum = "0" + FooEnumFoo FooEnum = "Foo" + FooEnumBaz FooEnum = "Baz" + FooEnumBar FooEnum = "Bar" + FooEnumOne FooEnum = "1" + FooEnumZero FooEnum = "0" ) // Values returns all known values for FooEnum. Note that this can be expanded in diff --git a/internal/protocoltest/ec2query/go.sum b/internal/protocoltest/ec2query/go.sum index c669e324b14..32595049f96 100644 --- a/internal/protocoltest/ec2query/go.sum +++ b/internal/protocoltest/ec2query/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/internal/protocoltest/ec2query/types/enums.go b/internal/protocoltest/ec2query/types/enums.go index 0cd80d8cc7a..a0088b218b8 100644 --- a/internal/protocoltest/ec2query/types/enums.go +++ b/internal/protocoltest/ec2query/types/enums.go @@ -6,11 +6,11 @@ type FooEnum string // Enum values for FooEnum const ( - FooEnumFoo FooEnum = "Foo" - FooEnumBaz FooEnum = "Baz" - FooEnumBar FooEnum = "Bar" - FooEnum1 FooEnum = "1" - FooEnum0 FooEnum = "0" + FooEnumFoo FooEnum = "Foo" + FooEnumBaz FooEnum = "Baz" + FooEnumBar FooEnum = "Bar" + FooEnumOne FooEnum = "1" + FooEnumZero FooEnum = "0" ) // Values returns all known values for FooEnum. Note that this can be expanded in diff --git a/internal/protocoltest/jsonrpc/go.sum b/internal/protocoltest/jsonrpc/go.sum index c669e324b14..32595049f96 100644 --- a/internal/protocoltest/jsonrpc/go.sum +++ b/internal/protocoltest/jsonrpc/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/internal/protocoltest/jsonrpc/types/enums.go b/internal/protocoltest/jsonrpc/types/enums.go index 0cd80d8cc7a..a0088b218b8 100644 --- a/internal/protocoltest/jsonrpc/types/enums.go +++ b/internal/protocoltest/jsonrpc/types/enums.go @@ -6,11 +6,11 @@ type FooEnum string // Enum values for FooEnum const ( - FooEnumFoo FooEnum = "Foo" - FooEnumBaz FooEnum = "Baz" - FooEnumBar FooEnum = "Bar" - FooEnum1 FooEnum = "1" - FooEnum0 FooEnum = "0" + FooEnumFoo FooEnum = "Foo" + FooEnumBaz FooEnum = "Baz" + FooEnumBar FooEnum = "Bar" + FooEnumOne FooEnum = "1" + FooEnumZero FooEnum = "0" ) // Values returns all known values for FooEnum. Note that this can be expanded in diff --git a/internal/protocoltest/jsonrpc10/go.sum b/internal/protocoltest/jsonrpc10/go.sum index c669e324b14..32595049f96 100644 --- a/internal/protocoltest/jsonrpc10/go.sum +++ b/internal/protocoltest/jsonrpc10/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/internal/protocoltest/jsonrpc10/types/enums.go b/internal/protocoltest/jsonrpc10/types/enums.go index 0cd80d8cc7a..a0088b218b8 100644 --- a/internal/protocoltest/jsonrpc10/types/enums.go +++ b/internal/protocoltest/jsonrpc10/types/enums.go @@ -6,11 +6,11 @@ type FooEnum string // Enum values for FooEnum const ( - FooEnumFoo FooEnum = "Foo" - FooEnumBaz FooEnum = "Baz" - FooEnumBar FooEnum = "Bar" - FooEnum1 FooEnum = "1" - FooEnum0 FooEnum = "0" + FooEnumFoo FooEnum = "Foo" + FooEnumBaz FooEnum = "Baz" + FooEnumBar FooEnum = "Bar" + FooEnumOne FooEnum = "1" + FooEnumZero FooEnum = "0" ) // Values returns all known values for FooEnum. Note that this can be expanded in diff --git a/internal/protocoltest/query/go.sum b/internal/protocoltest/query/go.sum index c669e324b14..32595049f96 100644 --- a/internal/protocoltest/query/go.sum +++ b/internal/protocoltest/query/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/internal/protocoltest/query/types/enums.go b/internal/protocoltest/query/types/enums.go index 0cd80d8cc7a..a0088b218b8 100644 --- a/internal/protocoltest/query/types/enums.go +++ b/internal/protocoltest/query/types/enums.go @@ -6,11 +6,11 @@ type FooEnum string // Enum values for FooEnum const ( - FooEnumFoo FooEnum = "Foo" - FooEnumBaz FooEnum = "Baz" - FooEnumBar FooEnum = "Bar" - FooEnum1 FooEnum = "1" - FooEnum0 FooEnum = "0" + FooEnumFoo FooEnum = "Foo" + FooEnumBaz FooEnum = "Baz" + FooEnumBar FooEnum = "Bar" + FooEnumOne FooEnum = "1" + FooEnumZero FooEnum = "0" ) // Values returns all known values for FooEnum. Note that this can be expanded in diff --git a/internal/protocoltest/restxml/go.sum b/internal/protocoltest/restxml/go.sum index c669e324b14..32595049f96 100644 --- a/internal/protocoltest/restxml/go.sum +++ b/internal/protocoltest/restxml/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/internal/protocoltest/restxml/types/enums.go b/internal/protocoltest/restxml/types/enums.go index 0cd80d8cc7a..a0088b218b8 100644 --- a/internal/protocoltest/restxml/types/enums.go +++ b/internal/protocoltest/restxml/types/enums.go @@ -6,11 +6,11 @@ type FooEnum string // Enum values for FooEnum const ( - FooEnumFoo FooEnum = "Foo" - FooEnumBaz FooEnum = "Baz" - FooEnumBar FooEnum = "Bar" - FooEnum1 FooEnum = "1" - FooEnum0 FooEnum = "0" + FooEnumFoo FooEnum = "Foo" + FooEnumBaz FooEnum = "Baz" + FooEnumBar FooEnum = "Bar" + FooEnumOne FooEnum = "1" + FooEnumZero FooEnum = "0" ) // Values returns all known values for FooEnum. Note that this can be expanded in diff --git a/service/accessanalyzer/go.sum b/service/accessanalyzer/go.sum index c669e324b14..32595049f96 100644 --- a/service/accessanalyzer/go.sum +++ b/service/accessanalyzer/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/accessanalyzer/paginators.go b/service/accessanalyzer/paginators.go new file mode 100644 index 00000000000..516f0f1f198 --- /dev/null +++ b/service/accessanalyzer/paginators.go @@ -0,0 +1,307 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package accessanalyzer + +import ( + "context" + "fmt" +) + +// ListFindingsAPIClient is a client that implements the ListFindings operation. +type ListFindingsAPIClient interface { + ListFindings(context.Context, *ListFindingsInput, ...func(*Options)) (*ListFindingsOutput, error) +} + +var _ ListFindingsAPIClient = (*Client)(nil) + +// ListFindingsPaginatorOptions is the paginator options for ListFindings +type ListFindingsPaginatorOptions struct { + // The maximum number of results to return in the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListFindingsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/accessanalyzer.ListFindings +type ListFindingsPaginator struct { + options ListFindingsPaginatorOptions + client ListFindingsAPIClient + params *ListFindingsInput + nextToken *string + firstPage bool + done bool +} + +// NewListFindingsPaginator returns a new ListFindingsPaginator +func NewListFindingsPaginator(client ListFindingsAPIClient, params *ListFindingsInput, optFns ...func(*ListFindingsPaginatorOptions)) *ListFindingsPaginator { + options := ListFindingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListFindingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListFindingsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListFindings page. +func (p *ListFindingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFindingsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListFindings(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListAnalyzedResourcesAPIClient is a client that implements the +// ListAnalyzedResources operation. +type ListAnalyzedResourcesAPIClient interface { + ListAnalyzedResources(context.Context, *ListAnalyzedResourcesInput, ...func(*Options)) (*ListAnalyzedResourcesOutput, error) +} + +var _ ListAnalyzedResourcesAPIClient = (*Client)(nil) + +// ListAnalyzedResourcesPaginatorOptions is the paginator options for +// ListAnalyzedResources +type ListAnalyzedResourcesPaginatorOptions struct { + // The maximum number of results to return in the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAnalyzedResourcesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/accessanalyzer.ListAnalyzedResources +type ListAnalyzedResourcesPaginator struct { + options ListAnalyzedResourcesPaginatorOptions + client ListAnalyzedResourcesAPIClient + params *ListAnalyzedResourcesInput + nextToken *string + firstPage bool + done bool +} + +// NewListAnalyzedResourcesPaginator returns a new ListAnalyzedResourcesPaginator +func NewListAnalyzedResourcesPaginator(client ListAnalyzedResourcesAPIClient, params *ListAnalyzedResourcesInput, optFns ...func(*ListAnalyzedResourcesPaginatorOptions)) *ListAnalyzedResourcesPaginator { + options := ListAnalyzedResourcesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAnalyzedResourcesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAnalyzedResourcesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAnalyzedResources page. +func (p *ListAnalyzedResourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAnalyzedResourcesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListAnalyzedResources(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListAnalyzersAPIClient is a client that implements the ListAnalyzers operation. +type ListAnalyzersAPIClient interface { + ListAnalyzers(context.Context, *ListAnalyzersInput, ...func(*Options)) (*ListAnalyzersOutput, error) +} + +var _ ListAnalyzersAPIClient = (*Client)(nil) + +// ListAnalyzersPaginatorOptions is the paginator options for ListAnalyzers +type ListAnalyzersPaginatorOptions struct { + // The maximum number of results to return in the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAnalyzersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/accessanalyzer.ListAnalyzers +type ListAnalyzersPaginator struct { + options ListAnalyzersPaginatorOptions + client ListAnalyzersAPIClient + params *ListAnalyzersInput + nextToken *string + firstPage bool + done bool +} + +// NewListAnalyzersPaginator returns a new ListAnalyzersPaginator +func NewListAnalyzersPaginator(client ListAnalyzersAPIClient, params *ListAnalyzersInput, optFns ...func(*ListAnalyzersPaginatorOptions)) *ListAnalyzersPaginator { + options := ListAnalyzersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAnalyzersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAnalyzersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAnalyzers page. +func (p *ListAnalyzersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAnalyzersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListAnalyzers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListArchiveRulesAPIClient is a client that implements the ListArchiveRules +// operation. +type ListArchiveRulesAPIClient interface { + ListArchiveRules(context.Context, *ListArchiveRulesInput, ...func(*Options)) (*ListArchiveRulesOutput, error) +} + +var _ ListArchiveRulesAPIClient = (*Client)(nil) + +// ListArchiveRulesPaginatorOptions is the paginator options for ListArchiveRules +type ListArchiveRulesPaginatorOptions struct { + // The maximum number of results to return in the request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListArchiveRulesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/accessanalyzer.ListArchiveRules +type ListArchiveRulesPaginator struct { + options ListArchiveRulesPaginatorOptions + client ListArchiveRulesAPIClient + params *ListArchiveRulesInput + nextToken *string + firstPage bool + done bool +} + +// NewListArchiveRulesPaginator returns a new ListArchiveRulesPaginator +func NewListArchiveRulesPaginator(client ListArchiveRulesAPIClient, params *ListArchiveRulesInput, optFns ...func(*ListArchiveRulesPaginatorOptions)) *ListArchiveRulesPaginator { + options := ListArchiveRulesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListArchiveRulesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListArchiveRulesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListArchiveRules page. +func (p *ListArchiveRulesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListArchiveRulesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListArchiveRules(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/acm/go.sum b/service/acm/go.sum index c669e324b14..32595049f96 100644 --- a/service/acm/go.sum +++ b/service/acm/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/acm/paginators.go b/service/acm/paginators.go new file mode 100644 index 00000000000..9c59a351a4f --- /dev/null +++ b/service/acm/paginators.go @@ -0,0 +1,86 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package acm + +import ( + "context" + "fmt" +) + +// ListCertificatesAPIClient is a client that implements the ListCertificates +// operation. +type ListCertificatesAPIClient interface { + ListCertificates(context.Context, *ListCertificatesInput, ...func(*Options)) (*ListCertificatesOutput, error) +} + +var _ ListCertificatesAPIClient = (*Client)(nil) + +// ListCertificatesPaginatorOptions is the paginator options for ListCertificates +type ListCertificatesPaginatorOptions struct { + // Use this parameter when paginating results to specify the maximum number of + // items to return in the response. If additional items exist beyond the number you + // specify, the NextToken element is sent in the response. Use this NextToken value + // in a subsequent request to retrieve additional items. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListCertificatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/acm.ListCertificates +type ListCertificatesPaginator struct { + options ListCertificatesPaginatorOptions + client ListCertificatesAPIClient + params *ListCertificatesInput + nextToken *string + firstPage bool + done bool +} + +// NewListCertificatesPaginator returns a new ListCertificatesPaginator +func NewListCertificatesPaginator(client ListCertificatesAPIClient, params *ListCertificatesInput, optFns ...func(*ListCertificatesPaginatorOptions)) *ListCertificatesPaginator { + options := ListCertificatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListCertificatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCertificatesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListCertificates page. +func (p *ListCertificatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCertificatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxItems = p.options.Limit + result, err := p.client.ListCertificates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/acmpca/go.sum b/service/acmpca/go.sum index c669e324b14..32595049f96 100644 --- a/service/acmpca/go.sum +++ b/service/acmpca/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/acmpca/paginators.go b/service/acmpca/paginators.go new file mode 100644 index 00000000000..f7ad71d37d0 --- /dev/null +++ b/service/acmpca/paginators.go @@ -0,0 +1,243 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package acmpca + +import ( + "context" + "fmt" +) + +// ListCertificateAuthoritiesAPIClient is a client that implements the +// ListCertificateAuthorities operation. +type ListCertificateAuthoritiesAPIClient interface { + ListCertificateAuthorities(context.Context, *ListCertificateAuthoritiesInput, ...func(*Options)) (*ListCertificateAuthoritiesOutput, error) +} + +var _ ListCertificateAuthoritiesAPIClient = (*Client)(nil) + +// ListCertificateAuthoritiesPaginatorOptions is the paginator options for +// ListCertificateAuthorities +type ListCertificateAuthoritiesPaginatorOptions struct { + // Use this parameter when paginating results to specify the maximum number of + // items to return in the response on each page. If additional items exist beyond + // the number you specify, the NextToken element is sent in the response. Use this + // NextToken value in a subsequent request to retrieve additional items. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListCertificateAuthoritiesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/acmpca.ListCertificateAuthorities +type ListCertificateAuthoritiesPaginator struct { + options ListCertificateAuthoritiesPaginatorOptions + client ListCertificateAuthoritiesAPIClient + params *ListCertificateAuthoritiesInput + nextToken *string + firstPage bool + done bool +} + +// NewListCertificateAuthoritiesPaginator returns a new +// ListCertificateAuthoritiesPaginator +func NewListCertificateAuthoritiesPaginator(client ListCertificateAuthoritiesAPIClient, params *ListCertificateAuthoritiesInput, optFns ...func(*ListCertificateAuthoritiesPaginatorOptions)) *ListCertificateAuthoritiesPaginator { + options := ListCertificateAuthoritiesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListCertificateAuthoritiesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCertificateAuthoritiesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListCertificateAuthorities page. +func (p *ListCertificateAuthoritiesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCertificateAuthoritiesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListCertificateAuthorities(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTagsAPIClient is a client that implements the ListTags operation. +type ListTagsAPIClient interface { + ListTags(context.Context, *ListTagsInput, ...func(*Options)) (*ListTagsOutput, error) +} + +var _ ListTagsAPIClient = (*Client)(nil) + +// ListTagsPaginatorOptions is the paginator options for ListTags +type ListTagsPaginatorOptions struct { + // Use this parameter when paginating results to specify the maximum number of + // items to return in the response. If additional items exist beyond the number you + // specify, the NextToken element is sent in the response. Use this NextToken value + // in a subsequent request to retrieve additional items. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTagsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/acmpca.ListTags +type ListTagsPaginator struct { + options ListTagsPaginatorOptions + client ListTagsAPIClient + params *ListTagsInput + nextToken *string + firstPage bool + done bool +} + +// NewListTagsPaginator returns a new ListTagsPaginator +func NewListTagsPaginator(client ListTagsAPIClient, params *ListTagsInput, optFns ...func(*ListTagsPaginatorOptions)) *ListTagsPaginator { + options := ListTagsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTagsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTagsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTags page. +func (p *ListTagsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTagsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListTags(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListPermissionsAPIClient is a client that implements the ListPermissions +// operation. +type ListPermissionsAPIClient interface { + ListPermissions(context.Context, *ListPermissionsInput, ...func(*Options)) (*ListPermissionsOutput, error) +} + +var _ ListPermissionsAPIClient = (*Client)(nil) + +// ListPermissionsPaginatorOptions is the paginator options for ListPermissions +type ListPermissionsPaginatorOptions struct { + // When paginating results, use this parameter to specify the maximum number of + // items to return in the response. If additional items exist beyond the number you + // specify, the NextToken element is sent in the response. Use this NextToken value + // in a subsequent request to retrieve additional items. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListPermissionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/acmpca.ListPermissions +type ListPermissionsPaginator struct { + options ListPermissionsPaginatorOptions + client ListPermissionsAPIClient + params *ListPermissionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListPermissionsPaginator returns a new ListPermissionsPaginator +func NewListPermissionsPaginator(client ListPermissionsAPIClient, params *ListPermissionsInput, optFns ...func(*ListPermissionsPaginatorOptions)) *ListPermissionsPaginator { + options := ListPermissionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListPermissionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPermissionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListPermissions page. +func (p *ListPermissionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPermissionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListPermissions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/alexaforbusiness/go.sum b/service/alexaforbusiness/go.sum index c669e324b14..32595049f96 100644 --- a/service/alexaforbusiness/go.sum +++ b/service/alexaforbusiness/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/alexaforbusiness/paginators.go b/service/alexaforbusiness/paginators.go new file mode 100644 index 00000000000..07dc553d222 --- /dev/null +++ b/service/alexaforbusiness/paginators.go @@ -0,0 +1,1386 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package alexaforbusiness + +import ( + "context" + "fmt" +) + +// SearchProfilesAPIClient is a client that implements the SearchProfiles +// operation. +type SearchProfilesAPIClient interface { + SearchProfiles(context.Context, *SearchProfilesInput, ...func(*Options)) (*SearchProfilesOutput, error) +} + +var _ SearchProfilesAPIClient = (*Client)(nil) + +// SearchProfilesPaginatorOptions is the paginator options for SearchProfiles +type SearchProfilesPaginatorOptions struct { + // The maximum number of results to include in the response. If more results exist + // than the specified MaxResults value, a token is included in the response so that + // the remaining results can be retrieved. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// SearchProfilesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/alexaforbusiness.SearchProfiles +type SearchProfilesPaginator struct { + options SearchProfilesPaginatorOptions + client SearchProfilesAPIClient + params *SearchProfilesInput + nextToken *string + firstPage bool + done bool +} + +// NewSearchProfilesPaginator returns a new SearchProfilesPaginator +func NewSearchProfilesPaginator(client SearchProfilesAPIClient, params *SearchProfilesInput, optFns ...func(*SearchProfilesPaginatorOptions)) *SearchProfilesPaginator { + options := SearchProfilesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &SearchProfilesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchProfilesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next SearchProfiles page. +func (p *SearchProfilesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchProfilesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.SearchProfiles(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// SearchRoomsAPIClient is a client that implements the SearchRooms operation. +type SearchRoomsAPIClient interface { + SearchRooms(context.Context, *SearchRoomsInput, ...func(*Options)) (*SearchRoomsOutput, error) +} + +var _ SearchRoomsAPIClient = (*Client)(nil) + +// SearchRoomsPaginatorOptions is the paginator options for SearchRooms +type SearchRoomsPaginatorOptions struct { + // The maximum number of results to include in the response. If more results exist + // than the specified MaxResults value, a token is included in the response so that + // the remaining results can be retrieved. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// SearchRoomsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/alexaforbusiness.SearchRooms +type SearchRoomsPaginator struct { + options SearchRoomsPaginatorOptions + client SearchRoomsAPIClient + params *SearchRoomsInput + nextToken *string + firstPage bool + done bool +} + +// NewSearchRoomsPaginator returns a new SearchRoomsPaginator +func NewSearchRoomsPaginator(client SearchRoomsAPIClient, params *SearchRoomsInput, optFns ...func(*SearchRoomsPaginatorOptions)) *SearchRoomsPaginator { + options := SearchRoomsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &SearchRoomsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchRoomsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next SearchRooms page. +func (p *SearchRoomsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchRoomsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.SearchRooms(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// SearchNetworkProfilesAPIClient is a client that implements the +// SearchNetworkProfiles operation. +type SearchNetworkProfilesAPIClient interface { + SearchNetworkProfiles(context.Context, *SearchNetworkProfilesInput, ...func(*Options)) (*SearchNetworkProfilesOutput, error) +} + +var _ SearchNetworkProfilesAPIClient = (*Client)(nil) + +// SearchNetworkProfilesPaginatorOptions is the paginator options for +// SearchNetworkProfiles +type SearchNetworkProfilesPaginatorOptions struct { + // The maximum number of results to include in the response. If more results exist + // than the specified MaxResults value, a token is included in the response so that + // the remaining results can be retrieved. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// SearchNetworkProfilesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/alexaforbusiness.SearchNetworkProfiles +type SearchNetworkProfilesPaginator struct { + options SearchNetworkProfilesPaginatorOptions + client SearchNetworkProfilesAPIClient + params *SearchNetworkProfilesInput + nextToken *string + firstPage bool + done bool +} + +// NewSearchNetworkProfilesPaginator returns a new SearchNetworkProfilesPaginator +func NewSearchNetworkProfilesPaginator(client SearchNetworkProfilesAPIClient, params *SearchNetworkProfilesInput, optFns ...func(*SearchNetworkProfilesPaginatorOptions)) *SearchNetworkProfilesPaginator { + options := SearchNetworkProfilesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &SearchNetworkProfilesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchNetworkProfilesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next SearchNetworkProfiles page. +func (p *SearchNetworkProfilesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchNetworkProfilesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.SearchNetworkProfiles(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListConferenceProvidersAPIClient is a client that implements the +// ListConferenceProviders operation. +type ListConferenceProvidersAPIClient interface { + ListConferenceProviders(context.Context, *ListConferenceProvidersInput, ...func(*Options)) (*ListConferenceProvidersOutput, error) +} + +var _ ListConferenceProvidersAPIClient = (*Client)(nil) + +// ListConferenceProvidersPaginatorOptions is the paginator options for +// ListConferenceProviders +type ListConferenceProvidersPaginatorOptions struct { + // The maximum number of conference providers to be returned, per paginated calls. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListConferenceProvidersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/alexaforbusiness.ListConferenceProviders +type ListConferenceProvidersPaginator struct { + options ListConferenceProvidersPaginatorOptions + client ListConferenceProvidersAPIClient + params *ListConferenceProvidersInput + nextToken *string + firstPage bool + done bool +} + +// NewListConferenceProvidersPaginator returns a new +// ListConferenceProvidersPaginator +func NewListConferenceProvidersPaginator(client ListConferenceProvidersAPIClient, params *ListConferenceProvidersInput, optFns ...func(*ListConferenceProvidersPaginatorOptions)) *ListConferenceProvidersPaginator { + options := ListConferenceProvidersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListConferenceProvidersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListConferenceProvidersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListConferenceProviders page. +func (p *ListConferenceProvidersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListConferenceProvidersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListConferenceProviders(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// SearchContactsAPIClient is a client that implements the SearchContacts +// operation. +type SearchContactsAPIClient interface { + SearchContacts(context.Context, *SearchContactsInput, ...func(*Options)) (*SearchContactsOutput, error) +} + +var _ SearchContactsAPIClient = (*Client)(nil) + +// SearchContactsPaginatorOptions is the paginator options for SearchContacts +type SearchContactsPaginatorOptions struct { + // The maximum number of results to include in the response. If more results exist + // than the specified MaxResults value, a token is included in the response so that + // the remaining results can be retrieved. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// SearchContactsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/alexaforbusiness.SearchContacts +type SearchContactsPaginator struct { + options SearchContactsPaginatorOptions + client SearchContactsAPIClient + params *SearchContactsInput + nextToken *string + firstPage bool + done bool +} + +// NewSearchContactsPaginator returns a new SearchContactsPaginator +func NewSearchContactsPaginator(client SearchContactsAPIClient, params *SearchContactsInput, optFns ...func(*SearchContactsPaginatorOptions)) *SearchContactsPaginator { + options := SearchContactsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &SearchContactsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchContactsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next SearchContacts page. +func (p *SearchContactsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchContactsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.SearchContacts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// SearchAddressBooksAPIClient is a client that implements the SearchAddressBooks +// operation. +type SearchAddressBooksAPIClient interface { + SearchAddressBooks(context.Context, *SearchAddressBooksInput, ...func(*Options)) (*SearchAddressBooksOutput, error) +} + +var _ SearchAddressBooksAPIClient = (*Client)(nil) + +// SearchAddressBooksPaginatorOptions is the paginator options for +// SearchAddressBooks +type SearchAddressBooksPaginatorOptions struct { + // The maximum number of results to include in the response. If more results exist + // than the specified MaxResults value, a token is included in the response so that + // the remaining results can be retrieved. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// SearchAddressBooksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/alexaforbusiness.SearchAddressBooks +type SearchAddressBooksPaginator struct { + options SearchAddressBooksPaginatorOptions + client SearchAddressBooksAPIClient + params *SearchAddressBooksInput + nextToken *string + firstPage bool + done bool +} + +// NewSearchAddressBooksPaginator returns a new SearchAddressBooksPaginator +func NewSearchAddressBooksPaginator(client SearchAddressBooksAPIClient, params *SearchAddressBooksInput, optFns ...func(*SearchAddressBooksPaginatorOptions)) *SearchAddressBooksPaginator { + options := SearchAddressBooksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &SearchAddressBooksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchAddressBooksPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next SearchAddressBooks page. +func (p *SearchAddressBooksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchAddressBooksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.SearchAddressBooks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTagsAPIClient is a client that implements the ListTags operation. +type ListTagsAPIClient interface { + ListTags(context.Context, *ListTagsInput, ...func(*Options)) (*ListTagsOutput, error) +} + +var _ ListTagsAPIClient = (*Client)(nil) + +// ListTagsPaginatorOptions is the paginator options for ListTags +type ListTagsPaginatorOptions struct { + // The maximum number of results to include in the response. If more results exist + // than the specified MaxResults value, a token is included in the response so that + // the remaining results can be retrieved. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTagsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/alexaforbusiness.ListTags +type ListTagsPaginator struct { + options ListTagsPaginatorOptions + client ListTagsAPIClient + params *ListTagsInput + nextToken *string + firstPage bool + done bool +} + +// NewListTagsPaginator returns a new ListTagsPaginator +func NewListTagsPaginator(client ListTagsAPIClient, params *ListTagsInput, optFns ...func(*ListTagsPaginatorOptions)) *ListTagsPaginator { + options := ListTagsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTagsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTagsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTags page. +func (p *ListTagsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTagsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListTags(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// SearchUsersAPIClient is a client that implements the SearchUsers operation. +type SearchUsersAPIClient interface { + SearchUsers(context.Context, *SearchUsersInput, ...func(*Options)) (*SearchUsersOutput, error) +} + +var _ SearchUsersAPIClient = (*Client)(nil) + +// SearchUsersPaginatorOptions is the paginator options for SearchUsers +type SearchUsersPaginatorOptions struct { + // The maximum number of results to include in the response. If more results exist + // than the specified MaxResults value, a token is included in the response so that + // the remaining results can be retrieved. Required. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// SearchUsersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/alexaforbusiness.SearchUsers +type SearchUsersPaginator struct { + options SearchUsersPaginatorOptions + client SearchUsersAPIClient + params *SearchUsersInput + nextToken *string + firstPage bool + done bool +} + +// NewSearchUsersPaginator returns a new SearchUsersPaginator +func NewSearchUsersPaginator(client SearchUsersAPIClient, params *SearchUsersInput, optFns ...func(*SearchUsersPaginatorOptions)) *SearchUsersPaginator { + options := SearchUsersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &SearchUsersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchUsersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next SearchUsers page. +func (p *SearchUsersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchUsersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.SearchUsers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// SearchDevicesAPIClient is a client that implements the SearchDevices operation. +type SearchDevicesAPIClient interface { + SearchDevices(context.Context, *SearchDevicesInput, ...func(*Options)) (*SearchDevicesOutput, error) +} + +var _ SearchDevicesAPIClient = (*Client)(nil) + +// SearchDevicesPaginatorOptions is the paginator options for SearchDevices +type SearchDevicesPaginatorOptions struct { + // The maximum number of results to include in the response. If more results exist + // than the specified MaxResults value, a token is included in the response so that + // the remaining results can be retrieved. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// SearchDevicesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/alexaforbusiness.SearchDevices +type SearchDevicesPaginator struct { + options SearchDevicesPaginatorOptions + client SearchDevicesAPIClient + params *SearchDevicesInput + nextToken *string + firstPage bool + done bool +} + +// NewSearchDevicesPaginator returns a new SearchDevicesPaginator +func NewSearchDevicesPaginator(client SearchDevicesAPIClient, params *SearchDevicesInput, optFns ...func(*SearchDevicesPaginatorOptions)) *SearchDevicesPaginator { + options := SearchDevicesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &SearchDevicesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchDevicesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next SearchDevices page. +func (p *SearchDevicesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchDevicesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.SearchDevices(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDeviceEventsAPIClient is a client that implements the ListDeviceEvents +// operation. +type ListDeviceEventsAPIClient interface { + ListDeviceEvents(context.Context, *ListDeviceEventsInput, ...func(*Options)) (*ListDeviceEventsOutput, error) +} + +var _ ListDeviceEventsAPIClient = (*Client)(nil) + +// ListDeviceEventsPaginatorOptions is the paginator options for ListDeviceEvents +type ListDeviceEventsPaginatorOptions struct { + // The maximum number of results to include in the response. The default value is + // 50. If more results exist than the specified MaxResults value, a token is + // included in the response so that the remaining results can be retrieved. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDeviceEventsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/alexaforbusiness.ListDeviceEvents +type ListDeviceEventsPaginator struct { + options ListDeviceEventsPaginatorOptions + client ListDeviceEventsAPIClient + params *ListDeviceEventsInput + nextToken *string + firstPage bool + done bool +} + +// NewListDeviceEventsPaginator returns a new ListDeviceEventsPaginator +func NewListDeviceEventsPaginator(client ListDeviceEventsAPIClient, params *ListDeviceEventsInput, optFns ...func(*ListDeviceEventsPaginatorOptions)) *ListDeviceEventsPaginator { + options := ListDeviceEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDeviceEventsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDeviceEventsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDeviceEvents page. +func (p *ListDeviceEventsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDeviceEventsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListDeviceEvents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListGatewayGroupsAPIClient is a client that implements the ListGatewayGroups +// operation. +type ListGatewayGroupsAPIClient interface { + ListGatewayGroups(context.Context, *ListGatewayGroupsInput, ...func(*Options)) (*ListGatewayGroupsOutput, error) +} + +var _ ListGatewayGroupsAPIClient = (*Client)(nil) + +// ListGatewayGroupsPaginatorOptions is the paginator options for ListGatewayGroups +type ListGatewayGroupsPaginatorOptions struct { + // The maximum number of gateway group summaries to return. The default is 50. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListGatewayGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/alexaforbusiness.ListGatewayGroups +type ListGatewayGroupsPaginator struct { + options ListGatewayGroupsPaginatorOptions + client ListGatewayGroupsAPIClient + params *ListGatewayGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewListGatewayGroupsPaginator returns a new ListGatewayGroupsPaginator +func NewListGatewayGroupsPaginator(client ListGatewayGroupsAPIClient, params *ListGatewayGroupsInput, optFns ...func(*ListGatewayGroupsPaginatorOptions)) *ListGatewayGroupsPaginator { + options := ListGatewayGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListGatewayGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListGatewayGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListGatewayGroups page. +func (p *ListGatewayGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListGatewayGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListGatewayGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListSkillsAPIClient is a client that implements the ListSkills operation. +type ListSkillsAPIClient interface { + ListSkills(context.Context, *ListSkillsInput, ...func(*Options)) (*ListSkillsOutput, error) +} + +var _ ListSkillsAPIClient = (*Client)(nil) + +// ListSkillsPaginatorOptions is the paginator options for ListSkills +type ListSkillsPaginatorOptions struct { + // The maximum number of results to include in the response. If more results exist + // than the specified MaxResults value, a token is included in the response so that + // the remaining results can be retrieved. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListSkillsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/alexaforbusiness.ListSkills +type ListSkillsPaginator struct { + options ListSkillsPaginatorOptions + client ListSkillsAPIClient + params *ListSkillsInput + nextToken *string + firstPage bool + done bool +} + +// NewListSkillsPaginator returns a new ListSkillsPaginator +func NewListSkillsPaginator(client ListSkillsAPIClient, params *ListSkillsInput, optFns ...func(*ListSkillsPaginatorOptions)) *ListSkillsPaginator { + options := ListSkillsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListSkillsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSkillsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListSkills page. +func (p *ListSkillsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSkillsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListSkills(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListSmartHomeAppliancesAPIClient is a client that implements the +// ListSmartHomeAppliances operation. +type ListSmartHomeAppliancesAPIClient interface { + ListSmartHomeAppliances(context.Context, *ListSmartHomeAppliancesInput, ...func(*Options)) (*ListSmartHomeAppliancesOutput, error) +} + +var _ ListSmartHomeAppliancesAPIClient = (*Client)(nil) + +// ListSmartHomeAppliancesPaginatorOptions is the paginator options for +// ListSmartHomeAppliances +type ListSmartHomeAppliancesPaginatorOptions struct { + // The maximum number of appliances to be returned, per paginated calls. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListSmartHomeAppliancesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/alexaforbusiness.ListSmartHomeAppliances +type ListSmartHomeAppliancesPaginator struct { + options ListSmartHomeAppliancesPaginatorOptions + client ListSmartHomeAppliancesAPIClient + params *ListSmartHomeAppliancesInput + nextToken *string + firstPage bool + done bool +} + +// NewListSmartHomeAppliancesPaginator returns a new +// ListSmartHomeAppliancesPaginator +func NewListSmartHomeAppliancesPaginator(client ListSmartHomeAppliancesAPIClient, params *ListSmartHomeAppliancesInput, optFns ...func(*ListSmartHomeAppliancesPaginatorOptions)) *ListSmartHomeAppliancesPaginator { + options := ListSmartHomeAppliancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListSmartHomeAppliancesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSmartHomeAppliancesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListSmartHomeAppliances page. +func (p *ListSmartHomeAppliancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSmartHomeAppliancesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListSmartHomeAppliances(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListSkillsStoreCategoriesAPIClient is a client that implements the +// ListSkillsStoreCategories operation. +type ListSkillsStoreCategoriesAPIClient interface { + ListSkillsStoreCategories(context.Context, *ListSkillsStoreCategoriesInput, ...func(*Options)) (*ListSkillsStoreCategoriesOutput, error) +} + +var _ ListSkillsStoreCategoriesAPIClient = (*Client)(nil) + +// ListSkillsStoreCategoriesPaginatorOptions is the paginator options for +// ListSkillsStoreCategories +type ListSkillsStoreCategoriesPaginatorOptions struct { + // The maximum number of categories returned, per paginated calls. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListSkillsStoreCategoriesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/alexaforbusiness.ListSkillsStoreCategories +type ListSkillsStoreCategoriesPaginator struct { + options ListSkillsStoreCategoriesPaginatorOptions + client ListSkillsStoreCategoriesAPIClient + params *ListSkillsStoreCategoriesInput + nextToken *string + firstPage bool + done bool +} + +// NewListSkillsStoreCategoriesPaginator returns a new +// ListSkillsStoreCategoriesPaginator +func NewListSkillsStoreCategoriesPaginator(client ListSkillsStoreCategoriesAPIClient, params *ListSkillsStoreCategoriesInput, optFns ...func(*ListSkillsStoreCategoriesPaginatorOptions)) *ListSkillsStoreCategoriesPaginator { + options := ListSkillsStoreCategoriesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListSkillsStoreCategoriesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSkillsStoreCategoriesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListSkillsStoreCategories page. +func (p *ListSkillsStoreCategoriesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSkillsStoreCategoriesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListSkillsStoreCategories(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListSkillsStoreSkillsByCategoryAPIClient is a client that implements the +// ListSkillsStoreSkillsByCategory operation. +type ListSkillsStoreSkillsByCategoryAPIClient interface { + ListSkillsStoreSkillsByCategory(context.Context, *ListSkillsStoreSkillsByCategoryInput, ...func(*Options)) (*ListSkillsStoreSkillsByCategoryOutput, error) +} + +var _ ListSkillsStoreSkillsByCategoryAPIClient = (*Client)(nil) + +// ListSkillsStoreSkillsByCategoryPaginatorOptions is the paginator options for +// ListSkillsStoreSkillsByCategory +type ListSkillsStoreSkillsByCategoryPaginatorOptions struct { + // The maximum number of skills returned per paginated calls. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListSkillsStoreSkillsByCategoryPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/alexaforbusiness.ListSkillsStoreSkillsByCategory +type ListSkillsStoreSkillsByCategoryPaginator struct { + options ListSkillsStoreSkillsByCategoryPaginatorOptions + client ListSkillsStoreSkillsByCategoryAPIClient + params *ListSkillsStoreSkillsByCategoryInput + nextToken *string + firstPage bool + done bool +} + +// NewListSkillsStoreSkillsByCategoryPaginator returns a new +// ListSkillsStoreSkillsByCategoryPaginator +func NewListSkillsStoreSkillsByCategoryPaginator(client ListSkillsStoreSkillsByCategoryAPIClient, params *ListSkillsStoreSkillsByCategoryInput, optFns ...func(*ListSkillsStoreSkillsByCategoryPaginatorOptions)) *ListSkillsStoreSkillsByCategoryPaginator { + options := ListSkillsStoreSkillsByCategoryPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListSkillsStoreSkillsByCategoryPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSkillsStoreSkillsByCategoryPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListSkillsStoreSkillsByCategory page. +func (p *ListSkillsStoreSkillsByCategoryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSkillsStoreSkillsByCategoryOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListSkillsStoreSkillsByCategory(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListGatewaysAPIClient is a client that implements the ListGateways operation. +type ListGatewaysAPIClient interface { + ListGateways(context.Context, *ListGatewaysInput, ...func(*Options)) (*ListGatewaysOutput, error) +} + +var _ ListGatewaysAPIClient = (*Client)(nil) + +// ListGatewaysPaginatorOptions is the paginator options for ListGateways +type ListGatewaysPaginatorOptions struct { + // The maximum number of gateway summaries to return. The default is 50. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListGatewaysPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/alexaforbusiness.ListGateways +type ListGatewaysPaginator struct { + options ListGatewaysPaginatorOptions + client ListGatewaysAPIClient + params *ListGatewaysInput + nextToken *string + firstPage bool + done bool +} + +// NewListGatewaysPaginator returns a new ListGatewaysPaginator +func NewListGatewaysPaginator(client ListGatewaysAPIClient, params *ListGatewaysInput, optFns ...func(*ListGatewaysPaginatorOptions)) *ListGatewaysPaginator { + options := ListGatewaysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListGatewaysPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListGatewaysPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListGateways page. +func (p *ListGatewaysPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListGatewaysOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListGateways(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListBusinessReportSchedulesAPIClient is a client that implements the +// ListBusinessReportSchedules operation. +type ListBusinessReportSchedulesAPIClient interface { + ListBusinessReportSchedules(context.Context, *ListBusinessReportSchedulesInput, ...func(*Options)) (*ListBusinessReportSchedulesOutput, error) +} + +var _ ListBusinessReportSchedulesAPIClient = (*Client)(nil) + +// ListBusinessReportSchedulesPaginatorOptions is the paginator options for +// ListBusinessReportSchedules +type ListBusinessReportSchedulesPaginatorOptions struct { + // The maximum number of schedules listed in the call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListBusinessReportSchedulesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/alexaforbusiness.ListBusinessReportSchedules +type ListBusinessReportSchedulesPaginator struct { + options ListBusinessReportSchedulesPaginatorOptions + client ListBusinessReportSchedulesAPIClient + params *ListBusinessReportSchedulesInput + nextToken *string + firstPage bool + done bool +} + +// NewListBusinessReportSchedulesPaginator returns a new +// ListBusinessReportSchedulesPaginator +func NewListBusinessReportSchedulesPaginator(client ListBusinessReportSchedulesAPIClient, params *ListBusinessReportSchedulesInput, optFns ...func(*ListBusinessReportSchedulesPaginatorOptions)) *ListBusinessReportSchedulesPaginator { + options := ListBusinessReportSchedulesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListBusinessReportSchedulesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListBusinessReportSchedulesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListBusinessReportSchedules page. +func (p *ListBusinessReportSchedulesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBusinessReportSchedulesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListBusinessReportSchedules(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// SearchSkillGroupsAPIClient is a client that implements the SearchSkillGroups +// operation. +type SearchSkillGroupsAPIClient interface { + SearchSkillGroups(context.Context, *SearchSkillGroupsInput, ...func(*Options)) (*SearchSkillGroupsOutput, error) +} + +var _ SearchSkillGroupsAPIClient = (*Client)(nil) + +// SearchSkillGroupsPaginatorOptions is the paginator options for SearchSkillGroups +type SearchSkillGroupsPaginatorOptions struct { + // The maximum number of results to include in the response. If more results exist + // than the specified MaxResults value, a token is included in the response so that + // the remaining results can be retrieved. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// SearchSkillGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/alexaforbusiness.SearchSkillGroups +type SearchSkillGroupsPaginator struct { + options SearchSkillGroupsPaginatorOptions + client SearchSkillGroupsAPIClient + params *SearchSkillGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewSearchSkillGroupsPaginator returns a new SearchSkillGroupsPaginator +func NewSearchSkillGroupsPaginator(client SearchSkillGroupsAPIClient, params *SearchSkillGroupsInput, optFns ...func(*SearchSkillGroupsPaginatorOptions)) *SearchSkillGroupsPaginator { + options := SearchSkillGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &SearchSkillGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchSkillGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next SearchSkillGroups page. +func (p *SearchSkillGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchSkillGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.SearchSkillGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/amplify/go.sum b/service/amplify/go.sum index c669e324b14..32595049f96 100644 --- a/service/amplify/go.sum +++ b/service/amplify/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/apigateway/go.sum b/service/apigateway/go.sum index c669e324b14..32595049f96 100644 --- a/service/apigateway/go.sum +++ b/service/apigateway/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/apigateway/paginators.go b/service/apigateway/paginators.go new file mode 100644 index 00000000000..4a1b3336e13 --- /dev/null +++ b/service/apigateway/paginators.go @@ -0,0 +1,915 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package apigateway + +import ( + "context" + "fmt" +) + +// GetClientCertificatesAPIClient is a client that implements the +// GetClientCertificates operation. +type GetClientCertificatesAPIClient interface { + GetClientCertificates(context.Context, *GetClientCertificatesInput, ...func(*Options)) (*GetClientCertificatesOutput, error) +} + +var _ GetClientCertificatesAPIClient = (*Client)(nil) + +// GetClientCertificatesPaginatorOptions is the paginator options for +// GetClientCertificates +type GetClientCertificatesPaginatorOptions struct { + // The maximum number of returned results per page. The default value is 25 and the + // maximum value is 500. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetClientCertificatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/apigateway.GetClientCertificates +type GetClientCertificatesPaginator struct { + options GetClientCertificatesPaginatorOptions + client GetClientCertificatesAPIClient + params *GetClientCertificatesInput + nextToken *string + firstPage bool + done bool +} + +// NewGetClientCertificatesPaginator returns a new GetClientCertificatesPaginator +func NewGetClientCertificatesPaginator(client GetClientCertificatesAPIClient, params *GetClientCertificatesInput, optFns ...func(*GetClientCertificatesPaginatorOptions)) *GetClientCertificatesPaginator { + options := GetClientCertificatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetClientCertificatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetClientCertificatesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetClientCertificates page. +func (p *GetClientCertificatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetClientCertificatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Position = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.GetClientCertificates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Position + if p.options.StopOnDuplicateToken && params.Position != nil && p.nextToken != nil && *params.Position == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetUsageAPIClient is a client that implements the GetUsage operation. +type GetUsageAPIClient interface { + GetUsage(context.Context, *GetUsageInput, ...func(*Options)) (*GetUsageOutput, error) +} + +var _ GetUsageAPIClient = (*Client)(nil) + +// GetUsagePaginatorOptions is the paginator options for GetUsage +type GetUsagePaginatorOptions struct { + // The maximum number of returned results per page. The default value is 25 and the + // maximum value is 500. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetUsagePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/apigateway.GetUsage +type GetUsagePaginator struct { + options GetUsagePaginatorOptions + client GetUsageAPIClient + params *GetUsageInput + nextToken *string + firstPage bool + done bool +} + +// NewGetUsagePaginator returns a new GetUsagePaginator +func NewGetUsagePaginator(client GetUsageAPIClient, params *GetUsageInput, optFns ...func(*GetUsagePaginatorOptions)) *GetUsagePaginator { + options := GetUsagePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetUsagePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetUsagePaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetUsage page. +func (p *GetUsagePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetUsageOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Position = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.GetUsage(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Position + if p.options.StopOnDuplicateToken && params.Position != nil && p.nextToken != nil && *params.Position == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetUsagePlansAPIClient is a client that implements the GetUsagePlans operation. +type GetUsagePlansAPIClient interface { + GetUsagePlans(context.Context, *GetUsagePlansInput, ...func(*Options)) (*GetUsagePlansOutput, error) +} + +var _ GetUsagePlansAPIClient = (*Client)(nil) + +// GetUsagePlansPaginatorOptions is the paginator options for GetUsagePlans +type GetUsagePlansPaginatorOptions struct { + // The maximum number of returned results per page. The default value is 25 and the + // maximum value is 500. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetUsagePlansPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/apigateway.GetUsagePlans +type GetUsagePlansPaginator struct { + options GetUsagePlansPaginatorOptions + client GetUsagePlansAPIClient + params *GetUsagePlansInput + nextToken *string + firstPage bool + done bool +} + +// NewGetUsagePlansPaginator returns a new GetUsagePlansPaginator +func NewGetUsagePlansPaginator(client GetUsagePlansAPIClient, params *GetUsagePlansInput, optFns ...func(*GetUsagePlansPaginatorOptions)) *GetUsagePlansPaginator { + options := GetUsagePlansPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetUsagePlansPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetUsagePlansPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetUsagePlans page. +func (p *GetUsagePlansPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetUsagePlansOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Position = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.GetUsagePlans(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Position + if p.options.StopOnDuplicateToken && params.Position != nil && p.nextToken != nil && *params.Position == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetUsagePlanKeysAPIClient is a client that implements the GetUsagePlanKeys +// operation. +type GetUsagePlanKeysAPIClient interface { + GetUsagePlanKeys(context.Context, *GetUsagePlanKeysInput, ...func(*Options)) (*GetUsagePlanKeysOutput, error) +} + +var _ GetUsagePlanKeysAPIClient = (*Client)(nil) + +// GetUsagePlanKeysPaginatorOptions is the paginator options for GetUsagePlanKeys +type GetUsagePlanKeysPaginatorOptions struct { + // The maximum number of returned results per page. The default value is 25 and the + // maximum value is 500. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetUsagePlanKeysPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/apigateway.GetUsagePlanKeys +type GetUsagePlanKeysPaginator struct { + options GetUsagePlanKeysPaginatorOptions + client GetUsagePlanKeysAPIClient + params *GetUsagePlanKeysInput + nextToken *string + firstPage bool + done bool +} + +// NewGetUsagePlanKeysPaginator returns a new GetUsagePlanKeysPaginator +func NewGetUsagePlanKeysPaginator(client GetUsagePlanKeysAPIClient, params *GetUsagePlanKeysInput, optFns ...func(*GetUsagePlanKeysPaginatorOptions)) *GetUsagePlanKeysPaginator { + options := GetUsagePlanKeysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetUsagePlanKeysPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetUsagePlanKeysPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetUsagePlanKeys page. +func (p *GetUsagePlanKeysPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetUsagePlanKeysOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Position = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.GetUsagePlanKeys(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Position + if p.options.StopOnDuplicateToken && params.Position != nil && p.nextToken != nil && *params.Position == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetDeploymentsAPIClient is a client that implements the GetDeployments +// operation. +type GetDeploymentsAPIClient interface { + GetDeployments(context.Context, *GetDeploymentsInput, ...func(*Options)) (*GetDeploymentsOutput, error) +} + +var _ GetDeploymentsAPIClient = (*Client)(nil) + +// GetDeploymentsPaginatorOptions is the paginator options for GetDeployments +type GetDeploymentsPaginatorOptions struct { + // The maximum number of returned results per page. The default value is 25 and the + // maximum value is 500. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetDeploymentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/apigateway.GetDeployments +type GetDeploymentsPaginator struct { + options GetDeploymentsPaginatorOptions + client GetDeploymentsAPIClient + params *GetDeploymentsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetDeploymentsPaginator returns a new GetDeploymentsPaginator +func NewGetDeploymentsPaginator(client GetDeploymentsAPIClient, params *GetDeploymentsInput, optFns ...func(*GetDeploymentsPaginatorOptions)) *GetDeploymentsPaginator { + options := GetDeploymentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetDeploymentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetDeploymentsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetDeployments page. +func (p *GetDeploymentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetDeploymentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Position = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.GetDeployments(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Position + if p.options.StopOnDuplicateToken && params.Position != nil && p.nextToken != nil && *params.Position == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetBasePathMappingsAPIClient is a client that implements the GetBasePathMappings +// operation. +type GetBasePathMappingsAPIClient interface { + GetBasePathMappings(context.Context, *GetBasePathMappingsInput, ...func(*Options)) (*GetBasePathMappingsOutput, error) +} + +var _ GetBasePathMappingsAPIClient = (*Client)(nil) + +// GetBasePathMappingsPaginatorOptions is the paginator options for +// GetBasePathMappings +type GetBasePathMappingsPaginatorOptions struct { + // The maximum number of returned results per page. The default value is 25 and the + // maximum value is 500. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetBasePathMappingsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/apigateway.GetBasePathMappings +type GetBasePathMappingsPaginator struct { + options GetBasePathMappingsPaginatorOptions + client GetBasePathMappingsAPIClient + params *GetBasePathMappingsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetBasePathMappingsPaginator returns a new GetBasePathMappingsPaginator +func NewGetBasePathMappingsPaginator(client GetBasePathMappingsAPIClient, params *GetBasePathMappingsInput, optFns ...func(*GetBasePathMappingsPaginatorOptions)) *GetBasePathMappingsPaginator { + options := GetBasePathMappingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetBasePathMappingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetBasePathMappingsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetBasePathMappings page. +func (p *GetBasePathMappingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetBasePathMappingsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Position = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.GetBasePathMappings(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Position + if p.options.StopOnDuplicateToken && params.Position != nil && p.nextToken != nil && *params.Position == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetModelsAPIClient is a client that implements the GetModels operation. +type GetModelsAPIClient interface { + GetModels(context.Context, *GetModelsInput, ...func(*Options)) (*GetModelsOutput, error) +} + +var _ GetModelsAPIClient = (*Client)(nil) + +// GetModelsPaginatorOptions is the paginator options for GetModels +type GetModelsPaginatorOptions struct { + // The maximum number of returned results per page. The default value is 25 and the + // maximum value is 500. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetModelsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/apigateway.GetModels +type GetModelsPaginator struct { + options GetModelsPaginatorOptions + client GetModelsAPIClient + params *GetModelsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetModelsPaginator returns a new GetModelsPaginator +func NewGetModelsPaginator(client GetModelsAPIClient, params *GetModelsInput, optFns ...func(*GetModelsPaginatorOptions)) *GetModelsPaginator { + options := GetModelsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetModelsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetModelsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetModels page. +func (p *GetModelsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetModelsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Position = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.GetModels(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Position + if p.options.StopOnDuplicateToken && params.Position != nil && p.nextToken != nil && *params.Position == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetVpcLinksAPIClient is a client that implements the GetVpcLinks operation. +type GetVpcLinksAPIClient interface { + GetVpcLinks(context.Context, *GetVpcLinksInput, ...func(*Options)) (*GetVpcLinksOutput, error) +} + +var _ GetVpcLinksAPIClient = (*Client)(nil) + +// GetVpcLinksPaginatorOptions is the paginator options for GetVpcLinks +type GetVpcLinksPaginatorOptions struct { + // The maximum number of returned results per page. The default value is 25 and the + // maximum value is 500. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetVpcLinksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/apigateway.GetVpcLinks +type GetVpcLinksPaginator struct { + options GetVpcLinksPaginatorOptions + client GetVpcLinksAPIClient + params *GetVpcLinksInput + nextToken *string + firstPage bool + done bool +} + +// NewGetVpcLinksPaginator returns a new GetVpcLinksPaginator +func NewGetVpcLinksPaginator(client GetVpcLinksAPIClient, params *GetVpcLinksInput, optFns ...func(*GetVpcLinksPaginatorOptions)) *GetVpcLinksPaginator { + options := GetVpcLinksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetVpcLinksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetVpcLinksPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetVpcLinks page. +func (p *GetVpcLinksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetVpcLinksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Position = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.GetVpcLinks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Position + if p.options.StopOnDuplicateToken && params.Position != nil && p.nextToken != nil && *params.Position == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetResourcesAPIClient is a client that implements the GetResources operation. +type GetResourcesAPIClient interface { + GetResources(context.Context, *GetResourcesInput, ...func(*Options)) (*GetResourcesOutput, error) +} + +var _ GetResourcesAPIClient = (*Client)(nil) + +// GetResourcesPaginatorOptions is the paginator options for GetResources +type GetResourcesPaginatorOptions struct { + // The maximum number of returned results per page. The default value is 25 and the + // maximum value is 500. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetResourcesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/apigateway.GetResources +type GetResourcesPaginator struct { + options GetResourcesPaginatorOptions + client GetResourcesAPIClient + params *GetResourcesInput + nextToken *string + firstPage bool + done bool +} + +// NewGetResourcesPaginator returns a new GetResourcesPaginator +func NewGetResourcesPaginator(client GetResourcesAPIClient, params *GetResourcesInput, optFns ...func(*GetResourcesPaginatorOptions)) *GetResourcesPaginator { + options := GetResourcesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetResourcesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetResourcesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetResources page. +func (p *GetResourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetResourcesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Position = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.GetResources(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Position + if p.options.StopOnDuplicateToken && params.Position != nil && p.nextToken != nil && *params.Position == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetApiKeysAPIClient is a client that implements the GetApiKeys operation. +type GetApiKeysAPIClient interface { + GetApiKeys(context.Context, *GetApiKeysInput, ...func(*Options)) (*GetApiKeysOutput, error) +} + +var _ GetApiKeysAPIClient = (*Client)(nil) + +// GetApiKeysPaginatorOptions is the paginator options for GetApiKeys +type GetApiKeysPaginatorOptions struct { + // The maximum number of returned results per page. The default value is 25 and the + // maximum value is 500. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetApiKeysPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/apigateway.GetApiKeys +type GetApiKeysPaginator struct { + options GetApiKeysPaginatorOptions + client GetApiKeysAPIClient + params *GetApiKeysInput + nextToken *string + firstPage bool + done bool +} + +// NewGetApiKeysPaginator returns a new GetApiKeysPaginator +func NewGetApiKeysPaginator(client GetApiKeysAPIClient, params *GetApiKeysInput, optFns ...func(*GetApiKeysPaginatorOptions)) *GetApiKeysPaginator { + options := GetApiKeysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetApiKeysPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetApiKeysPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetApiKeys page. +func (p *GetApiKeysPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetApiKeysOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Position = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.GetApiKeys(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Position + if p.options.StopOnDuplicateToken && params.Position != nil && p.nextToken != nil && *params.Position == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetDomainNamesAPIClient is a client that implements the GetDomainNames +// operation. +type GetDomainNamesAPIClient interface { + GetDomainNames(context.Context, *GetDomainNamesInput, ...func(*Options)) (*GetDomainNamesOutput, error) +} + +var _ GetDomainNamesAPIClient = (*Client)(nil) + +// GetDomainNamesPaginatorOptions is the paginator options for GetDomainNames +type GetDomainNamesPaginatorOptions struct { + // The maximum number of returned results per page. The default value is 25 and the + // maximum value is 500. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetDomainNamesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/apigateway.GetDomainNames +type GetDomainNamesPaginator struct { + options GetDomainNamesPaginatorOptions + client GetDomainNamesAPIClient + params *GetDomainNamesInput + nextToken *string + firstPage bool + done bool +} + +// NewGetDomainNamesPaginator returns a new GetDomainNamesPaginator +func NewGetDomainNamesPaginator(client GetDomainNamesAPIClient, params *GetDomainNamesInput, optFns ...func(*GetDomainNamesPaginatorOptions)) *GetDomainNamesPaginator { + options := GetDomainNamesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetDomainNamesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetDomainNamesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetDomainNames page. +func (p *GetDomainNamesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetDomainNamesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Position = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.GetDomainNames(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Position + if p.options.StopOnDuplicateToken && params.Position != nil && p.nextToken != nil && *params.Position == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetRestApisAPIClient is a client that implements the GetRestApis operation. +type GetRestApisAPIClient interface { + GetRestApis(context.Context, *GetRestApisInput, ...func(*Options)) (*GetRestApisOutput, error) +} + +var _ GetRestApisAPIClient = (*Client)(nil) + +// GetRestApisPaginatorOptions is the paginator options for GetRestApis +type GetRestApisPaginatorOptions struct { + // The maximum number of returned results per page. The default value is 25 and the + // maximum value is 500. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetRestApisPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/apigateway.GetRestApis +type GetRestApisPaginator struct { + options GetRestApisPaginatorOptions + client GetRestApisAPIClient + params *GetRestApisInput + nextToken *string + firstPage bool + done bool +} + +// NewGetRestApisPaginator returns a new GetRestApisPaginator +func NewGetRestApisPaginator(client GetRestApisAPIClient, params *GetRestApisInput, optFns ...func(*GetRestApisPaginatorOptions)) *GetRestApisPaginator { + options := GetRestApisPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetRestApisPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetRestApisPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetRestApis page. +func (p *GetRestApisPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetRestApisOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Position = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.GetRestApis(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Position + if p.options.StopOnDuplicateToken && params.Position != nil && p.nextToken != nil && *params.Position == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/apigatewaymanagementapi/go.sum b/service/apigatewaymanagementapi/go.sum index c669e324b14..32595049f96 100644 --- a/service/apigatewaymanagementapi/go.sum +++ b/service/apigatewaymanagementapi/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/apigatewayv2/go.sum b/service/apigatewayv2/go.sum index c669e324b14..32595049f96 100644 --- a/service/apigatewayv2/go.sum +++ b/service/apigatewayv2/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/appconfig/go.sum b/service/appconfig/go.sum index c669e324b14..32595049f96 100644 --- a/service/appconfig/go.sum +++ b/service/appconfig/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/appconfig/paginators.go b/service/appconfig/paginators.go new file mode 100644 index 00000000000..b2b033a33ab --- /dev/null +++ b/service/appconfig/paginators.go @@ -0,0 +1,470 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package appconfig + +import ( + "context" + "fmt" +) + +// ListHostedConfigurationVersionsAPIClient is a client that implements the +// ListHostedConfigurationVersions operation. +type ListHostedConfigurationVersionsAPIClient interface { + ListHostedConfigurationVersions(context.Context, *ListHostedConfigurationVersionsInput, ...func(*Options)) (*ListHostedConfigurationVersionsOutput, error) +} + +var _ ListHostedConfigurationVersionsAPIClient = (*Client)(nil) + +// ListHostedConfigurationVersionsPaginatorOptions is the paginator options for +// ListHostedConfigurationVersions +type ListHostedConfigurationVersionsPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListHostedConfigurationVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/appconfig.ListHostedConfigurationVersions +type ListHostedConfigurationVersionsPaginator struct { + options ListHostedConfigurationVersionsPaginatorOptions + client ListHostedConfigurationVersionsAPIClient + params *ListHostedConfigurationVersionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListHostedConfigurationVersionsPaginator returns a new +// ListHostedConfigurationVersionsPaginator +func NewListHostedConfigurationVersionsPaginator(client ListHostedConfigurationVersionsAPIClient, params *ListHostedConfigurationVersionsInput, optFns ...func(*ListHostedConfigurationVersionsPaginatorOptions)) *ListHostedConfigurationVersionsPaginator { + options := ListHostedConfigurationVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListHostedConfigurationVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListHostedConfigurationVersionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListHostedConfigurationVersions page. +func (p *ListHostedConfigurationVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListHostedConfigurationVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListHostedConfigurationVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListConfigurationProfilesAPIClient is a client that implements the +// ListConfigurationProfiles operation. +type ListConfigurationProfilesAPIClient interface { + ListConfigurationProfiles(context.Context, *ListConfigurationProfilesInput, ...func(*Options)) (*ListConfigurationProfilesOutput, error) +} + +var _ ListConfigurationProfilesAPIClient = (*Client)(nil) + +// ListConfigurationProfilesPaginatorOptions is the paginator options for +// ListConfigurationProfiles +type ListConfigurationProfilesPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListConfigurationProfilesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/appconfig.ListConfigurationProfiles +type ListConfigurationProfilesPaginator struct { + options ListConfigurationProfilesPaginatorOptions + client ListConfigurationProfilesAPIClient + params *ListConfigurationProfilesInput + nextToken *string + firstPage bool + done bool +} + +// NewListConfigurationProfilesPaginator returns a new +// ListConfigurationProfilesPaginator +func NewListConfigurationProfilesPaginator(client ListConfigurationProfilesAPIClient, params *ListConfigurationProfilesInput, optFns ...func(*ListConfigurationProfilesPaginatorOptions)) *ListConfigurationProfilesPaginator { + options := ListConfigurationProfilesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListConfigurationProfilesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListConfigurationProfilesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListConfigurationProfiles page. +func (p *ListConfigurationProfilesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListConfigurationProfilesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListConfigurationProfiles(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDeploymentStrategiesAPIClient is a client that implements the +// ListDeploymentStrategies operation. +type ListDeploymentStrategiesAPIClient interface { + ListDeploymentStrategies(context.Context, *ListDeploymentStrategiesInput, ...func(*Options)) (*ListDeploymentStrategiesOutput, error) +} + +var _ ListDeploymentStrategiesAPIClient = (*Client)(nil) + +// ListDeploymentStrategiesPaginatorOptions is the paginator options for +// ListDeploymentStrategies +type ListDeploymentStrategiesPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDeploymentStrategiesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/appconfig.ListDeploymentStrategies +type ListDeploymentStrategiesPaginator struct { + options ListDeploymentStrategiesPaginatorOptions + client ListDeploymentStrategiesAPIClient + params *ListDeploymentStrategiesInput + nextToken *string + firstPage bool + done bool +} + +// NewListDeploymentStrategiesPaginator returns a new +// ListDeploymentStrategiesPaginator +func NewListDeploymentStrategiesPaginator(client ListDeploymentStrategiesAPIClient, params *ListDeploymentStrategiesInput, optFns ...func(*ListDeploymentStrategiesPaginatorOptions)) *ListDeploymentStrategiesPaginator { + options := ListDeploymentStrategiesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDeploymentStrategiesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDeploymentStrategiesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDeploymentStrategies page. +func (p *ListDeploymentStrategiesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDeploymentStrategiesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListDeploymentStrategies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDeploymentsAPIClient is a client that implements the ListDeployments +// operation. +type ListDeploymentsAPIClient interface { + ListDeployments(context.Context, *ListDeploymentsInput, ...func(*Options)) (*ListDeploymentsOutput, error) +} + +var _ ListDeploymentsAPIClient = (*Client)(nil) + +// ListDeploymentsPaginatorOptions is the paginator options for ListDeployments +type ListDeploymentsPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDeploymentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/appconfig.ListDeployments +type ListDeploymentsPaginator struct { + options ListDeploymentsPaginatorOptions + client ListDeploymentsAPIClient + params *ListDeploymentsInput + nextToken *string + firstPage bool + done bool +} + +// NewListDeploymentsPaginator returns a new ListDeploymentsPaginator +func NewListDeploymentsPaginator(client ListDeploymentsAPIClient, params *ListDeploymentsInput, optFns ...func(*ListDeploymentsPaginatorOptions)) *ListDeploymentsPaginator { + options := ListDeploymentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDeploymentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDeploymentsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDeployments page. +func (p *ListDeploymentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDeploymentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListDeployments(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListApplicationsAPIClient is a client that implements the ListApplications +// operation. +type ListApplicationsAPIClient interface { + ListApplications(context.Context, *ListApplicationsInput, ...func(*Options)) (*ListApplicationsOutput, error) +} + +var _ ListApplicationsAPIClient = (*Client)(nil) + +// ListApplicationsPaginatorOptions is the paginator options for ListApplications +type ListApplicationsPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListApplicationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/appconfig.ListApplications +type ListApplicationsPaginator struct { + options ListApplicationsPaginatorOptions + client ListApplicationsAPIClient + params *ListApplicationsInput + nextToken *string + firstPage bool + done bool +} + +// NewListApplicationsPaginator returns a new ListApplicationsPaginator +func NewListApplicationsPaginator(client ListApplicationsAPIClient, params *ListApplicationsInput, optFns ...func(*ListApplicationsPaginatorOptions)) *ListApplicationsPaginator { + options := ListApplicationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListApplicationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListApplicationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListApplications page. +func (p *ListApplicationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListApplicationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListApplications(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListEnvironmentsAPIClient is a client that implements the ListEnvironments +// operation. +type ListEnvironmentsAPIClient interface { + ListEnvironments(context.Context, *ListEnvironmentsInput, ...func(*Options)) (*ListEnvironmentsOutput, error) +} + +var _ ListEnvironmentsAPIClient = (*Client)(nil) + +// ListEnvironmentsPaginatorOptions is the paginator options for ListEnvironments +type ListEnvironmentsPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListEnvironmentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/appconfig.ListEnvironments +type ListEnvironmentsPaginator struct { + options ListEnvironmentsPaginatorOptions + client ListEnvironmentsAPIClient + params *ListEnvironmentsInput + nextToken *string + firstPage bool + done bool +} + +// NewListEnvironmentsPaginator returns a new ListEnvironmentsPaginator +func NewListEnvironmentsPaginator(client ListEnvironmentsAPIClient, params *ListEnvironmentsInput, optFns ...func(*ListEnvironmentsPaginatorOptions)) *ListEnvironmentsPaginator { + options := ListEnvironmentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListEnvironmentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListEnvironmentsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListEnvironments page. +func (p *ListEnvironmentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEnvironmentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListEnvironments(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/appflow/go.sum b/service/appflow/go.sum index c669e324b14..32595049f96 100644 --- a/service/appflow/go.sum +++ b/service/appflow/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/appflow/paginators.go b/service/appflow/paginators.go new file mode 100644 index 00000000000..41c084b894a --- /dev/null +++ b/service/appflow/paginators.go @@ -0,0 +1,310 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package appflow + +import ( + "context" + "fmt" +) + +// DescribeConnectorsAPIClient is a client that implements the DescribeConnectors +// operation. +type DescribeConnectorsAPIClient interface { + DescribeConnectors(context.Context, *DescribeConnectorsInput, ...func(*Options)) (*DescribeConnectorsOutput, error) +} + +var _ DescribeConnectorsAPIClient = (*Client)(nil) + +// DescribeConnectorsPaginatorOptions is the paginator options for +// DescribeConnectors +type DescribeConnectorsPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeConnectorsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/appflow.DescribeConnectors +type DescribeConnectorsPaginator struct { + options DescribeConnectorsPaginatorOptions + client DescribeConnectorsAPIClient + params *DescribeConnectorsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeConnectorsPaginator returns a new DescribeConnectorsPaginator +func NewDescribeConnectorsPaginator(client DescribeConnectorsAPIClient, params *DescribeConnectorsInput, optFns ...func(*DescribeConnectorsPaginatorOptions)) *DescribeConnectorsPaginator { + options := DescribeConnectorsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeConnectorsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeConnectorsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeConnectors page. +func (p *DescribeConnectorsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeConnectorsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.DescribeConnectors(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListFlowsAPIClient is a client that implements the ListFlows operation. +type ListFlowsAPIClient interface { + ListFlows(context.Context, *ListFlowsInput, ...func(*Options)) (*ListFlowsOutput, error) +} + +var _ ListFlowsAPIClient = (*Client)(nil) + +// ListFlowsPaginatorOptions is the paginator options for ListFlows +type ListFlowsPaginatorOptions struct { + // Specifies the maximum number of items that should be returned in the result set. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListFlowsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/appflow.ListFlows +type ListFlowsPaginator struct { + options ListFlowsPaginatorOptions + client ListFlowsAPIClient + params *ListFlowsInput + nextToken *string + firstPage bool + done bool +} + +// NewListFlowsPaginator returns a new ListFlowsPaginator +func NewListFlowsPaginator(client ListFlowsAPIClient, params *ListFlowsInput, optFns ...func(*ListFlowsPaginatorOptions)) *ListFlowsPaginator { + options := ListFlowsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListFlowsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListFlowsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListFlows page. +func (p *ListFlowsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFlowsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListFlows(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeFlowExecutionRecordsAPIClient is a client that implements the +// DescribeFlowExecutionRecords operation. +type DescribeFlowExecutionRecordsAPIClient interface { + DescribeFlowExecutionRecords(context.Context, *DescribeFlowExecutionRecordsInput, ...func(*Options)) (*DescribeFlowExecutionRecordsOutput, error) +} + +var _ DescribeFlowExecutionRecordsAPIClient = (*Client)(nil) + +// DescribeFlowExecutionRecordsPaginatorOptions is the paginator options for +// DescribeFlowExecutionRecords +type DescribeFlowExecutionRecordsPaginatorOptions struct { + // Specifies the maximum number of items that should be returned in the result set. + // The default for maxResults is 20 (for all paginated API operations). + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeFlowExecutionRecordsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/appflow.DescribeFlowExecutionRecords +type DescribeFlowExecutionRecordsPaginator struct { + options DescribeFlowExecutionRecordsPaginatorOptions + client DescribeFlowExecutionRecordsAPIClient + params *DescribeFlowExecutionRecordsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeFlowExecutionRecordsPaginator returns a new +// DescribeFlowExecutionRecordsPaginator +func NewDescribeFlowExecutionRecordsPaginator(client DescribeFlowExecutionRecordsAPIClient, params *DescribeFlowExecutionRecordsInput, optFns ...func(*DescribeFlowExecutionRecordsPaginatorOptions)) *DescribeFlowExecutionRecordsPaginator { + options := DescribeFlowExecutionRecordsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeFlowExecutionRecordsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeFlowExecutionRecordsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeFlowExecutionRecords page. +func (p *DescribeFlowExecutionRecordsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeFlowExecutionRecordsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeFlowExecutionRecords(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeConnectorProfilesAPIClient is a client that implements the +// DescribeConnectorProfiles operation. +type DescribeConnectorProfilesAPIClient interface { + DescribeConnectorProfiles(context.Context, *DescribeConnectorProfilesInput, ...func(*Options)) (*DescribeConnectorProfilesOutput, error) +} + +var _ DescribeConnectorProfilesAPIClient = (*Client)(nil) + +// DescribeConnectorProfilesPaginatorOptions is the paginator options for +// DescribeConnectorProfiles +type DescribeConnectorProfilesPaginatorOptions struct { + // Specifies the maximum number of items that should be returned in the result set. + // The default for maxResults is 20 (for all paginated API operations). + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeConnectorProfilesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/appflow.DescribeConnectorProfiles +type DescribeConnectorProfilesPaginator struct { + options DescribeConnectorProfilesPaginatorOptions + client DescribeConnectorProfilesAPIClient + params *DescribeConnectorProfilesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeConnectorProfilesPaginator returns a new +// DescribeConnectorProfilesPaginator +func NewDescribeConnectorProfilesPaginator(client DescribeConnectorProfilesAPIClient, params *DescribeConnectorProfilesInput, optFns ...func(*DescribeConnectorProfilesPaginatorOptions)) *DescribeConnectorProfilesPaginator { + options := DescribeConnectorProfilesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeConnectorProfilesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeConnectorProfilesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeConnectorProfiles page. +func (p *DescribeConnectorProfilesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeConnectorProfilesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeConnectorProfiles(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/applicationautoscaling/go.sum b/service/applicationautoscaling/go.sum index c669e324b14..32595049f96 100644 --- a/service/applicationautoscaling/go.sum +++ b/service/applicationautoscaling/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/applicationautoscaling/paginators.go b/service/applicationautoscaling/paginators.go new file mode 100644 index 00000000000..9b6d23fc2ac --- /dev/null +++ b/service/applicationautoscaling/paginators.go @@ -0,0 +1,336 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package applicationautoscaling + +import ( + "context" + "fmt" +) + +// DescribeScheduledActionsAPIClient is a client that implements the +// DescribeScheduledActions operation. +type DescribeScheduledActionsAPIClient interface { + DescribeScheduledActions(context.Context, *DescribeScheduledActionsInput, ...func(*Options)) (*DescribeScheduledActionsOutput, error) +} + +var _ DescribeScheduledActionsAPIClient = (*Client)(nil) + +// DescribeScheduledActionsPaginatorOptions is the paginator options for +// DescribeScheduledActions +type DescribeScheduledActionsPaginatorOptions struct { + // The maximum number of scheduled action results. This value can be between 1 and + // 50. The default value is 50. If this parameter is used, the operation returns up + // to MaxResults results at a time, along with a NextToken value. To get the next + // set of results, include the NextToken value in a subsequent call. If this + // parameter is not used, the operation returns up to 50 results and a NextToken + // value, if applicable. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeScheduledActionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/applicationautoscaling.DescribeScheduledActions +type DescribeScheduledActionsPaginator struct { + options DescribeScheduledActionsPaginatorOptions + client DescribeScheduledActionsAPIClient + params *DescribeScheduledActionsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeScheduledActionsPaginator returns a new +// DescribeScheduledActionsPaginator +func NewDescribeScheduledActionsPaginator(client DescribeScheduledActionsAPIClient, params *DescribeScheduledActionsInput, optFns ...func(*DescribeScheduledActionsPaginatorOptions)) *DescribeScheduledActionsPaginator { + options := DescribeScheduledActionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeScheduledActionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeScheduledActionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeScheduledActions page. +func (p *DescribeScheduledActionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeScheduledActionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeScheduledActions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeScalableTargetsAPIClient is a client that implements the +// DescribeScalableTargets operation. +type DescribeScalableTargetsAPIClient interface { + DescribeScalableTargets(context.Context, *DescribeScalableTargetsInput, ...func(*Options)) (*DescribeScalableTargetsOutput, error) +} + +var _ DescribeScalableTargetsAPIClient = (*Client)(nil) + +// DescribeScalableTargetsPaginatorOptions is the paginator options for +// DescribeScalableTargets +type DescribeScalableTargetsPaginatorOptions struct { + // The maximum number of scalable targets. This value can be between 1 and 50. The + // default value is 50. If this parameter is used, the operation returns up to + // MaxResults results at a time, along with a NextToken value. To get the next set + // of results, include the NextToken value in a subsequent call. If this parameter + // is not used, the operation returns up to 50 results and a NextToken value, if + // applicable. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeScalableTargetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/applicationautoscaling.DescribeScalableTargets +type DescribeScalableTargetsPaginator struct { + options DescribeScalableTargetsPaginatorOptions + client DescribeScalableTargetsAPIClient + params *DescribeScalableTargetsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeScalableTargetsPaginator returns a new +// DescribeScalableTargetsPaginator +func NewDescribeScalableTargetsPaginator(client DescribeScalableTargetsAPIClient, params *DescribeScalableTargetsInput, optFns ...func(*DescribeScalableTargetsPaginatorOptions)) *DescribeScalableTargetsPaginator { + options := DescribeScalableTargetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeScalableTargetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeScalableTargetsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeScalableTargets page. +func (p *DescribeScalableTargetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeScalableTargetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeScalableTargets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeScalingActivitiesAPIClient is a client that implements the +// DescribeScalingActivities operation. +type DescribeScalingActivitiesAPIClient interface { + DescribeScalingActivities(context.Context, *DescribeScalingActivitiesInput, ...func(*Options)) (*DescribeScalingActivitiesOutput, error) +} + +var _ DescribeScalingActivitiesAPIClient = (*Client)(nil) + +// DescribeScalingActivitiesPaginatorOptions is the paginator options for +// DescribeScalingActivities +type DescribeScalingActivitiesPaginatorOptions struct { + // The maximum number of scalable targets. This value can be between 1 and 50. The + // default value is 50. If this parameter is used, the operation returns up to + // MaxResults results at a time, along with a NextToken value. To get the next set + // of results, include the NextToken value in a subsequent call. If this parameter + // is not used, the operation returns up to 50 results and a NextToken value, if + // applicable. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeScalingActivitiesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/applicationautoscaling.DescribeScalingActivities +type DescribeScalingActivitiesPaginator struct { + options DescribeScalingActivitiesPaginatorOptions + client DescribeScalingActivitiesAPIClient + params *DescribeScalingActivitiesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeScalingActivitiesPaginator returns a new +// DescribeScalingActivitiesPaginator +func NewDescribeScalingActivitiesPaginator(client DescribeScalingActivitiesAPIClient, params *DescribeScalingActivitiesInput, optFns ...func(*DescribeScalingActivitiesPaginatorOptions)) *DescribeScalingActivitiesPaginator { + options := DescribeScalingActivitiesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeScalingActivitiesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeScalingActivitiesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeScalingActivities page. +func (p *DescribeScalingActivitiesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeScalingActivitiesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeScalingActivities(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeScalingPoliciesAPIClient is a client that implements the +// DescribeScalingPolicies operation. +type DescribeScalingPoliciesAPIClient interface { + DescribeScalingPolicies(context.Context, *DescribeScalingPoliciesInput, ...func(*Options)) (*DescribeScalingPoliciesOutput, error) +} + +var _ DescribeScalingPoliciesAPIClient = (*Client)(nil) + +// DescribeScalingPoliciesPaginatorOptions is the paginator options for +// DescribeScalingPolicies +type DescribeScalingPoliciesPaginatorOptions struct { + // The maximum number of scalable targets. This value can be between 1 and 50. The + // default value is 50. If this parameter is used, the operation returns up to + // MaxResults results at a time, along with a NextToken value. To get the next set + // of results, include the NextToken value in a subsequent call. If this parameter + // is not used, the operation returns up to 50 results and a NextToken value, if + // applicable. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeScalingPoliciesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/applicationautoscaling.DescribeScalingPolicies +type DescribeScalingPoliciesPaginator struct { + options DescribeScalingPoliciesPaginatorOptions + client DescribeScalingPoliciesAPIClient + params *DescribeScalingPoliciesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeScalingPoliciesPaginator returns a new +// DescribeScalingPoliciesPaginator +func NewDescribeScalingPoliciesPaginator(client DescribeScalingPoliciesAPIClient, params *DescribeScalingPoliciesInput, optFns ...func(*DescribeScalingPoliciesPaginatorOptions)) *DescribeScalingPoliciesPaginator { + options := DescribeScalingPoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeScalingPoliciesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeScalingPoliciesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeScalingPolicies page. +func (p *DescribeScalingPoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeScalingPoliciesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeScalingPolicies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/applicationdiscoveryservice/go.sum b/service/applicationdiscoveryservice/go.sum index c669e324b14..32595049f96 100644 --- a/service/applicationdiscoveryservice/go.sum +++ b/service/applicationdiscoveryservice/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/applicationdiscoveryservice/paginators.go b/service/applicationdiscoveryservice/paginators.go new file mode 100644 index 00000000000..5d07526d020 --- /dev/null +++ b/service/applicationdiscoveryservice/paginators.go @@ -0,0 +1,162 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package applicationdiscoveryservice + +import ( + "context" + "fmt" +) + +// DescribeContinuousExportsAPIClient is a client that implements the +// DescribeContinuousExports operation. +type DescribeContinuousExportsAPIClient interface { + DescribeContinuousExports(context.Context, *DescribeContinuousExportsInput, ...func(*Options)) (*DescribeContinuousExportsOutput, error) +} + +var _ DescribeContinuousExportsAPIClient = (*Client)(nil) + +// DescribeContinuousExportsPaginatorOptions is the paginator options for +// DescribeContinuousExports +type DescribeContinuousExportsPaginatorOptions struct { + // A number between 1 and 100 specifying the maximum number of continuous export + // descriptions returned. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeContinuousExportsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/applicationdiscoveryservice.DescribeContinuousExports +type DescribeContinuousExportsPaginator struct { + options DescribeContinuousExportsPaginatorOptions + client DescribeContinuousExportsAPIClient + params *DescribeContinuousExportsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeContinuousExportsPaginator returns a new +// DescribeContinuousExportsPaginator +func NewDescribeContinuousExportsPaginator(client DescribeContinuousExportsAPIClient, params *DescribeContinuousExportsInput, optFns ...func(*DescribeContinuousExportsPaginatorOptions)) *DescribeContinuousExportsPaginator { + options := DescribeContinuousExportsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeContinuousExportsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeContinuousExportsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeContinuousExports page. +func (p *DescribeContinuousExportsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeContinuousExportsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeContinuousExports(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeImportTasksAPIClient is a client that implements the DescribeImportTasks +// operation. +type DescribeImportTasksAPIClient interface { + DescribeImportTasks(context.Context, *DescribeImportTasksInput, ...func(*Options)) (*DescribeImportTasksOutput, error) +} + +var _ DescribeImportTasksAPIClient = (*Client)(nil) + +// DescribeImportTasksPaginatorOptions is the paginator options for +// DescribeImportTasks +type DescribeImportTasksPaginatorOptions struct { + // The maximum number of results that you want this request to return, up to 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeImportTasksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/applicationdiscoveryservice.DescribeImportTasks +type DescribeImportTasksPaginator struct { + options DescribeImportTasksPaginatorOptions + client DescribeImportTasksAPIClient + params *DescribeImportTasksInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeImportTasksPaginator returns a new DescribeImportTasksPaginator +func NewDescribeImportTasksPaginator(client DescribeImportTasksAPIClient, params *DescribeImportTasksInput, optFns ...func(*DescribeImportTasksPaginatorOptions)) *DescribeImportTasksPaginator { + options := DescribeImportTasksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeImportTasksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeImportTasksPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeImportTasks page. +func (p *DescribeImportTasksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeImportTasksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeImportTasks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/applicationinsights/go.sum b/service/applicationinsights/go.sum index c669e324b14..32595049f96 100644 --- a/service/applicationinsights/go.sum +++ b/service/applicationinsights/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/applicationinsights/paginators.go b/service/applicationinsights/paginators.go new file mode 100644 index 00000000000..3b6ff51c256 --- /dev/null +++ b/service/applicationinsights/paginators.go @@ -0,0 +1,470 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package applicationinsights + +import ( + "context" + "fmt" +) + +// ListProblemsAPIClient is a client that implements the ListProblems operation. +type ListProblemsAPIClient interface { + ListProblems(context.Context, *ListProblemsInput, ...func(*Options)) (*ListProblemsOutput, error) +} + +var _ ListProblemsAPIClient = (*Client)(nil) + +// ListProblemsPaginatorOptions is the paginator options for ListProblems +type ListProblemsPaginatorOptions struct { + // The maximum number of results to return in a single call. To retrieve the + // remaining results, make another call with the returned NextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListProblemsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/applicationinsights.ListProblems +type ListProblemsPaginator struct { + options ListProblemsPaginatorOptions + client ListProblemsAPIClient + params *ListProblemsInput + nextToken *string + firstPage bool + done bool +} + +// NewListProblemsPaginator returns a new ListProblemsPaginator +func NewListProblemsPaginator(client ListProblemsAPIClient, params *ListProblemsInput, optFns ...func(*ListProblemsPaginatorOptions)) *ListProblemsPaginator { + options := ListProblemsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListProblemsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListProblemsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListProblems page. +func (p *ListProblemsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProblemsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListProblems(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListConfigurationHistoryAPIClient is a client that implements the +// ListConfigurationHistory operation. +type ListConfigurationHistoryAPIClient interface { + ListConfigurationHistory(context.Context, *ListConfigurationHistoryInput, ...func(*Options)) (*ListConfigurationHistoryOutput, error) +} + +var _ ListConfigurationHistoryAPIClient = (*Client)(nil) + +// ListConfigurationHistoryPaginatorOptions is the paginator options for +// ListConfigurationHistory +type ListConfigurationHistoryPaginatorOptions struct { + // The maximum number of results returned by ListConfigurationHistory in paginated + // output. When this parameter is used, ListConfigurationHistory returns only + // MaxResults in a single page along with a NextToken response element. The + // remaining results of the initial request can be seen by sending another + // ListConfigurationHistory request with the returned NextToken value. If this + // parameter is not used, then ListConfigurationHistory returns all results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListConfigurationHistoryPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/applicationinsights.ListConfigurationHistory +type ListConfigurationHistoryPaginator struct { + options ListConfigurationHistoryPaginatorOptions + client ListConfigurationHistoryAPIClient + params *ListConfigurationHistoryInput + nextToken *string + firstPage bool + done bool +} + +// NewListConfigurationHistoryPaginator returns a new +// ListConfigurationHistoryPaginator +func NewListConfigurationHistoryPaginator(client ListConfigurationHistoryAPIClient, params *ListConfigurationHistoryInput, optFns ...func(*ListConfigurationHistoryPaginatorOptions)) *ListConfigurationHistoryPaginator { + options := ListConfigurationHistoryPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListConfigurationHistoryPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListConfigurationHistoryPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListConfigurationHistory page. +func (p *ListConfigurationHistoryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListConfigurationHistoryOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListConfigurationHistory(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListLogPatternsAPIClient is a client that implements the ListLogPatterns +// operation. +type ListLogPatternsAPIClient interface { + ListLogPatterns(context.Context, *ListLogPatternsInput, ...func(*Options)) (*ListLogPatternsOutput, error) +} + +var _ ListLogPatternsAPIClient = (*Client)(nil) + +// ListLogPatternsPaginatorOptions is the paginator options for ListLogPatterns +type ListLogPatternsPaginatorOptions struct { + // The maximum number of results to return in a single call. To retrieve the + // remaining results, make another call with the returned NextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListLogPatternsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/applicationinsights.ListLogPatterns +type ListLogPatternsPaginator struct { + options ListLogPatternsPaginatorOptions + client ListLogPatternsAPIClient + params *ListLogPatternsInput + nextToken *string + firstPage bool + done bool +} + +// NewListLogPatternsPaginator returns a new ListLogPatternsPaginator +func NewListLogPatternsPaginator(client ListLogPatternsAPIClient, params *ListLogPatternsInput, optFns ...func(*ListLogPatternsPaginatorOptions)) *ListLogPatternsPaginator { + options := ListLogPatternsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListLogPatternsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListLogPatternsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListLogPatterns page. +func (p *ListLogPatternsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListLogPatternsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListLogPatterns(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListLogPatternSetsAPIClient is a client that implements the ListLogPatternSets +// operation. +type ListLogPatternSetsAPIClient interface { + ListLogPatternSets(context.Context, *ListLogPatternSetsInput, ...func(*Options)) (*ListLogPatternSetsOutput, error) +} + +var _ ListLogPatternSetsAPIClient = (*Client)(nil) + +// ListLogPatternSetsPaginatorOptions is the paginator options for +// ListLogPatternSets +type ListLogPatternSetsPaginatorOptions struct { + // The maximum number of results to return in a single call. To retrieve the + // remaining results, make another call with the returned NextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListLogPatternSetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/applicationinsights.ListLogPatternSets +type ListLogPatternSetsPaginator struct { + options ListLogPatternSetsPaginatorOptions + client ListLogPatternSetsAPIClient + params *ListLogPatternSetsInput + nextToken *string + firstPage bool + done bool +} + +// NewListLogPatternSetsPaginator returns a new ListLogPatternSetsPaginator +func NewListLogPatternSetsPaginator(client ListLogPatternSetsAPIClient, params *ListLogPatternSetsInput, optFns ...func(*ListLogPatternSetsPaginatorOptions)) *ListLogPatternSetsPaginator { + options := ListLogPatternSetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListLogPatternSetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListLogPatternSetsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListLogPatternSets page. +func (p *ListLogPatternSetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListLogPatternSetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListLogPatternSets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListComponentsAPIClient is a client that implements the ListComponents +// operation. +type ListComponentsAPIClient interface { + ListComponents(context.Context, *ListComponentsInput, ...func(*Options)) (*ListComponentsOutput, error) +} + +var _ ListComponentsAPIClient = (*Client)(nil) + +// ListComponentsPaginatorOptions is the paginator options for ListComponents +type ListComponentsPaginatorOptions struct { + // The maximum number of results to return in a single call. To retrieve the + // remaining results, make another call with the returned NextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListComponentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/applicationinsights.ListComponents +type ListComponentsPaginator struct { + options ListComponentsPaginatorOptions + client ListComponentsAPIClient + params *ListComponentsInput + nextToken *string + firstPage bool + done bool +} + +// NewListComponentsPaginator returns a new ListComponentsPaginator +func NewListComponentsPaginator(client ListComponentsAPIClient, params *ListComponentsInput, optFns ...func(*ListComponentsPaginatorOptions)) *ListComponentsPaginator { + options := ListComponentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListComponentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListComponentsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListComponents page. +func (p *ListComponentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListComponentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListComponents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListApplicationsAPIClient is a client that implements the ListApplications +// operation. +type ListApplicationsAPIClient interface { + ListApplications(context.Context, *ListApplicationsInput, ...func(*Options)) (*ListApplicationsOutput, error) +} + +var _ ListApplicationsAPIClient = (*Client)(nil) + +// ListApplicationsPaginatorOptions is the paginator options for ListApplications +type ListApplicationsPaginatorOptions struct { + // The maximum number of results to return in a single call. To retrieve the + // remaining results, make another call with the returned NextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListApplicationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/applicationinsights.ListApplications +type ListApplicationsPaginator struct { + options ListApplicationsPaginatorOptions + client ListApplicationsAPIClient + params *ListApplicationsInput + nextToken *string + firstPage bool + done bool +} + +// NewListApplicationsPaginator returns a new ListApplicationsPaginator +func NewListApplicationsPaginator(client ListApplicationsAPIClient, params *ListApplicationsInput, optFns ...func(*ListApplicationsPaginatorOptions)) *ListApplicationsPaginator { + options := ListApplicationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListApplicationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListApplicationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListApplications page. +func (p *ListApplicationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListApplicationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListApplications(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/appmesh/go.sum b/service/appmesh/go.sum index c669e324b14..32595049f96 100644 --- a/service/appmesh/go.sum +++ b/service/appmesh/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/appmesh/paginators.go b/service/appmesh/paginators.go new file mode 100644 index 00000000000..d377a720467 --- /dev/null +++ b/service/appmesh/paginators.go @@ -0,0 +1,658 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package appmesh + +import ( + "context" + "fmt" +) + +// ListVirtualServicesAPIClient is a client that implements the ListVirtualServices +// operation. +type ListVirtualServicesAPIClient interface { + ListVirtualServices(context.Context, *ListVirtualServicesInput, ...func(*Options)) (*ListVirtualServicesOutput, error) +} + +var _ ListVirtualServicesAPIClient = (*Client)(nil) + +// ListVirtualServicesPaginatorOptions is the paginator options for +// ListVirtualServices +type ListVirtualServicesPaginatorOptions struct { + // The maximum number of results returned by ListVirtualServices in paginated + // output. When you use this parameter, ListVirtualServices returns only limit + // results in a single page along with a nextToken response element. You can see + // the remaining results of the initial request by sending another + // ListVirtualServices request with the returned nextToken value. This value can be + // between 1 and 100. If you don't use this parameter, ListVirtualServices returns + // up to 100 results and a nextToken value if applicable. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListVirtualServicesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/appmesh.ListVirtualServices +type ListVirtualServicesPaginator struct { + options ListVirtualServicesPaginatorOptions + client ListVirtualServicesAPIClient + params *ListVirtualServicesInput + nextToken *string + firstPage bool + done bool +} + +// NewListVirtualServicesPaginator returns a new ListVirtualServicesPaginator +func NewListVirtualServicesPaginator(client ListVirtualServicesAPIClient, params *ListVirtualServicesInput, optFns ...func(*ListVirtualServicesPaginatorOptions)) *ListVirtualServicesPaginator { + options := ListVirtualServicesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListVirtualServicesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListVirtualServicesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListVirtualServices page. +func (p *ListVirtualServicesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListVirtualServicesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.ListVirtualServices(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTagsForResourceAPIClient is a client that implements the ListTagsForResource +// operation. +type ListTagsForResourceAPIClient interface { + ListTagsForResource(context.Context, *ListTagsForResourceInput, ...func(*Options)) (*ListTagsForResourceOutput, error) +} + +var _ ListTagsForResourceAPIClient = (*Client)(nil) + +// ListTagsForResourcePaginatorOptions is the paginator options for +// ListTagsForResource +type ListTagsForResourcePaginatorOptions struct { + // The maximum number of tag results returned by ListTagsForResource in paginated + // output. When this parameter is used, ListTagsForResource returns only limit + // results in a single page along with a nextToken response element. You can see + // the remaining results of the initial request by sending another + // ListTagsForResource request with the returned nextToken value. This value can be + // between 1 and 100. If you don't use this parameter, ListTagsForResource returns + // up to 100 results and a nextToken value if applicable. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTagsForResourcePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/appmesh.ListTagsForResource +type ListTagsForResourcePaginator struct { + options ListTagsForResourcePaginatorOptions + client ListTagsForResourceAPIClient + params *ListTagsForResourceInput + nextToken *string + firstPage bool + done bool +} + +// NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator +func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator { + options := ListTagsForResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTagsForResourcePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTagsForResourcePaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTagsForResource page. +func (p *ListTagsForResourcePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.ListTagsForResource(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListRoutesAPIClient is a client that implements the ListRoutes operation. +type ListRoutesAPIClient interface { + ListRoutes(context.Context, *ListRoutesInput, ...func(*Options)) (*ListRoutesOutput, error) +} + +var _ ListRoutesAPIClient = (*Client)(nil) + +// ListRoutesPaginatorOptions is the paginator options for ListRoutes +type ListRoutesPaginatorOptions struct { + // The maximum number of results returned by ListRoutes in paginated output. When + // you use this parameter, ListRoutes returns only limit results in a single page + // along with a nextToken response element. You can see the remaining results of + // the initial request by sending another ListRoutes request with the returned + // nextToken value. This value can be between 1 and 100. If you don't use this + // parameter, ListRoutes returns up to 100 results and a nextToken value if + // applicable. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListRoutesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/appmesh.ListRoutes +type ListRoutesPaginator struct { + options ListRoutesPaginatorOptions + client ListRoutesAPIClient + params *ListRoutesInput + nextToken *string + firstPage bool + done bool +} + +// NewListRoutesPaginator returns a new ListRoutesPaginator +func NewListRoutesPaginator(client ListRoutesAPIClient, params *ListRoutesInput, optFns ...func(*ListRoutesPaginatorOptions)) *ListRoutesPaginator { + options := ListRoutesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListRoutesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRoutesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListRoutes page. +func (p *ListRoutesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRoutesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.ListRoutes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListVirtualRoutersAPIClient is a client that implements the ListVirtualRouters +// operation. +type ListVirtualRoutersAPIClient interface { + ListVirtualRouters(context.Context, *ListVirtualRoutersInput, ...func(*Options)) (*ListVirtualRoutersOutput, error) +} + +var _ ListVirtualRoutersAPIClient = (*Client)(nil) + +// ListVirtualRoutersPaginatorOptions is the paginator options for +// ListVirtualRouters +type ListVirtualRoutersPaginatorOptions struct { + // The maximum number of results returned by ListVirtualRouters in paginated + // output. When you use this parameter, ListVirtualRouters returns only limit + // results in a single page along with a nextToken response element. You can see + // the remaining results of the initial request by sending another + // ListVirtualRouters request with the returned nextToken value. This value can be + // between 1 and 100. If you don't use this parameter, ListVirtualRouters returns + // up to 100 results and a nextToken value if applicable. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListVirtualRoutersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/appmesh.ListVirtualRouters +type ListVirtualRoutersPaginator struct { + options ListVirtualRoutersPaginatorOptions + client ListVirtualRoutersAPIClient + params *ListVirtualRoutersInput + nextToken *string + firstPage bool + done bool +} + +// NewListVirtualRoutersPaginator returns a new ListVirtualRoutersPaginator +func NewListVirtualRoutersPaginator(client ListVirtualRoutersAPIClient, params *ListVirtualRoutersInput, optFns ...func(*ListVirtualRoutersPaginatorOptions)) *ListVirtualRoutersPaginator { + options := ListVirtualRoutersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListVirtualRoutersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListVirtualRoutersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListVirtualRouters page. +func (p *ListVirtualRoutersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListVirtualRoutersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.ListVirtualRouters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListVirtualNodesAPIClient is a client that implements the ListVirtualNodes +// operation. +type ListVirtualNodesAPIClient interface { + ListVirtualNodes(context.Context, *ListVirtualNodesInput, ...func(*Options)) (*ListVirtualNodesOutput, error) +} + +var _ ListVirtualNodesAPIClient = (*Client)(nil) + +// ListVirtualNodesPaginatorOptions is the paginator options for ListVirtualNodes +type ListVirtualNodesPaginatorOptions struct { + // The maximum number of results returned by ListVirtualNodes in paginated output. + // When you use this parameter, ListVirtualNodes returns only limit results in a + // single page along with a nextToken response element. You can see the remaining + // results of the initial request by sending another ListVirtualNodes request with + // the returned nextToken value. This value can be between 1 and 100. If you don't + // use this parameter, ListVirtualNodes returns up to 100 results and a nextToken + // value if applicable. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListVirtualNodesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/appmesh.ListVirtualNodes +type ListVirtualNodesPaginator struct { + options ListVirtualNodesPaginatorOptions + client ListVirtualNodesAPIClient + params *ListVirtualNodesInput + nextToken *string + firstPage bool + done bool +} + +// NewListVirtualNodesPaginator returns a new ListVirtualNodesPaginator +func NewListVirtualNodesPaginator(client ListVirtualNodesAPIClient, params *ListVirtualNodesInput, optFns ...func(*ListVirtualNodesPaginatorOptions)) *ListVirtualNodesPaginator { + options := ListVirtualNodesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListVirtualNodesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListVirtualNodesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListVirtualNodes page. +func (p *ListVirtualNodesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListVirtualNodesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.ListVirtualNodes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListGatewayRoutesAPIClient is a client that implements the ListGatewayRoutes +// operation. +type ListGatewayRoutesAPIClient interface { + ListGatewayRoutes(context.Context, *ListGatewayRoutesInput, ...func(*Options)) (*ListGatewayRoutesOutput, error) +} + +var _ ListGatewayRoutesAPIClient = (*Client)(nil) + +// ListGatewayRoutesPaginatorOptions is the paginator options for ListGatewayRoutes +type ListGatewayRoutesPaginatorOptions struct { + // The maximum number of results returned by ListGatewayRoutes in paginated output. + // When you use this parameter, ListGatewayRoutes returns only limit results in a + // single page along with a nextToken response element. You can see the remaining + // results of the initial request by sending another ListGatewayRoutes request with + // the returned nextToken value. This value can be between 1 and 100. If you don't + // use this parameter, ListGatewayRoutes returns up to 100 results and a nextToken + // value if applicable. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListGatewayRoutesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/appmesh.ListGatewayRoutes +type ListGatewayRoutesPaginator struct { + options ListGatewayRoutesPaginatorOptions + client ListGatewayRoutesAPIClient + params *ListGatewayRoutesInput + nextToken *string + firstPage bool + done bool +} + +// NewListGatewayRoutesPaginator returns a new ListGatewayRoutesPaginator +func NewListGatewayRoutesPaginator(client ListGatewayRoutesAPIClient, params *ListGatewayRoutesInput, optFns ...func(*ListGatewayRoutesPaginatorOptions)) *ListGatewayRoutesPaginator { + options := ListGatewayRoutesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListGatewayRoutesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListGatewayRoutesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListGatewayRoutes page. +func (p *ListGatewayRoutesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListGatewayRoutesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.ListGatewayRoutes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListMeshesAPIClient is a client that implements the ListMeshes operation. +type ListMeshesAPIClient interface { + ListMeshes(context.Context, *ListMeshesInput, ...func(*Options)) (*ListMeshesOutput, error) +} + +var _ ListMeshesAPIClient = (*Client)(nil) + +// ListMeshesPaginatorOptions is the paginator options for ListMeshes +type ListMeshesPaginatorOptions struct { + // The maximum number of results returned by ListMeshes in paginated output. When + // you use this parameter, ListMeshes returns only limit results in a single page + // along with a nextToken response element. You can see the remaining results of + // the initial request by sending another ListMeshes request with the returned + // nextToken value. This value can be between 1 and 100. If you don't use this + // parameter, ListMeshes returns up to 100 results and a nextToken value if + // applicable. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListMeshesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/appmesh.ListMeshes +type ListMeshesPaginator struct { + options ListMeshesPaginatorOptions + client ListMeshesAPIClient + params *ListMeshesInput + nextToken *string + firstPage bool + done bool +} + +// NewListMeshesPaginator returns a new ListMeshesPaginator +func NewListMeshesPaginator(client ListMeshesAPIClient, params *ListMeshesInput, optFns ...func(*ListMeshesPaginatorOptions)) *ListMeshesPaginator { + options := ListMeshesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListMeshesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMeshesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListMeshes page. +func (p *ListMeshesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMeshesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.ListMeshes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListVirtualGatewaysAPIClient is a client that implements the ListVirtualGateways +// operation. +type ListVirtualGatewaysAPIClient interface { + ListVirtualGateways(context.Context, *ListVirtualGatewaysInput, ...func(*Options)) (*ListVirtualGatewaysOutput, error) +} + +var _ ListVirtualGatewaysAPIClient = (*Client)(nil) + +// ListVirtualGatewaysPaginatorOptions is the paginator options for +// ListVirtualGateways +type ListVirtualGatewaysPaginatorOptions struct { + // The maximum number of results returned by ListVirtualGateways in paginated + // output. When you use this parameter, ListVirtualGateways returns only limit + // results in a single page along with a nextToken response element. You can see + // the remaining results of the initial request by sending another + // ListVirtualGateways request with the returned nextToken value. This value can be + // between 1 and 100. If you don't use this parameter, ListVirtualGateways returns + // up to 100 results and a nextToken value if applicable. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListVirtualGatewaysPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/appmesh.ListVirtualGateways +type ListVirtualGatewaysPaginator struct { + options ListVirtualGatewaysPaginatorOptions + client ListVirtualGatewaysAPIClient + params *ListVirtualGatewaysInput + nextToken *string + firstPage bool + done bool +} + +// NewListVirtualGatewaysPaginator returns a new ListVirtualGatewaysPaginator +func NewListVirtualGatewaysPaginator(client ListVirtualGatewaysAPIClient, params *ListVirtualGatewaysInput, optFns ...func(*ListVirtualGatewaysPaginatorOptions)) *ListVirtualGatewaysPaginator { + options := ListVirtualGatewaysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListVirtualGatewaysPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListVirtualGatewaysPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListVirtualGateways page. +func (p *ListVirtualGatewaysPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListVirtualGatewaysOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.ListVirtualGateways(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/appstream/go.sum b/service/appstream/go.sum index c669e324b14..32595049f96 100644 --- a/service/appstream/go.sum +++ b/service/appstream/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/appstream/paginators.go b/service/appstream/paginators.go new file mode 100644 index 00000000000..d18233153c2 --- /dev/null +++ b/service/appstream/paginators.go @@ -0,0 +1,160 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package appstream + +import ( + "context" + "fmt" +) + +// DescribeImagePermissionsAPIClient is a client that implements the +// DescribeImagePermissions operation. +type DescribeImagePermissionsAPIClient interface { + DescribeImagePermissions(context.Context, *DescribeImagePermissionsInput, ...func(*Options)) (*DescribeImagePermissionsOutput, error) +} + +var _ DescribeImagePermissionsAPIClient = (*Client)(nil) + +// DescribeImagePermissionsPaginatorOptions is the paginator options for +// DescribeImagePermissions +type DescribeImagePermissionsPaginatorOptions struct { + // The maximum size of each page of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeImagePermissionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/appstream.DescribeImagePermissions +type DescribeImagePermissionsPaginator struct { + options DescribeImagePermissionsPaginatorOptions + client DescribeImagePermissionsAPIClient + params *DescribeImagePermissionsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeImagePermissionsPaginator returns a new +// DescribeImagePermissionsPaginator +func NewDescribeImagePermissionsPaginator(client DescribeImagePermissionsAPIClient, params *DescribeImagePermissionsInput, optFns ...func(*DescribeImagePermissionsPaginatorOptions)) *DescribeImagePermissionsPaginator { + options := DescribeImagePermissionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeImagePermissionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeImagePermissionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeImagePermissions page. +func (p *DescribeImagePermissionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeImagePermissionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeImagePermissions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeImagesAPIClient is a client that implements the DescribeImages +// operation. +type DescribeImagesAPIClient interface { + DescribeImages(context.Context, *DescribeImagesInput, ...func(*Options)) (*DescribeImagesOutput, error) +} + +var _ DescribeImagesAPIClient = (*Client)(nil) + +// DescribeImagesPaginatorOptions is the paginator options for DescribeImages +type DescribeImagesPaginatorOptions struct { + // The maximum size of each page of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeImagesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/appstream.DescribeImages +type DescribeImagesPaginator struct { + options DescribeImagesPaginatorOptions + client DescribeImagesAPIClient + params *DescribeImagesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeImagesPaginator returns a new DescribeImagesPaginator +func NewDescribeImagesPaginator(client DescribeImagesAPIClient, params *DescribeImagesInput, optFns ...func(*DescribeImagesPaginatorOptions)) *DescribeImagesPaginator { + options := DescribeImagesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeImagesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeImagesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeImages page. +func (p *DescribeImagesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeImagesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeImages(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/appsync/go.sum b/service/appsync/go.sum index c669e324b14..32595049f96 100644 --- a/service/appsync/go.sum +++ b/service/appsync/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/athena/go.sum b/service/athena/go.sum index c669e324b14..32595049f96 100644 --- a/service/athena/go.sum +++ b/service/athena/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/athena/paginators.go b/service/athena/paginators.go new file mode 100644 index 00000000000..5627e3c6ced --- /dev/null +++ b/service/athena/paginators.go @@ -0,0 +1,610 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package athena + +import ( + "context" + "fmt" +) + +// ListDataCatalogsAPIClient is a client that implements the ListDataCatalogs +// operation. +type ListDataCatalogsAPIClient interface { + ListDataCatalogs(context.Context, *ListDataCatalogsInput, ...func(*Options)) (*ListDataCatalogsOutput, error) +} + +var _ ListDataCatalogsAPIClient = (*Client)(nil) + +// ListDataCatalogsPaginatorOptions is the paginator options for ListDataCatalogs +type ListDataCatalogsPaginatorOptions struct { + // Specifies the maximum number of data catalogs to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDataCatalogsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/athena.ListDataCatalogs +type ListDataCatalogsPaginator struct { + options ListDataCatalogsPaginatorOptions + client ListDataCatalogsAPIClient + params *ListDataCatalogsInput + nextToken *string + firstPage bool + done bool +} + +// NewListDataCatalogsPaginator returns a new ListDataCatalogsPaginator +func NewListDataCatalogsPaginator(client ListDataCatalogsAPIClient, params *ListDataCatalogsInput, optFns ...func(*ListDataCatalogsPaginatorOptions)) *ListDataCatalogsPaginator { + options := ListDataCatalogsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDataCatalogsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDataCatalogsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDataCatalogs page. +func (p *ListDataCatalogsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDataCatalogsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListDataCatalogs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListWorkGroupsAPIClient is a client that implements the ListWorkGroups +// operation. +type ListWorkGroupsAPIClient interface { + ListWorkGroups(context.Context, *ListWorkGroupsInput, ...func(*Options)) (*ListWorkGroupsOutput, error) +} + +var _ ListWorkGroupsAPIClient = (*Client)(nil) + +// ListWorkGroupsPaginatorOptions is the paginator options for ListWorkGroups +type ListWorkGroupsPaginatorOptions struct { + // The maximum number of workgroups to return in this request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListWorkGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/athena.ListWorkGroups +type ListWorkGroupsPaginator struct { + options ListWorkGroupsPaginatorOptions + client ListWorkGroupsAPIClient + params *ListWorkGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewListWorkGroupsPaginator returns a new ListWorkGroupsPaginator +func NewListWorkGroupsPaginator(client ListWorkGroupsAPIClient, params *ListWorkGroupsInput, optFns ...func(*ListWorkGroupsPaginatorOptions)) *ListWorkGroupsPaginator { + options := ListWorkGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListWorkGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListWorkGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListWorkGroups page. +func (p *ListWorkGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListWorkGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListWorkGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListQueryExecutionsAPIClient is a client that implements the ListQueryExecutions +// operation. +type ListQueryExecutionsAPIClient interface { + ListQueryExecutions(context.Context, *ListQueryExecutionsInput, ...func(*Options)) (*ListQueryExecutionsOutput, error) +} + +var _ ListQueryExecutionsAPIClient = (*Client)(nil) + +// ListQueryExecutionsPaginatorOptions is the paginator options for +// ListQueryExecutions +type ListQueryExecutionsPaginatorOptions struct { + // The maximum number of query executions to return in this request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListQueryExecutionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/athena.ListQueryExecutions +type ListQueryExecutionsPaginator struct { + options ListQueryExecutionsPaginatorOptions + client ListQueryExecutionsAPIClient + params *ListQueryExecutionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListQueryExecutionsPaginator returns a new ListQueryExecutionsPaginator +func NewListQueryExecutionsPaginator(client ListQueryExecutionsAPIClient, params *ListQueryExecutionsInput, optFns ...func(*ListQueryExecutionsPaginatorOptions)) *ListQueryExecutionsPaginator { + options := ListQueryExecutionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListQueryExecutionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListQueryExecutionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListQueryExecutions page. +func (p *ListQueryExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListQueryExecutionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListQueryExecutions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetQueryResultsAPIClient is a client that implements the GetQueryResults +// operation. +type GetQueryResultsAPIClient interface { + GetQueryResults(context.Context, *GetQueryResultsInput, ...func(*Options)) (*GetQueryResultsOutput, error) +} + +var _ GetQueryResultsAPIClient = (*Client)(nil) + +// GetQueryResultsPaginatorOptions is the paginator options for GetQueryResults +type GetQueryResultsPaginatorOptions struct { + // The maximum number of results (rows) to return in this request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetQueryResultsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/athena.GetQueryResults +type GetQueryResultsPaginator struct { + options GetQueryResultsPaginatorOptions + client GetQueryResultsAPIClient + params *GetQueryResultsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetQueryResultsPaginator returns a new GetQueryResultsPaginator +func NewGetQueryResultsPaginator(client GetQueryResultsAPIClient, params *GetQueryResultsInput, optFns ...func(*GetQueryResultsPaginatorOptions)) *GetQueryResultsPaginator { + options := GetQueryResultsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetQueryResultsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetQueryResultsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetQueryResults page. +func (p *GetQueryResultsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetQueryResultsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetQueryResults(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTagsForResourceAPIClient is a client that implements the ListTagsForResource +// operation. +type ListTagsForResourceAPIClient interface { + ListTagsForResource(context.Context, *ListTagsForResourceInput, ...func(*Options)) (*ListTagsForResourceOutput, error) +} + +var _ ListTagsForResourceAPIClient = (*Client)(nil) + +// ListTagsForResourcePaginatorOptions is the paginator options for +// ListTagsForResource +type ListTagsForResourcePaginatorOptions struct { + // The maximum number of results to be returned per request that lists the tags for + // the resource. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTagsForResourcePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/athena.ListTagsForResource +type ListTagsForResourcePaginator struct { + options ListTagsForResourcePaginatorOptions + client ListTagsForResourceAPIClient + params *ListTagsForResourceInput + nextToken *string + firstPage bool + done bool +} + +// NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator +func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator { + options := ListTagsForResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTagsForResourcePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTagsForResourcePaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTagsForResource page. +func (p *ListTagsForResourcePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListTagsForResource(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListNamedQueriesAPIClient is a client that implements the ListNamedQueries +// operation. +type ListNamedQueriesAPIClient interface { + ListNamedQueries(context.Context, *ListNamedQueriesInput, ...func(*Options)) (*ListNamedQueriesOutput, error) +} + +var _ ListNamedQueriesAPIClient = (*Client)(nil) + +// ListNamedQueriesPaginatorOptions is the paginator options for ListNamedQueries +type ListNamedQueriesPaginatorOptions struct { + // The maximum number of queries to return in this request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListNamedQueriesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/athena.ListNamedQueries +type ListNamedQueriesPaginator struct { + options ListNamedQueriesPaginatorOptions + client ListNamedQueriesAPIClient + params *ListNamedQueriesInput + nextToken *string + firstPage bool + done bool +} + +// NewListNamedQueriesPaginator returns a new ListNamedQueriesPaginator +func NewListNamedQueriesPaginator(client ListNamedQueriesAPIClient, params *ListNamedQueriesInput, optFns ...func(*ListNamedQueriesPaginatorOptions)) *ListNamedQueriesPaginator { + options := ListNamedQueriesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListNamedQueriesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListNamedQueriesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListNamedQueries page. +func (p *ListNamedQueriesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListNamedQueriesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListNamedQueries(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTableMetadataAPIClient is a client that implements the ListTableMetadata +// operation. +type ListTableMetadataAPIClient interface { + ListTableMetadata(context.Context, *ListTableMetadataInput, ...func(*Options)) (*ListTableMetadataOutput, error) +} + +var _ ListTableMetadataAPIClient = (*Client)(nil) + +// ListTableMetadataPaginatorOptions is the paginator options for ListTableMetadata +type ListTableMetadataPaginatorOptions struct { + // Specifies the maximum number of results to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTableMetadataPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/athena.ListTableMetadata +type ListTableMetadataPaginator struct { + options ListTableMetadataPaginatorOptions + client ListTableMetadataAPIClient + params *ListTableMetadataInput + nextToken *string + firstPage bool + done bool +} + +// NewListTableMetadataPaginator returns a new ListTableMetadataPaginator +func NewListTableMetadataPaginator(client ListTableMetadataAPIClient, params *ListTableMetadataInput, optFns ...func(*ListTableMetadataPaginatorOptions)) *ListTableMetadataPaginator { + options := ListTableMetadataPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTableMetadataPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTableMetadataPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTableMetadata page. +func (p *ListTableMetadataPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTableMetadataOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListTableMetadata(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDatabasesAPIClient is a client that implements the ListDatabases operation. +type ListDatabasesAPIClient interface { + ListDatabases(context.Context, *ListDatabasesInput, ...func(*Options)) (*ListDatabasesOutput, error) +} + +var _ ListDatabasesAPIClient = (*Client)(nil) + +// ListDatabasesPaginatorOptions is the paginator options for ListDatabases +type ListDatabasesPaginatorOptions struct { + // Specifies the maximum number of results to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDatabasesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/athena.ListDatabases +type ListDatabasesPaginator struct { + options ListDatabasesPaginatorOptions + client ListDatabasesAPIClient + params *ListDatabasesInput + nextToken *string + firstPage bool + done bool +} + +// NewListDatabasesPaginator returns a new ListDatabasesPaginator +func NewListDatabasesPaginator(client ListDatabasesAPIClient, params *ListDatabasesInput, optFns ...func(*ListDatabasesPaginatorOptions)) *ListDatabasesPaginator { + options := ListDatabasesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDatabasesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDatabasesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDatabases page. +func (p *ListDatabasesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDatabasesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListDatabases(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/autoscaling/go.sum b/service/autoscaling/go.sum index c669e324b14..32595049f96 100644 --- a/service/autoscaling/go.sum +++ b/service/autoscaling/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/autoscaling/paginators.go b/service/autoscaling/paginators.go new file mode 100644 index 00000000000..ba0fab07aa6 --- /dev/null +++ b/service/autoscaling/paginators.go @@ -0,0 +1,627 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package autoscaling + +import ( + "context" + "fmt" +) + +// DescribeNotificationConfigurationsAPIClient is a client that implements the +// DescribeNotificationConfigurations operation. +type DescribeNotificationConfigurationsAPIClient interface { + DescribeNotificationConfigurations(context.Context, *DescribeNotificationConfigurationsInput, ...func(*Options)) (*DescribeNotificationConfigurationsOutput, error) +} + +var _ DescribeNotificationConfigurationsAPIClient = (*Client)(nil) + +// DescribeNotificationConfigurationsPaginatorOptions is the paginator options for +// DescribeNotificationConfigurations +type DescribeNotificationConfigurationsPaginatorOptions struct { + // The maximum number of items to return with this call. The default value is 50 + // and the maximum value is 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeNotificationConfigurationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/autoscaling.DescribeNotificationConfigurations +type DescribeNotificationConfigurationsPaginator struct { + options DescribeNotificationConfigurationsPaginatorOptions + client DescribeNotificationConfigurationsAPIClient + params *DescribeNotificationConfigurationsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeNotificationConfigurationsPaginator returns a new +// DescribeNotificationConfigurationsPaginator +func NewDescribeNotificationConfigurationsPaginator(client DescribeNotificationConfigurationsAPIClient, params *DescribeNotificationConfigurationsInput, optFns ...func(*DescribeNotificationConfigurationsPaginatorOptions)) *DescribeNotificationConfigurationsPaginator { + options := DescribeNotificationConfigurationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeNotificationConfigurationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeNotificationConfigurationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeNotificationConfigurations page. +func (p *DescribeNotificationConfigurationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeNotificationConfigurationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeNotificationConfigurations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeAutoScalingInstancesAPIClient is a client that implements the +// DescribeAutoScalingInstances operation. +type DescribeAutoScalingInstancesAPIClient interface { + DescribeAutoScalingInstances(context.Context, *DescribeAutoScalingInstancesInput, ...func(*Options)) (*DescribeAutoScalingInstancesOutput, error) +} + +var _ DescribeAutoScalingInstancesAPIClient = (*Client)(nil) + +// DescribeAutoScalingInstancesPaginatorOptions is the paginator options for +// DescribeAutoScalingInstances +type DescribeAutoScalingInstancesPaginatorOptions struct { + // The maximum number of items to return with this call. The default value is 50 + // and the maximum value is 50. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeAutoScalingInstancesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/autoscaling.DescribeAutoScalingInstances +type DescribeAutoScalingInstancesPaginator struct { + options DescribeAutoScalingInstancesPaginatorOptions + client DescribeAutoScalingInstancesAPIClient + params *DescribeAutoScalingInstancesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeAutoScalingInstancesPaginator returns a new +// DescribeAutoScalingInstancesPaginator +func NewDescribeAutoScalingInstancesPaginator(client DescribeAutoScalingInstancesAPIClient, params *DescribeAutoScalingInstancesInput, optFns ...func(*DescribeAutoScalingInstancesPaginatorOptions)) *DescribeAutoScalingInstancesPaginator { + options := DescribeAutoScalingInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeAutoScalingInstancesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeAutoScalingInstancesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeAutoScalingInstances page. +func (p *DescribeAutoScalingInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeAutoScalingInstancesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeAutoScalingInstances(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeLaunchConfigurationsAPIClient is a client that implements the +// DescribeLaunchConfigurations operation. +type DescribeLaunchConfigurationsAPIClient interface { + DescribeLaunchConfigurations(context.Context, *DescribeLaunchConfigurationsInput, ...func(*Options)) (*DescribeLaunchConfigurationsOutput, error) +} + +var _ DescribeLaunchConfigurationsAPIClient = (*Client)(nil) + +// DescribeLaunchConfigurationsPaginatorOptions is the paginator options for +// DescribeLaunchConfigurations +type DescribeLaunchConfigurationsPaginatorOptions struct { + // The maximum number of items to return with this call. The default value is 50 + // and the maximum value is 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeLaunchConfigurationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/autoscaling.DescribeLaunchConfigurations +type DescribeLaunchConfigurationsPaginator struct { + options DescribeLaunchConfigurationsPaginatorOptions + client DescribeLaunchConfigurationsAPIClient + params *DescribeLaunchConfigurationsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeLaunchConfigurationsPaginator returns a new +// DescribeLaunchConfigurationsPaginator +func NewDescribeLaunchConfigurationsPaginator(client DescribeLaunchConfigurationsAPIClient, params *DescribeLaunchConfigurationsInput, optFns ...func(*DescribeLaunchConfigurationsPaginatorOptions)) *DescribeLaunchConfigurationsPaginator { + options := DescribeLaunchConfigurationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeLaunchConfigurationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeLaunchConfigurationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeLaunchConfigurations page. +func (p *DescribeLaunchConfigurationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeLaunchConfigurationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeLaunchConfigurations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribePoliciesAPIClient is a client that implements the DescribePolicies +// operation. +type DescribePoliciesAPIClient interface { + DescribePolicies(context.Context, *DescribePoliciesInput, ...func(*Options)) (*DescribePoliciesOutput, error) +} + +var _ DescribePoliciesAPIClient = (*Client)(nil) + +// DescribePoliciesPaginatorOptions is the paginator options for DescribePolicies +type DescribePoliciesPaginatorOptions struct { + // The maximum number of items to be returned with each call. The default value is + // 50 and the maximum value is 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribePoliciesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/autoscaling.DescribePolicies +type DescribePoliciesPaginator struct { + options DescribePoliciesPaginatorOptions + client DescribePoliciesAPIClient + params *DescribePoliciesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribePoliciesPaginator returns a new DescribePoliciesPaginator +func NewDescribePoliciesPaginator(client DescribePoliciesAPIClient, params *DescribePoliciesInput, optFns ...func(*DescribePoliciesPaginatorOptions)) *DescribePoliciesPaginator { + options := DescribePoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribePoliciesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribePoliciesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribePolicies page. +func (p *DescribePoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribePoliciesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribePolicies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeAutoScalingGroupsAPIClient is a client that implements the +// DescribeAutoScalingGroups operation. +type DescribeAutoScalingGroupsAPIClient interface { + DescribeAutoScalingGroups(context.Context, *DescribeAutoScalingGroupsInput, ...func(*Options)) (*DescribeAutoScalingGroupsOutput, error) +} + +var _ DescribeAutoScalingGroupsAPIClient = (*Client)(nil) + +// DescribeAutoScalingGroupsPaginatorOptions is the paginator options for +// DescribeAutoScalingGroups +type DescribeAutoScalingGroupsPaginatorOptions struct { + // The maximum number of items to return with this call. The default value is 50 + // and the maximum value is 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeAutoScalingGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/autoscaling.DescribeAutoScalingGroups +type DescribeAutoScalingGroupsPaginator struct { + options DescribeAutoScalingGroupsPaginatorOptions + client DescribeAutoScalingGroupsAPIClient + params *DescribeAutoScalingGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeAutoScalingGroupsPaginator returns a new +// DescribeAutoScalingGroupsPaginator +func NewDescribeAutoScalingGroupsPaginator(client DescribeAutoScalingGroupsAPIClient, params *DescribeAutoScalingGroupsInput, optFns ...func(*DescribeAutoScalingGroupsPaginatorOptions)) *DescribeAutoScalingGroupsPaginator { + options := DescribeAutoScalingGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeAutoScalingGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeAutoScalingGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeAutoScalingGroups page. +func (p *DescribeAutoScalingGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeAutoScalingGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeAutoScalingGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeScalingActivitiesAPIClient is a client that implements the +// DescribeScalingActivities operation. +type DescribeScalingActivitiesAPIClient interface { + DescribeScalingActivities(context.Context, *DescribeScalingActivitiesInput, ...func(*Options)) (*DescribeScalingActivitiesOutput, error) +} + +var _ DescribeScalingActivitiesAPIClient = (*Client)(nil) + +// DescribeScalingActivitiesPaginatorOptions is the paginator options for +// DescribeScalingActivities +type DescribeScalingActivitiesPaginatorOptions struct { + // The maximum number of items to return with this call. The default value is 100 + // and the maximum value is 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeScalingActivitiesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/autoscaling.DescribeScalingActivities +type DescribeScalingActivitiesPaginator struct { + options DescribeScalingActivitiesPaginatorOptions + client DescribeScalingActivitiesAPIClient + params *DescribeScalingActivitiesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeScalingActivitiesPaginator returns a new +// DescribeScalingActivitiesPaginator +func NewDescribeScalingActivitiesPaginator(client DescribeScalingActivitiesAPIClient, params *DescribeScalingActivitiesInput, optFns ...func(*DescribeScalingActivitiesPaginatorOptions)) *DescribeScalingActivitiesPaginator { + options := DescribeScalingActivitiesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeScalingActivitiesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeScalingActivitiesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeScalingActivities page. +func (p *DescribeScalingActivitiesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeScalingActivitiesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeScalingActivities(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeTagsAPIClient is a client that implements the DescribeTags operation. +type DescribeTagsAPIClient interface { + DescribeTags(context.Context, *DescribeTagsInput, ...func(*Options)) (*DescribeTagsOutput, error) +} + +var _ DescribeTagsAPIClient = (*Client)(nil) + +// DescribeTagsPaginatorOptions is the paginator options for DescribeTags +type DescribeTagsPaginatorOptions struct { + // The maximum number of items to return with this call. The default value is 50 + // and the maximum value is 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeTagsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/autoscaling.DescribeTags +type DescribeTagsPaginator struct { + options DescribeTagsPaginatorOptions + client DescribeTagsAPIClient + params *DescribeTagsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeTagsPaginator returns a new DescribeTagsPaginator +func NewDescribeTagsPaginator(client DescribeTagsAPIClient, params *DescribeTagsInput, optFns ...func(*DescribeTagsPaginatorOptions)) *DescribeTagsPaginator { + options := DescribeTagsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeTagsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeTagsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeTags page. +func (p *DescribeTagsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTagsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeTags(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeScheduledActionsAPIClient is a client that implements the +// DescribeScheduledActions operation. +type DescribeScheduledActionsAPIClient interface { + DescribeScheduledActions(context.Context, *DescribeScheduledActionsInput, ...func(*Options)) (*DescribeScheduledActionsOutput, error) +} + +var _ DescribeScheduledActionsAPIClient = (*Client)(nil) + +// DescribeScheduledActionsPaginatorOptions is the paginator options for +// DescribeScheduledActions +type DescribeScheduledActionsPaginatorOptions struct { + // The maximum number of items to return with this call. The default value is 50 + // and the maximum value is 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeScheduledActionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/autoscaling.DescribeScheduledActions +type DescribeScheduledActionsPaginator struct { + options DescribeScheduledActionsPaginatorOptions + client DescribeScheduledActionsAPIClient + params *DescribeScheduledActionsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeScheduledActionsPaginator returns a new +// DescribeScheduledActionsPaginator +func NewDescribeScheduledActionsPaginator(client DescribeScheduledActionsAPIClient, params *DescribeScheduledActionsInput, optFns ...func(*DescribeScheduledActionsPaginatorOptions)) *DescribeScheduledActionsPaginator { + options := DescribeScheduledActionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeScheduledActionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeScheduledActionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeScheduledActions page. +func (p *DescribeScheduledActionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeScheduledActionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeScheduledActions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/autoscalingplans/go.sum b/service/autoscalingplans/go.sum index c669e324b14..32595049f96 100644 --- a/service/autoscalingplans/go.sum +++ b/service/autoscalingplans/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/backup/go.sum b/service/backup/go.sum index c669e324b14..32595049f96 100644 --- a/service/backup/go.sum +++ b/service/backup/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/backup/paginators.go b/service/backup/paginators.go new file mode 100644 index 00000000000..e59b694ee8d --- /dev/null +++ b/service/backup/paginators.go @@ -0,0 +1,915 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package backup + +import ( + "context" + "fmt" +) + +// ListBackupSelectionsAPIClient is a client that implements the +// ListBackupSelections operation. +type ListBackupSelectionsAPIClient interface { + ListBackupSelections(context.Context, *ListBackupSelectionsInput, ...func(*Options)) (*ListBackupSelectionsOutput, error) +} + +var _ ListBackupSelectionsAPIClient = (*Client)(nil) + +// ListBackupSelectionsPaginatorOptions is the paginator options for +// ListBackupSelections +type ListBackupSelectionsPaginatorOptions struct { + // The maximum number of items to be returned. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListBackupSelectionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/backup.ListBackupSelections +type ListBackupSelectionsPaginator struct { + options ListBackupSelectionsPaginatorOptions + client ListBackupSelectionsAPIClient + params *ListBackupSelectionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListBackupSelectionsPaginator returns a new ListBackupSelectionsPaginator +func NewListBackupSelectionsPaginator(client ListBackupSelectionsAPIClient, params *ListBackupSelectionsInput, optFns ...func(*ListBackupSelectionsPaginatorOptions)) *ListBackupSelectionsPaginator { + options := ListBackupSelectionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListBackupSelectionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListBackupSelectionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListBackupSelections page. +func (p *ListBackupSelectionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBackupSelectionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListBackupSelections(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListRecoveryPointsByResourceAPIClient is a client that implements the +// ListRecoveryPointsByResource operation. +type ListRecoveryPointsByResourceAPIClient interface { + ListRecoveryPointsByResource(context.Context, *ListRecoveryPointsByResourceInput, ...func(*Options)) (*ListRecoveryPointsByResourceOutput, error) +} + +var _ ListRecoveryPointsByResourceAPIClient = (*Client)(nil) + +// ListRecoveryPointsByResourcePaginatorOptions is the paginator options for +// ListRecoveryPointsByResource +type ListRecoveryPointsByResourcePaginatorOptions struct { + // The maximum number of items to be returned. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListRecoveryPointsByResourcePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/backup.ListRecoveryPointsByResource +type ListRecoveryPointsByResourcePaginator struct { + options ListRecoveryPointsByResourcePaginatorOptions + client ListRecoveryPointsByResourceAPIClient + params *ListRecoveryPointsByResourceInput + nextToken *string + firstPage bool + done bool +} + +// NewListRecoveryPointsByResourcePaginator returns a new +// ListRecoveryPointsByResourcePaginator +func NewListRecoveryPointsByResourcePaginator(client ListRecoveryPointsByResourceAPIClient, params *ListRecoveryPointsByResourceInput, optFns ...func(*ListRecoveryPointsByResourcePaginatorOptions)) *ListRecoveryPointsByResourcePaginator { + options := ListRecoveryPointsByResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListRecoveryPointsByResourcePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRecoveryPointsByResourcePaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListRecoveryPointsByResource page. +func (p *ListRecoveryPointsByResourcePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRecoveryPointsByResourceOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListRecoveryPointsByResource(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListProtectedResourcesAPIClient is a client that implements the +// ListProtectedResources operation. +type ListProtectedResourcesAPIClient interface { + ListProtectedResources(context.Context, *ListProtectedResourcesInput, ...func(*Options)) (*ListProtectedResourcesOutput, error) +} + +var _ ListProtectedResourcesAPIClient = (*Client)(nil) + +// ListProtectedResourcesPaginatorOptions is the paginator options for +// ListProtectedResources +type ListProtectedResourcesPaginatorOptions struct { + // The maximum number of items to be returned. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListProtectedResourcesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/backup.ListProtectedResources +type ListProtectedResourcesPaginator struct { + options ListProtectedResourcesPaginatorOptions + client ListProtectedResourcesAPIClient + params *ListProtectedResourcesInput + nextToken *string + firstPage bool + done bool +} + +// NewListProtectedResourcesPaginator returns a new ListProtectedResourcesPaginator +func NewListProtectedResourcesPaginator(client ListProtectedResourcesAPIClient, params *ListProtectedResourcesInput, optFns ...func(*ListProtectedResourcesPaginatorOptions)) *ListProtectedResourcesPaginator { + options := ListProtectedResourcesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListProtectedResourcesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListProtectedResourcesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListProtectedResources page. +func (p *ListProtectedResourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProtectedResourcesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListProtectedResources(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListRecoveryPointsByBackupVaultAPIClient is a client that implements the +// ListRecoveryPointsByBackupVault operation. +type ListRecoveryPointsByBackupVaultAPIClient interface { + ListRecoveryPointsByBackupVault(context.Context, *ListRecoveryPointsByBackupVaultInput, ...func(*Options)) (*ListRecoveryPointsByBackupVaultOutput, error) +} + +var _ ListRecoveryPointsByBackupVaultAPIClient = (*Client)(nil) + +// ListRecoveryPointsByBackupVaultPaginatorOptions is the paginator options for +// ListRecoveryPointsByBackupVault +type ListRecoveryPointsByBackupVaultPaginatorOptions struct { + // The maximum number of items to be returned. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListRecoveryPointsByBackupVaultPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/backup.ListRecoveryPointsByBackupVault +type ListRecoveryPointsByBackupVaultPaginator struct { + options ListRecoveryPointsByBackupVaultPaginatorOptions + client ListRecoveryPointsByBackupVaultAPIClient + params *ListRecoveryPointsByBackupVaultInput + nextToken *string + firstPage bool + done bool +} + +// NewListRecoveryPointsByBackupVaultPaginator returns a new +// ListRecoveryPointsByBackupVaultPaginator +func NewListRecoveryPointsByBackupVaultPaginator(client ListRecoveryPointsByBackupVaultAPIClient, params *ListRecoveryPointsByBackupVaultInput, optFns ...func(*ListRecoveryPointsByBackupVaultPaginatorOptions)) *ListRecoveryPointsByBackupVaultPaginator { + options := ListRecoveryPointsByBackupVaultPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListRecoveryPointsByBackupVaultPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRecoveryPointsByBackupVaultPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListRecoveryPointsByBackupVault page. +func (p *ListRecoveryPointsByBackupVaultPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRecoveryPointsByBackupVaultOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListRecoveryPointsByBackupVault(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListBackupPlanVersionsAPIClient is a client that implements the +// ListBackupPlanVersions operation. +type ListBackupPlanVersionsAPIClient interface { + ListBackupPlanVersions(context.Context, *ListBackupPlanVersionsInput, ...func(*Options)) (*ListBackupPlanVersionsOutput, error) +} + +var _ ListBackupPlanVersionsAPIClient = (*Client)(nil) + +// ListBackupPlanVersionsPaginatorOptions is the paginator options for +// ListBackupPlanVersions +type ListBackupPlanVersionsPaginatorOptions struct { + // The maximum number of items to be returned. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListBackupPlanVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/backup.ListBackupPlanVersions +type ListBackupPlanVersionsPaginator struct { + options ListBackupPlanVersionsPaginatorOptions + client ListBackupPlanVersionsAPIClient + params *ListBackupPlanVersionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListBackupPlanVersionsPaginator returns a new ListBackupPlanVersionsPaginator +func NewListBackupPlanVersionsPaginator(client ListBackupPlanVersionsAPIClient, params *ListBackupPlanVersionsInput, optFns ...func(*ListBackupPlanVersionsPaginatorOptions)) *ListBackupPlanVersionsPaginator { + options := ListBackupPlanVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListBackupPlanVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListBackupPlanVersionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListBackupPlanVersions page. +func (p *ListBackupPlanVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBackupPlanVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListBackupPlanVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListBackupVaultsAPIClient is a client that implements the ListBackupVaults +// operation. +type ListBackupVaultsAPIClient interface { + ListBackupVaults(context.Context, *ListBackupVaultsInput, ...func(*Options)) (*ListBackupVaultsOutput, error) +} + +var _ ListBackupVaultsAPIClient = (*Client)(nil) + +// ListBackupVaultsPaginatorOptions is the paginator options for ListBackupVaults +type ListBackupVaultsPaginatorOptions struct { + // The maximum number of items to be returned. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListBackupVaultsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/backup.ListBackupVaults +type ListBackupVaultsPaginator struct { + options ListBackupVaultsPaginatorOptions + client ListBackupVaultsAPIClient + params *ListBackupVaultsInput + nextToken *string + firstPage bool + done bool +} + +// NewListBackupVaultsPaginator returns a new ListBackupVaultsPaginator +func NewListBackupVaultsPaginator(client ListBackupVaultsAPIClient, params *ListBackupVaultsInput, optFns ...func(*ListBackupVaultsPaginatorOptions)) *ListBackupVaultsPaginator { + options := ListBackupVaultsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListBackupVaultsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListBackupVaultsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListBackupVaults page. +func (p *ListBackupVaultsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBackupVaultsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListBackupVaults(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListBackupPlansAPIClient is a client that implements the ListBackupPlans +// operation. +type ListBackupPlansAPIClient interface { + ListBackupPlans(context.Context, *ListBackupPlansInput, ...func(*Options)) (*ListBackupPlansOutput, error) +} + +var _ ListBackupPlansAPIClient = (*Client)(nil) + +// ListBackupPlansPaginatorOptions is the paginator options for ListBackupPlans +type ListBackupPlansPaginatorOptions struct { + // The maximum number of items to be returned. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListBackupPlansPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/backup.ListBackupPlans +type ListBackupPlansPaginator struct { + options ListBackupPlansPaginatorOptions + client ListBackupPlansAPIClient + params *ListBackupPlansInput + nextToken *string + firstPage bool + done bool +} + +// NewListBackupPlansPaginator returns a new ListBackupPlansPaginator +func NewListBackupPlansPaginator(client ListBackupPlansAPIClient, params *ListBackupPlansInput, optFns ...func(*ListBackupPlansPaginatorOptions)) *ListBackupPlansPaginator { + options := ListBackupPlansPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListBackupPlansPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListBackupPlansPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListBackupPlans page. +func (p *ListBackupPlansPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBackupPlansOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListBackupPlans(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListCopyJobsAPIClient is a client that implements the ListCopyJobs operation. +type ListCopyJobsAPIClient interface { + ListCopyJobs(context.Context, *ListCopyJobsInput, ...func(*Options)) (*ListCopyJobsOutput, error) +} + +var _ ListCopyJobsAPIClient = (*Client)(nil) + +// ListCopyJobsPaginatorOptions is the paginator options for ListCopyJobs +type ListCopyJobsPaginatorOptions struct { + // The maximum number of items to be returned. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListCopyJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/backup.ListCopyJobs +type ListCopyJobsPaginator struct { + options ListCopyJobsPaginatorOptions + client ListCopyJobsAPIClient + params *ListCopyJobsInput + nextToken *string + firstPage bool + done bool +} + +// NewListCopyJobsPaginator returns a new ListCopyJobsPaginator +func NewListCopyJobsPaginator(client ListCopyJobsAPIClient, params *ListCopyJobsInput, optFns ...func(*ListCopyJobsPaginatorOptions)) *ListCopyJobsPaginator { + options := ListCopyJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListCopyJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCopyJobsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListCopyJobs page. +func (p *ListCopyJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCopyJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListCopyJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListBackupJobsAPIClient is a client that implements the ListBackupJobs +// operation. +type ListBackupJobsAPIClient interface { + ListBackupJobs(context.Context, *ListBackupJobsInput, ...func(*Options)) (*ListBackupJobsOutput, error) +} + +var _ ListBackupJobsAPIClient = (*Client)(nil) + +// ListBackupJobsPaginatorOptions is the paginator options for ListBackupJobs +type ListBackupJobsPaginatorOptions struct { + // The maximum number of items to be returned. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListBackupJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/backup.ListBackupJobs +type ListBackupJobsPaginator struct { + options ListBackupJobsPaginatorOptions + client ListBackupJobsAPIClient + params *ListBackupJobsInput + nextToken *string + firstPage bool + done bool +} + +// NewListBackupJobsPaginator returns a new ListBackupJobsPaginator +func NewListBackupJobsPaginator(client ListBackupJobsAPIClient, params *ListBackupJobsInput, optFns ...func(*ListBackupJobsPaginatorOptions)) *ListBackupJobsPaginator { + options := ListBackupJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListBackupJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListBackupJobsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListBackupJobs page. +func (p *ListBackupJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBackupJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListBackupJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTagsAPIClient is a client that implements the ListTags operation. +type ListTagsAPIClient interface { + ListTags(context.Context, *ListTagsInput, ...func(*Options)) (*ListTagsOutput, error) +} + +var _ ListTagsAPIClient = (*Client)(nil) + +// ListTagsPaginatorOptions is the paginator options for ListTags +type ListTagsPaginatorOptions struct { + // The maximum number of items to be returned. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTagsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/backup.ListTags +type ListTagsPaginator struct { + options ListTagsPaginatorOptions + client ListTagsAPIClient + params *ListTagsInput + nextToken *string + firstPage bool + done bool +} + +// NewListTagsPaginator returns a new ListTagsPaginator +func NewListTagsPaginator(client ListTagsAPIClient, params *ListTagsInput, optFns ...func(*ListTagsPaginatorOptions)) *ListTagsPaginator { + options := ListTagsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTagsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTagsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTags page. +func (p *ListTagsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTagsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListTags(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListRestoreJobsAPIClient is a client that implements the ListRestoreJobs +// operation. +type ListRestoreJobsAPIClient interface { + ListRestoreJobs(context.Context, *ListRestoreJobsInput, ...func(*Options)) (*ListRestoreJobsOutput, error) +} + +var _ ListRestoreJobsAPIClient = (*Client)(nil) + +// ListRestoreJobsPaginatorOptions is the paginator options for ListRestoreJobs +type ListRestoreJobsPaginatorOptions struct { + // The maximum number of items to be returned. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListRestoreJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/backup.ListRestoreJobs +type ListRestoreJobsPaginator struct { + options ListRestoreJobsPaginatorOptions + client ListRestoreJobsAPIClient + params *ListRestoreJobsInput + nextToken *string + firstPage bool + done bool +} + +// NewListRestoreJobsPaginator returns a new ListRestoreJobsPaginator +func NewListRestoreJobsPaginator(client ListRestoreJobsAPIClient, params *ListRestoreJobsInput, optFns ...func(*ListRestoreJobsPaginatorOptions)) *ListRestoreJobsPaginator { + options := ListRestoreJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListRestoreJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRestoreJobsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListRestoreJobs page. +func (p *ListRestoreJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRestoreJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListRestoreJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListBackupPlanTemplatesAPIClient is a client that implements the +// ListBackupPlanTemplates operation. +type ListBackupPlanTemplatesAPIClient interface { + ListBackupPlanTemplates(context.Context, *ListBackupPlanTemplatesInput, ...func(*Options)) (*ListBackupPlanTemplatesOutput, error) +} + +var _ ListBackupPlanTemplatesAPIClient = (*Client)(nil) + +// ListBackupPlanTemplatesPaginatorOptions is the paginator options for +// ListBackupPlanTemplates +type ListBackupPlanTemplatesPaginatorOptions struct { + // The maximum number of items to be returned. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListBackupPlanTemplatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/backup.ListBackupPlanTemplates +type ListBackupPlanTemplatesPaginator struct { + options ListBackupPlanTemplatesPaginatorOptions + client ListBackupPlanTemplatesAPIClient + params *ListBackupPlanTemplatesInput + nextToken *string + firstPage bool + done bool +} + +// NewListBackupPlanTemplatesPaginator returns a new +// ListBackupPlanTemplatesPaginator +func NewListBackupPlanTemplatesPaginator(client ListBackupPlanTemplatesAPIClient, params *ListBackupPlanTemplatesInput, optFns ...func(*ListBackupPlanTemplatesPaginatorOptions)) *ListBackupPlanTemplatesPaginator { + options := ListBackupPlanTemplatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListBackupPlanTemplatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListBackupPlanTemplatesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListBackupPlanTemplates page. +func (p *ListBackupPlanTemplatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBackupPlanTemplatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListBackupPlanTemplates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/batch/go.sum b/service/batch/go.sum index c669e324b14..32595049f96 100644 --- a/service/batch/go.sum +++ b/service/batch/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/batch/paginators.go b/service/batch/paginators.go new file mode 100644 index 00000000000..f8af7bc6608 --- /dev/null +++ b/service/batch/paginators.go @@ -0,0 +1,335 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package batch + +import ( + "context" + "fmt" +) + +// DescribeJobDefinitionsAPIClient is a client that implements the +// DescribeJobDefinitions operation. +type DescribeJobDefinitionsAPIClient interface { + DescribeJobDefinitions(context.Context, *DescribeJobDefinitionsInput, ...func(*Options)) (*DescribeJobDefinitionsOutput, error) +} + +var _ DescribeJobDefinitionsAPIClient = (*Client)(nil) + +// DescribeJobDefinitionsPaginatorOptions is the paginator options for +// DescribeJobDefinitions +type DescribeJobDefinitionsPaginatorOptions struct { + // The maximum number of results returned by DescribeJobDefinitions in paginated + // output. When this parameter is used, DescribeJobDefinitions only returns + // maxResults results in a single page along with a nextToken response element. The + // remaining results of the initial request can be seen by sending another + // DescribeJobDefinitions request with the returned nextToken value. This value can + // be between 1 and 100. If this parameter is not used, then DescribeJobDefinitions + // returns up to 100 results and a nextToken value if applicable. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeJobDefinitionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/batch.DescribeJobDefinitions +type DescribeJobDefinitionsPaginator struct { + options DescribeJobDefinitionsPaginatorOptions + client DescribeJobDefinitionsAPIClient + params *DescribeJobDefinitionsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeJobDefinitionsPaginator returns a new DescribeJobDefinitionsPaginator +func NewDescribeJobDefinitionsPaginator(client DescribeJobDefinitionsAPIClient, params *DescribeJobDefinitionsInput, optFns ...func(*DescribeJobDefinitionsPaginatorOptions)) *DescribeJobDefinitionsPaginator { + options := DescribeJobDefinitionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeJobDefinitionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeJobDefinitionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeJobDefinitions page. +func (p *DescribeJobDefinitionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeJobDefinitionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeJobDefinitions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListJobsAPIClient is a client that implements the ListJobs operation. +type ListJobsAPIClient interface { + ListJobs(context.Context, *ListJobsInput, ...func(*Options)) (*ListJobsOutput, error) +} + +var _ ListJobsAPIClient = (*Client)(nil) + +// ListJobsPaginatorOptions is the paginator options for ListJobs +type ListJobsPaginatorOptions struct { + // The maximum number of results returned by ListJobs in paginated output. When + // this parameter is used, ListJobs only returns maxResults results in a single + // page along with a nextToken response element. The remaining results of the + // initial request can be seen by sending another ListJobs request with the + // returned nextToken value. This value can be between 1 and 100. If this parameter + // is not used, then ListJobs returns up to 100 results and a nextToken value if + // applicable. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/batch.ListJobs +type ListJobsPaginator struct { + options ListJobsPaginatorOptions + client ListJobsAPIClient + params *ListJobsInput + nextToken *string + firstPage bool + done bool +} + +// NewListJobsPaginator returns a new ListJobsPaginator +func NewListJobsPaginator(client ListJobsAPIClient, params *ListJobsInput, optFns ...func(*ListJobsPaginatorOptions)) *ListJobsPaginator { + options := ListJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListJobsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListJobs page. +func (p *ListJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeJobQueuesAPIClient is a client that implements the DescribeJobQueues +// operation. +type DescribeJobQueuesAPIClient interface { + DescribeJobQueues(context.Context, *DescribeJobQueuesInput, ...func(*Options)) (*DescribeJobQueuesOutput, error) +} + +var _ DescribeJobQueuesAPIClient = (*Client)(nil) + +// DescribeJobQueuesPaginatorOptions is the paginator options for DescribeJobQueues +type DescribeJobQueuesPaginatorOptions struct { + // The maximum number of results returned by DescribeJobQueues in paginated output. + // When this parameter is used, DescribeJobQueues only returns maxResults results + // in a single page along with a nextToken response element. The remaining results + // of the initial request can be seen by sending another DescribeJobQueues request + // with the returned nextToken value. This value can be between 1 and 100. If this + // parameter is not used, then DescribeJobQueues returns up to 100 results and a + // nextToken value if applicable. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeJobQueuesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/batch.DescribeJobQueues +type DescribeJobQueuesPaginator struct { + options DescribeJobQueuesPaginatorOptions + client DescribeJobQueuesAPIClient + params *DescribeJobQueuesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeJobQueuesPaginator returns a new DescribeJobQueuesPaginator +func NewDescribeJobQueuesPaginator(client DescribeJobQueuesAPIClient, params *DescribeJobQueuesInput, optFns ...func(*DescribeJobQueuesPaginatorOptions)) *DescribeJobQueuesPaginator { + options := DescribeJobQueuesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeJobQueuesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeJobQueuesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeJobQueues page. +func (p *DescribeJobQueuesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeJobQueuesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeJobQueues(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeComputeEnvironmentsAPIClient is a client that implements the +// DescribeComputeEnvironments operation. +type DescribeComputeEnvironmentsAPIClient interface { + DescribeComputeEnvironments(context.Context, *DescribeComputeEnvironmentsInput, ...func(*Options)) (*DescribeComputeEnvironmentsOutput, error) +} + +var _ DescribeComputeEnvironmentsAPIClient = (*Client)(nil) + +// DescribeComputeEnvironmentsPaginatorOptions is the paginator options for +// DescribeComputeEnvironments +type DescribeComputeEnvironmentsPaginatorOptions struct { + // The maximum number of cluster results returned by DescribeComputeEnvironments in + // paginated output. When this parameter is used, DescribeComputeEnvironments only + // returns maxResults results in a single page along with a nextToken response + // element. The remaining results of the initial request can be seen by sending + // another DescribeComputeEnvironments request with the returned nextToken value. + // This value can be between 1 and 100. If this parameter is not used, then + // DescribeComputeEnvironments returns up to 100 results and a nextToken value if + // applicable. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeComputeEnvironmentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/batch.DescribeComputeEnvironments +type DescribeComputeEnvironmentsPaginator struct { + options DescribeComputeEnvironmentsPaginatorOptions + client DescribeComputeEnvironmentsAPIClient + params *DescribeComputeEnvironmentsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeComputeEnvironmentsPaginator returns a new +// DescribeComputeEnvironmentsPaginator +func NewDescribeComputeEnvironmentsPaginator(client DescribeComputeEnvironmentsAPIClient, params *DescribeComputeEnvironmentsInput, optFns ...func(*DescribeComputeEnvironmentsPaginatorOptions)) *DescribeComputeEnvironmentsPaginator { + options := DescribeComputeEnvironmentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeComputeEnvironmentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeComputeEnvironmentsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeComputeEnvironments page. +func (p *DescribeComputeEnvironmentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeComputeEnvironmentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeComputeEnvironments(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/braket/go.sum b/service/braket/go.sum index c669e324b14..32595049f96 100644 --- a/service/braket/go.sum +++ b/service/braket/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/braket/paginators.go b/service/braket/paginators.go new file mode 100644 index 00000000000..502203db3ad --- /dev/null +++ b/service/braket/paginators.go @@ -0,0 +1,158 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package braket + +import ( + "context" + "fmt" +) + +// SearchQuantumTasksAPIClient is a client that implements the SearchQuantumTasks +// operation. +type SearchQuantumTasksAPIClient interface { + SearchQuantumTasks(context.Context, *SearchQuantumTasksInput, ...func(*Options)) (*SearchQuantumTasksOutput, error) +} + +var _ SearchQuantumTasksAPIClient = (*Client)(nil) + +// SearchQuantumTasksPaginatorOptions is the paginator options for +// SearchQuantumTasks +type SearchQuantumTasksPaginatorOptions struct { + // Maximum number of results to return in the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// SearchQuantumTasksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/braket.SearchQuantumTasks +type SearchQuantumTasksPaginator struct { + options SearchQuantumTasksPaginatorOptions + client SearchQuantumTasksAPIClient + params *SearchQuantumTasksInput + nextToken *string + firstPage bool + done bool +} + +// NewSearchQuantumTasksPaginator returns a new SearchQuantumTasksPaginator +func NewSearchQuantumTasksPaginator(client SearchQuantumTasksAPIClient, params *SearchQuantumTasksInput, optFns ...func(*SearchQuantumTasksPaginatorOptions)) *SearchQuantumTasksPaginator { + options := SearchQuantumTasksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &SearchQuantumTasksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchQuantumTasksPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next SearchQuantumTasks page. +func (p *SearchQuantumTasksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchQuantumTasksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.SearchQuantumTasks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// SearchDevicesAPIClient is a client that implements the SearchDevices operation. +type SearchDevicesAPIClient interface { + SearchDevices(context.Context, *SearchDevicesInput, ...func(*Options)) (*SearchDevicesOutput, error) +} + +var _ SearchDevicesAPIClient = (*Client)(nil) + +// SearchDevicesPaginatorOptions is the paginator options for SearchDevices +type SearchDevicesPaginatorOptions struct { + // The maximum number of results to return in the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// SearchDevicesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/braket.SearchDevices +type SearchDevicesPaginator struct { + options SearchDevicesPaginatorOptions + client SearchDevicesAPIClient + params *SearchDevicesInput + nextToken *string + firstPage bool + done bool +} + +// NewSearchDevicesPaginator returns a new SearchDevicesPaginator +func NewSearchDevicesPaginator(client SearchDevicesAPIClient, params *SearchDevicesInput, optFns ...func(*SearchDevicesPaginatorOptions)) *SearchDevicesPaginator { + options := SearchDevicesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &SearchDevicesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchDevicesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next SearchDevices page. +func (p *SearchDevicesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchDevicesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.SearchDevices(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/budgets/go.sum b/service/budgets/go.sum index c669e324b14..32595049f96 100644 --- a/service/budgets/go.sum +++ b/service/budgets/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/budgets/paginators.go b/service/budgets/paginators.go new file mode 100644 index 00000000000..a1ea9d83003 --- /dev/null +++ b/service/budgets/paginators.go @@ -0,0 +1,474 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package budgets + +import ( + "context" + "fmt" +) + +// DescribeBudgetsAPIClient is a client that implements the DescribeBudgets +// operation. +type DescribeBudgetsAPIClient interface { + DescribeBudgets(context.Context, *DescribeBudgetsInput, ...func(*Options)) (*DescribeBudgetsOutput, error) +} + +var _ DescribeBudgetsAPIClient = (*Client)(nil) + +// DescribeBudgetsPaginatorOptions is the paginator options for DescribeBudgets +type DescribeBudgetsPaginatorOptions struct { + // An optional integer that represents how many entries a paginated response + // contains. The maximum is 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeBudgetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/budgets.DescribeBudgets +type DescribeBudgetsPaginator struct { + options DescribeBudgetsPaginatorOptions + client DescribeBudgetsAPIClient + params *DescribeBudgetsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeBudgetsPaginator returns a new DescribeBudgetsPaginator +func NewDescribeBudgetsPaginator(client DescribeBudgetsAPIClient, params *DescribeBudgetsInput, optFns ...func(*DescribeBudgetsPaginatorOptions)) *DescribeBudgetsPaginator { + options := DescribeBudgetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeBudgetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeBudgetsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeBudgets page. +func (p *DescribeBudgetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeBudgetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeBudgets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeBudgetActionsForBudgetAPIClient is a client that implements the +// DescribeBudgetActionsForBudget operation. +type DescribeBudgetActionsForBudgetAPIClient interface { + DescribeBudgetActionsForBudget(context.Context, *DescribeBudgetActionsForBudgetInput, ...func(*Options)) (*DescribeBudgetActionsForBudgetOutput, error) +} + +var _ DescribeBudgetActionsForBudgetAPIClient = (*Client)(nil) + +// DescribeBudgetActionsForBudgetPaginatorOptions is the paginator options for +// DescribeBudgetActionsForBudget +type DescribeBudgetActionsForBudgetPaginatorOptions struct { + // An integer that represents how many entries a paginated response contains. The + // maximum is 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeBudgetActionsForBudgetPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/budgets.DescribeBudgetActionsForBudget +type DescribeBudgetActionsForBudgetPaginator struct { + options DescribeBudgetActionsForBudgetPaginatorOptions + client DescribeBudgetActionsForBudgetAPIClient + params *DescribeBudgetActionsForBudgetInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeBudgetActionsForBudgetPaginator returns a new +// DescribeBudgetActionsForBudgetPaginator +func NewDescribeBudgetActionsForBudgetPaginator(client DescribeBudgetActionsForBudgetAPIClient, params *DescribeBudgetActionsForBudgetInput, optFns ...func(*DescribeBudgetActionsForBudgetPaginatorOptions)) *DescribeBudgetActionsForBudgetPaginator { + options := DescribeBudgetActionsForBudgetPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeBudgetActionsForBudgetPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeBudgetActionsForBudgetPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeBudgetActionsForBudget page. +func (p *DescribeBudgetActionsForBudgetPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeBudgetActionsForBudgetOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeBudgetActionsForBudget(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeSubscribersForNotificationAPIClient is a client that implements the +// DescribeSubscribersForNotification operation. +type DescribeSubscribersForNotificationAPIClient interface { + DescribeSubscribersForNotification(context.Context, *DescribeSubscribersForNotificationInput, ...func(*Options)) (*DescribeSubscribersForNotificationOutput, error) +} + +var _ DescribeSubscribersForNotificationAPIClient = (*Client)(nil) + +// DescribeSubscribersForNotificationPaginatorOptions is the paginator options for +// DescribeSubscribersForNotification +type DescribeSubscribersForNotificationPaginatorOptions struct { + // An optional integer that represents how many entries a paginated response + // contains. The maximum is 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeSubscribersForNotificationPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/budgets.DescribeSubscribersForNotification +type DescribeSubscribersForNotificationPaginator struct { + options DescribeSubscribersForNotificationPaginatorOptions + client DescribeSubscribersForNotificationAPIClient + params *DescribeSubscribersForNotificationInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeSubscribersForNotificationPaginator returns a new +// DescribeSubscribersForNotificationPaginator +func NewDescribeSubscribersForNotificationPaginator(client DescribeSubscribersForNotificationAPIClient, params *DescribeSubscribersForNotificationInput, optFns ...func(*DescribeSubscribersForNotificationPaginatorOptions)) *DescribeSubscribersForNotificationPaginator { + options := DescribeSubscribersForNotificationPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeSubscribersForNotificationPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeSubscribersForNotificationPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeSubscribersForNotification page. +func (p *DescribeSubscribersForNotificationPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeSubscribersForNotificationOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeSubscribersForNotification(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeBudgetActionHistoriesAPIClient is a client that implements the +// DescribeBudgetActionHistories operation. +type DescribeBudgetActionHistoriesAPIClient interface { + DescribeBudgetActionHistories(context.Context, *DescribeBudgetActionHistoriesInput, ...func(*Options)) (*DescribeBudgetActionHistoriesOutput, error) +} + +var _ DescribeBudgetActionHistoriesAPIClient = (*Client)(nil) + +// DescribeBudgetActionHistoriesPaginatorOptions is the paginator options for +// DescribeBudgetActionHistories +type DescribeBudgetActionHistoriesPaginatorOptions struct { + // An integer that represents how many entries a paginated response contains. The + // maximum is 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeBudgetActionHistoriesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/budgets.DescribeBudgetActionHistories +type DescribeBudgetActionHistoriesPaginator struct { + options DescribeBudgetActionHistoriesPaginatorOptions + client DescribeBudgetActionHistoriesAPIClient + params *DescribeBudgetActionHistoriesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeBudgetActionHistoriesPaginator returns a new +// DescribeBudgetActionHistoriesPaginator +func NewDescribeBudgetActionHistoriesPaginator(client DescribeBudgetActionHistoriesAPIClient, params *DescribeBudgetActionHistoriesInput, optFns ...func(*DescribeBudgetActionHistoriesPaginatorOptions)) *DescribeBudgetActionHistoriesPaginator { + options := DescribeBudgetActionHistoriesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeBudgetActionHistoriesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeBudgetActionHistoriesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeBudgetActionHistories page. +func (p *DescribeBudgetActionHistoriesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeBudgetActionHistoriesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeBudgetActionHistories(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeBudgetActionsForAccountAPIClient is a client that implements the +// DescribeBudgetActionsForAccount operation. +type DescribeBudgetActionsForAccountAPIClient interface { + DescribeBudgetActionsForAccount(context.Context, *DescribeBudgetActionsForAccountInput, ...func(*Options)) (*DescribeBudgetActionsForAccountOutput, error) +} + +var _ DescribeBudgetActionsForAccountAPIClient = (*Client)(nil) + +// DescribeBudgetActionsForAccountPaginatorOptions is the paginator options for +// DescribeBudgetActionsForAccount +type DescribeBudgetActionsForAccountPaginatorOptions struct { + // An integer that represents how many entries a paginated response contains. The + // maximum is 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeBudgetActionsForAccountPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/budgets.DescribeBudgetActionsForAccount +type DescribeBudgetActionsForAccountPaginator struct { + options DescribeBudgetActionsForAccountPaginatorOptions + client DescribeBudgetActionsForAccountAPIClient + params *DescribeBudgetActionsForAccountInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeBudgetActionsForAccountPaginator returns a new +// DescribeBudgetActionsForAccountPaginator +func NewDescribeBudgetActionsForAccountPaginator(client DescribeBudgetActionsForAccountAPIClient, params *DescribeBudgetActionsForAccountInput, optFns ...func(*DescribeBudgetActionsForAccountPaginatorOptions)) *DescribeBudgetActionsForAccountPaginator { + options := DescribeBudgetActionsForAccountPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeBudgetActionsForAccountPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeBudgetActionsForAccountPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeBudgetActionsForAccount page. +func (p *DescribeBudgetActionsForAccountPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeBudgetActionsForAccountOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeBudgetActionsForAccount(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeNotificationsForBudgetAPIClient is a client that implements the +// DescribeNotificationsForBudget operation. +type DescribeNotificationsForBudgetAPIClient interface { + DescribeNotificationsForBudget(context.Context, *DescribeNotificationsForBudgetInput, ...func(*Options)) (*DescribeNotificationsForBudgetOutput, error) +} + +var _ DescribeNotificationsForBudgetAPIClient = (*Client)(nil) + +// DescribeNotificationsForBudgetPaginatorOptions is the paginator options for +// DescribeNotificationsForBudget +type DescribeNotificationsForBudgetPaginatorOptions struct { + // An optional integer that represents how many entries a paginated response + // contains. The maximum is 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeNotificationsForBudgetPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/budgets.DescribeNotificationsForBudget +type DescribeNotificationsForBudgetPaginator struct { + options DescribeNotificationsForBudgetPaginatorOptions + client DescribeNotificationsForBudgetAPIClient + params *DescribeNotificationsForBudgetInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeNotificationsForBudgetPaginator returns a new +// DescribeNotificationsForBudgetPaginator +func NewDescribeNotificationsForBudgetPaginator(client DescribeNotificationsForBudgetAPIClient, params *DescribeNotificationsForBudgetInput, optFns ...func(*DescribeNotificationsForBudgetPaginatorOptions)) *DescribeNotificationsForBudgetPaginator { + options := DescribeNotificationsForBudgetPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeNotificationsForBudgetPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeNotificationsForBudgetPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeNotificationsForBudget page. +func (p *DescribeNotificationsForBudgetPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeNotificationsForBudgetOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeNotificationsForBudget(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/chime/go.sum b/service/chime/go.sum index c669e324b14..32595049f96 100644 --- a/service/chime/go.sum +++ b/service/chime/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/chime/paginators.go b/service/chime/paginators.go new file mode 100644 index 00000000000..be50e47a3cc --- /dev/null +++ b/service/chime/paginators.go @@ -0,0 +1,907 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chime + +import ( + "context" + "fmt" +) + +// ListUsersAPIClient is a client that implements the ListUsers operation. +type ListUsersAPIClient interface { + ListUsers(context.Context, *ListUsersInput, ...func(*Options)) (*ListUsersOutput, error) +} + +var _ ListUsersAPIClient = (*Client)(nil) + +// ListUsersPaginatorOptions is the paginator options for ListUsers +type ListUsersPaginatorOptions struct { + // The maximum number of results to return in a single call. Defaults to 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListUsersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/chime.ListUsers +type ListUsersPaginator struct { + options ListUsersPaginatorOptions + client ListUsersAPIClient + params *ListUsersInput + nextToken *string + firstPage bool + done bool +} + +// NewListUsersPaginator returns a new ListUsersPaginator +func NewListUsersPaginator(client ListUsersAPIClient, params *ListUsersInput, optFns ...func(*ListUsersPaginatorOptions)) *ListUsersPaginator { + options := ListUsersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListUsersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListUsersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListUsers page. +func (p *ListUsersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListUsersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListUsers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListVoiceConnectorsAPIClient is a client that implements the ListVoiceConnectors +// operation. +type ListVoiceConnectorsAPIClient interface { + ListVoiceConnectors(context.Context, *ListVoiceConnectorsInput, ...func(*Options)) (*ListVoiceConnectorsOutput, error) +} + +var _ ListVoiceConnectorsAPIClient = (*Client)(nil) + +// ListVoiceConnectorsPaginatorOptions is the paginator options for +// ListVoiceConnectors +type ListVoiceConnectorsPaginatorOptions struct { + // The maximum number of results to return in a single call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListVoiceConnectorsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/chime.ListVoiceConnectors +type ListVoiceConnectorsPaginator struct { + options ListVoiceConnectorsPaginatorOptions + client ListVoiceConnectorsAPIClient + params *ListVoiceConnectorsInput + nextToken *string + firstPage bool + done bool +} + +// NewListVoiceConnectorsPaginator returns a new ListVoiceConnectorsPaginator +func NewListVoiceConnectorsPaginator(client ListVoiceConnectorsAPIClient, params *ListVoiceConnectorsInput, optFns ...func(*ListVoiceConnectorsPaginatorOptions)) *ListVoiceConnectorsPaginator { + options := ListVoiceConnectorsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListVoiceConnectorsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListVoiceConnectorsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListVoiceConnectors page. +func (p *ListVoiceConnectorsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListVoiceConnectorsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListVoiceConnectors(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListAccountsAPIClient is a client that implements the ListAccounts operation. +type ListAccountsAPIClient interface { + ListAccounts(context.Context, *ListAccountsInput, ...func(*Options)) (*ListAccountsOutput, error) +} + +var _ ListAccountsAPIClient = (*Client)(nil) + +// ListAccountsPaginatorOptions is the paginator options for ListAccounts +type ListAccountsPaginatorOptions struct { + // The maximum number of results to return in a single call. Defaults to 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAccountsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/chime.ListAccounts +type ListAccountsPaginator struct { + options ListAccountsPaginatorOptions + client ListAccountsAPIClient + params *ListAccountsInput + nextToken *string + firstPage bool + done bool +} + +// NewListAccountsPaginator returns a new ListAccountsPaginator +func NewListAccountsPaginator(client ListAccountsAPIClient, params *ListAccountsInput, optFns ...func(*ListAccountsPaginatorOptions)) *ListAccountsPaginator { + options := ListAccountsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAccountsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAccountsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAccounts page. +func (p *ListAccountsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccountsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListAccounts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListPhoneNumberOrdersAPIClient is a client that implements the +// ListPhoneNumberOrders operation. +type ListPhoneNumberOrdersAPIClient interface { + ListPhoneNumberOrders(context.Context, *ListPhoneNumberOrdersInput, ...func(*Options)) (*ListPhoneNumberOrdersOutput, error) +} + +var _ ListPhoneNumberOrdersAPIClient = (*Client)(nil) + +// ListPhoneNumberOrdersPaginatorOptions is the paginator options for +// ListPhoneNumberOrders +type ListPhoneNumberOrdersPaginatorOptions struct { + // The maximum number of results to return in a single call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListPhoneNumberOrdersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/chime.ListPhoneNumberOrders +type ListPhoneNumberOrdersPaginator struct { + options ListPhoneNumberOrdersPaginatorOptions + client ListPhoneNumberOrdersAPIClient + params *ListPhoneNumberOrdersInput + nextToken *string + firstPage bool + done bool +} + +// NewListPhoneNumberOrdersPaginator returns a new ListPhoneNumberOrdersPaginator +func NewListPhoneNumberOrdersPaginator(client ListPhoneNumberOrdersAPIClient, params *ListPhoneNumberOrdersInput, optFns ...func(*ListPhoneNumberOrdersPaginatorOptions)) *ListPhoneNumberOrdersPaginator { + options := ListPhoneNumberOrdersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListPhoneNumberOrdersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPhoneNumberOrdersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListPhoneNumberOrders page. +func (p *ListPhoneNumberOrdersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPhoneNumberOrdersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListPhoneNumberOrders(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListAttendeesAPIClient is a client that implements the ListAttendees operation. +type ListAttendeesAPIClient interface { + ListAttendees(context.Context, *ListAttendeesInput, ...func(*Options)) (*ListAttendeesOutput, error) +} + +var _ ListAttendeesAPIClient = (*Client)(nil) + +// ListAttendeesPaginatorOptions is the paginator options for ListAttendees +type ListAttendeesPaginatorOptions struct { + // The maximum number of results to return in a single call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAttendeesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/chime.ListAttendees +type ListAttendeesPaginator struct { + options ListAttendeesPaginatorOptions + client ListAttendeesAPIClient + params *ListAttendeesInput + nextToken *string + firstPage bool + done bool +} + +// NewListAttendeesPaginator returns a new ListAttendeesPaginator +func NewListAttendeesPaginator(client ListAttendeesAPIClient, params *ListAttendeesInput, optFns ...func(*ListAttendeesPaginatorOptions)) *ListAttendeesPaginator { + options := ListAttendeesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAttendeesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAttendeesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAttendees page. +func (p *ListAttendeesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAttendeesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListAttendees(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListPhoneNumbersAPIClient is a client that implements the ListPhoneNumbers +// operation. +type ListPhoneNumbersAPIClient interface { + ListPhoneNumbers(context.Context, *ListPhoneNumbersInput, ...func(*Options)) (*ListPhoneNumbersOutput, error) +} + +var _ ListPhoneNumbersAPIClient = (*Client)(nil) + +// ListPhoneNumbersPaginatorOptions is the paginator options for ListPhoneNumbers +type ListPhoneNumbersPaginatorOptions struct { + // The maximum number of results to return in a single call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListPhoneNumbersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/chime.ListPhoneNumbers +type ListPhoneNumbersPaginator struct { + options ListPhoneNumbersPaginatorOptions + client ListPhoneNumbersAPIClient + params *ListPhoneNumbersInput + nextToken *string + firstPage bool + done bool +} + +// NewListPhoneNumbersPaginator returns a new ListPhoneNumbersPaginator +func NewListPhoneNumbersPaginator(client ListPhoneNumbersAPIClient, params *ListPhoneNumbersInput, optFns ...func(*ListPhoneNumbersPaginatorOptions)) *ListPhoneNumbersPaginator { + options := ListPhoneNumbersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListPhoneNumbersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPhoneNumbersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListPhoneNumbers page. +func (p *ListPhoneNumbersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPhoneNumbersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListPhoneNumbers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListRoomMembershipsAPIClient is a client that implements the ListRoomMemberships +// operation. +type ListRoomMembershipsAPIClient interface { + ListRoomMemberships(context.Context, *ListRoomMembershipsInput, ...func(*Options)) (*ListRoomMembershipsOutput, error) +} + +var _ ListRoomMembershipsAPIClient = (*Client)(nil) + +// ListRoomMembershipsPaginatorOptions is the paginator options for +// ListRoomMemberships +type ListRoomMembershipsPaginatorOptions struct { + // The maximum number of results to return in a single call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListRoomMembershipsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/chime.ListRoomMemberships +type ListRoomMembershipsPaginator struct { + options ListRoomMembershipsPaginatorOptions + client ListRoomMembershipsAPIClient + params *ListRoomMembershipsInput + nextToken *string + firstPage bool + done bool +} + +// NewListRoomMembershipsPaginator returns a new ListRoomMembershipsPaginator +func NewListRoomMembershipsPaginator(client ListRoomMembershipsAPIClient, params *ListRoomMembershipsInput, optFns ...func(*ListRoomMembershipsPaginatorOptions)) *ListRoomMembershipsPaginator { + options := ListRoomMembershipsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListRoomMembershipsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRoomMembershipsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListRoomMemberships page. +func (p *ListRoomMembershipsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRoomMembershipsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListRoomMemberships(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListProxySessionsAPIClient is a client that implements the ListProxySessions +// operation. +type ListProxySessionsAPIClient interface { + ListProxySessions(context.Context, *ListProxySessionsInput, ...func(*Options)) (*ListProxySessionsOutput, error) +} + +var _ ListProxySessionsAPIClient = (*Client)(nil) + +// ListProxySessionsPaginatorOptions is the paginator options for ListProxySessions +type ListProxySessionsPaginatorOptions struct { + // The maximum number of results to return in a single call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListProxySessionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/chime.ListProxySessions +type ListProxySessionsPaginator struct { + options ListProxySessionsPaginatorOptions + client ListProxySessionsAPIClient + params *ListProxySessionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListProxySessionsPaginator returns a new ListProxySessionsPaginator +func NewListProxySessionsPaginator(client ListProxySessionsAPIClient, params *ListProxySessionsInput, optFns ...func(*ListProxySessionsPaginatorOptions)) *ListProxySessionsPaginator { + options := ListProxySessionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListProxySessionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListProxySessionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListProxySessions page. +func (p *ListProxySessionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProxySessionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListProxySessions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListVoiceConnectorGroupsAPIClient is a client that implements the +// ListVoiceConnectorGroups operation. +type ListVoiceConnectorGroupsAPIClient interface { + ListVoiceConnectorGroups(context.Context, *ListVoiceConnectorGroupsInput, ...func(*Options)) (*ListVoiceConnectorGroupsOutput, error) +} + +var _ ListVoiceConnectorGroupsAPIClient = (*Client)(nil) + +// ListVoiceConnectorGroupsPaginatorOptions is the paginator options for +// ListVoiceConnectorGroups +type ListVoiceConnectorGroupsPaginatorOptions struct { + // The maximum number of results to return in a single call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListVoiceConnectorGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/chime.ListVoiceConnectorGroups +type ListVoiceConnectorGroupsPaginator struct { + options ListVoiceConnectorGroupsPaginatorOptions + client ListVoiceConnectorGroupsAPIClient + params *ListVoiceConnectorGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewListVoiceConnectorGroupsPaginator returns a new +// ListVoiceConnectorGroupsPaginator +func NewListVoiceConnectorGroupsPaginator(client ListVoiceConnectorGroupsAPIClient, params *ListVoiceConnectorGroupsInput, optFns ...func(*ListVoiceConnectorGroupsPaginatorOptions)) *ListVoiceConnectorGroupsPaginator { + options := ListVoiceConnectorGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListVoiceConnectorGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListVoiceConnectorGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListVoiceConnectorGroups page. +func (p *ListVoiceConnectorGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListVoiceConnectorGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListVoiceConnectorGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListMeetingsAPIClient is a client that implements the ListMeetings operation. +type ListMeetingsAPIClient interface { + ListMeetings(context.Context, *ListMeetingsInput, ...func(*Options)) (*ListMeetingsOutput, error) +} + +var _ ListMeetingsAPIClient = (*Client)(nil) + +// ListMeetingsPaginatorOptions is the paginator options for ListMeetings +type ListMeetingsPaginatorOptions struct { + // The maximum number of results to return in a single call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListMeetingsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/chime.ListMeetings +type ListMeetingsPaginator struct { + options ListMeetingsPaginatorOptions + client ListMeetingsAPIClient + params *ListMeetingsInput + nextToken *string + firstPage bool + done bool +} + +// NewListMeetingsPaginator returns a new ListMeetingsPaginator +func NewListMeetingsPaginator(client ListMeetingsAPIClient, params *ListMeetingsInput, optFns ...func(*ListMeetingsPaginatorOptions)) *ListMeetingsPaginator { + options := ListMeetingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListMeetingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMeetingsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListMeetings page. +func (p *ListMeetingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMeetingsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListMeetings(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListRoomsAPIClient is a client that implements the ListRooms operation. +type ListRoomsAPIClient interface { + ListRooms(context.Context, *ListRoomsInput, ...func(*Options)) (*ListRoomsOutput, error) +} + +var _ ListRoomsAPIClient = (*Client)(nil) + +// ListRoomsPaginatorOptions is the paginator options for ListRooms +type ListRoomsPaginatorOptions struct { + // The maximum number of results to return in a single call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListRoomsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/chime.ListRooms +type ListRoomsPaginator struct { + options ListRoomsPaginatorOptions + client ListRoomsAPIClient + params *ListRoomsInput + nextToken *string + firstPage bool + done bool +} + +// NewListRoomsPaginator returns a new ListRoomsPaginator +func NewListRoomsPaginator(client ListRoomsAPIClient, params *ListRoomsInput, optFns ...func(*ListRoomsPaginatorOptions)) *ListRoomsPaginator { + options := ListRoomsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListRoomsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRoomsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListRooms page. +func (p *ListRoomsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRoomsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListRooms(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListBotsAPIClient is a client that implements the ListBots operation. +type ListBotsAPIClient interface { + ListBots(context.Context, *ListBotsInput, ...func(*Options)) (*ListBotsOutput, error) +} + +var _ ListBotsAPIClient = (*Client)(nil) + +// ListBotsPaginatorOptions is the paginator options for ListBots +type ListBotsPaginatorOptions struct { + // The maximum number of results to return in a single call. The default is 10. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListBotsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/chime.ListBots +type ListBotsPaginator struct { + options ListBotsPaginatorOptions + client ListBotsAPIClient + params *ListBotsInput + nextToken *string + firstPage bool + done bool +} + +// NewListBotsPaginator returns a new ListBotsPaginator +func NewListBotsPaginator(client ListBotsAPIClient, params *ListBotsInput, optFns ...func(*ListBotsPaginatorOptions)) *ListBotsPaginator { + options := ListBotsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListBotsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListBotsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListBots page. +func (p *ListBotsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBotsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListBots(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/cloud9/go.sum b/service/cloud9/go.sum index c669e324b14..32595049f96 100644 --- a/service/cloud9/go.sum +++ b/service/cloud9/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/cloud9/paginators.go b/service/cloud9/paginators.go new file mode 100644 index 00000000000..6951591fd68 --- /dev/null +++ b/service/cloud9/paginators.go @@ -0,0 +1,160 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloud9 + +import ( + "context" + "fmt" +) + +// ListEnvironmentsAPIClient is a client that implements the ListEnvironments +// operation. +type ListEnvironmentsAPIClient interface { + ListEnvironments(context.Context, *ListEnvironmentsInput, ...func(*Options)) (*ListEnvironmentsOutput, error) +} + +var _ ListEnvironmentsAPIClient = (*Client)(nil) + +// ListEnvironmentsPaginatorOptions is the paginator options for ListEnvironments +type ListEnvironmentsPaginatorOptions struct { + // The maximum number of environments to get identifiers for. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListEnvironmentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloud9.ListEnvironments +type ListEnvironmentsPaginator struct { + options ListEnvironmentsPaginatorOptions + client ListEnvironmentsAPIClient + params *ListEnvironmentsInput + nextToken *string + firstPage bool + done bool +} + +// NewListEnvironmentsPaginator returns a new ListEnvironmentsPaginator +func NewListEnvironmentsPaginator(client ListEnvironmentsAPIClient, params *ListEnvironmentsInput, optFns ...func(*ListEnvironmentsPaginatorOptions)) *ListEnvironmentsPaginator { + options := ListEnvironmentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListEnvironmentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListEnvironmentsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListEnvironments page. +func (p *ListEnvironmentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEnvironmentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListEnvironments(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeEnvironmentMembershipsAPIClient is a client that implements the +// DescribeEnvironmentMemberships operation. +type DescribeEnvironmentMembershipsAPIClient interface { + DescribeEnvironmentMemberships(context.Context, *DescribeEnvironmentMembershipsInput, ...func(*Options)) (*DescribeEnvironmentMembershipsOutput, error) +} + +var _ DescribeEnvironmentMembershipsAPIClient = (*Client)(nil) + +// DescribeEnvironmentMembershipsPaginatorOptions is the paginator options for +// DescribeEnvironmentMemberships +type DescribeEnvironmentMembershipsPaginatorOptions struct { + // The maximum number of environment members to get information about. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeEnvironmentMembershipsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloud9.DescribeEnvironmentMemberships +type DescribeEnvironmentMembershipsPaginator struct { + options DescribeEnvironmentMembershipsPaginatorOptions + client DescribeEnvironmentMembershipsAPIClient + params *DescribeEnvironmentMembershipsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeEnvironmentMembershipsPaginator returns a new +// DescribeEnvironmentMembershipsPaginator +func NewDescribeEnvironmentMembershipsPaginator(client DescribeEnvironmentMembershipsAPIClient, params *DescribeEnvironmentMembershipsInput, optFns ...func(*DescribeEnvironmentMembershipsPaginatorOptions)) *DescribeEnvironmentMembershipsPaginator { + options := DescribeEnvironmentMembershipsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeEnvironmentMembershipsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEnvironmentMembershipsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeEnvironmentMemberships page. +func (p *DescribeEnvironmentMembershipsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEnvironmentMembershipsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeEnvironmentMemberships(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/clouddirectory/go.sum b/service/clouddirectory/go.sum index c669e324b14..32595049f96 100644 --- a/service/clouddirectory/go.sum +++ b/service/clouddirectory/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/clouddirectory/paginators.go b/service/clouddirectory/paginators.go new file mode 100644 index 00000000000..973bc923e10 --- /dev/null +++ b/service/clouddirectory/paginators.go @@ -0,0 +1,1459 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package clouddirectory + +import ( + "context" + "fmt" +) + +// LookupPolicyAPIClient is a client that implements the LookupPolicy operation. +type LookupPolicyAPIClient interface { + LookupPolicy(context.Context, *LookupPolicyInput, ...func(*Options)) (*LookupPolicyOutput, error) +} + +var _ LookupPolicyAPIClient = (*Client)(nil) + +// LookupPolicyPaginatorOptions is the paginator options for LookupPolicy +type LookupPolicyPaginatorOptions struct { + // The maximum number of items to be retrieved in a single call. This is an + // approximate number. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// LookupPolicyPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/clouddirectory.LookupPolicy +type LookupPolicyPaginator struct { + options LookupPolicyPaginatorOptions + client LookupPolicyAPIClient + params *LookupPolicyInput + nextToken *string + firstPage bool + done bool +} + +// NewLookupPolicyPaginator returns a new LookupPolicyPaginator +func NewLookupPolicyPaginator(client LookupPolicyAPIClient, params *LookupPolicyInput, optFns ...func(*LookupPolicyPaginatorOptions)) *LookupPolicyPaginator { + options := LookupPolicyPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &LookupPolicyPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *LookupPolicyPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next LookupPolicy page. +func (p *LookupPolicyPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*LookupPolicyOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.LookupPolicy(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDirectoriesAPIClient is a client that implements the ListDirectories +// operation. +type ListDirectoriesAPIClient interface { + ListDirectories(context.Context, *ListDirectoriesInput, ...func(*Options)) (*ListDirectoriesOutput, error) +} + +var _ ListDirectoriesAPIClient = (*Client)(nil) + +// ListDirectoriesPaginatorOptions is the paginator options for ListDirectories +type ListDirectoriesPaginatorOptions struct { + // The maximum number of results to retrieve. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDirectoriesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/clouddirectory.ListDirectories +type ListDirectoriesPaginator struct { + options ListDirectoriesPaginatorOptions + client ListDirectoriesAPIClient + params *ListDirectoriesInput + nextToken *string + firstPage bool + done bool +} + +// NewListDirectoriesPaginator returns a new ListDirectoriesPaginator +func NewListDirectoriesPaginator(client ListDirectoriesAPIClient, params *ListDirectoriesInput, optFns ...func(*ListDirectoriesPaginatorOptions)) *ListDirectoriesPaginator { + options := ListDirectoriesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDirectoriesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDirectoriesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDirectories page. +func (p *ListDirectoriesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDirectoriesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListDirectories(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTypedLinkFacetAttributesAPIClient is a client that implements the +// ListTypedLinkFacetAttributes operation. +type ListTypedLinkFacetAttributesAPIClient interface { + ListTypedLinkFacetAttributes(context.Context, *ListTypedLinkFacetAttributesInput, ...func(*Options)) (*ListTypedLinkFacetAttributesOutput, error) +} + +var _ ListTypedLinkFacetAttributesAPIClient = (*Client)(nil) + +// ListTypedLinkFacetAttributesPaginatorOptions is the paginator options for +// ListTypedLinkFacetAttributes +type ListTypedLinkFacetAttributesPaginatorOptions struct { + // The maximum number of results to retrieve. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTypedLinkFacetAttributesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/clouddirectory.ListTypedLinkFacetAttributes +type ListTypedLinkFacetAttributesPaginator struct { + options ListTypedLinkFacetAttributesPaginatorOptions + client ListTypedLinkFacetAttributesAPIClient + params *ListTypedLinkFacetAttributesInput + nextToken *string + firstPage bool + done bool +} + +// NewListTypedLinkFacetAttributesPaginator returns a new +// ListTypedLinkFacetAttributesPaginator +func NewListTypedLinkFacetAttributesPaginator(client ListTypedLinkFacetAttributesAPIClient, params *ListTypedLinkFacetAttributesInput, optFns ...func(*ListTypedLinkFacetAttributesPaginatorOptions)) *ListTypedLinkFacetAttributesPaginator { + options := ListTypedLinkFacetAttributesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTypedLinkFacetAttributesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTypedLinkFacetAttributesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTypedLinkFacetAttributes page. +func (p *ListTypedLinkFacetAttributesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTypedLinkFacetAttributesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListTypedLinkFacetAttributes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListIndexAPIClient is a client that implements the ListIndex operation. +type ListIndexAPIClient interface { + ListIndex(context.Context, *ListIndexInput, ...func(*Options)) (*ListIndexOutput, error) +} + +var _ ListIndexAPIClient = (*Client)(nil) + +// ListIndexPaginatorOptions is the paginator options for ListIndex +type ListIndexPaginatorOptions struct { + // The maximum number of objects in a single page to retrieve from the index during + // a request. For more information, see Amazon Cloud Directory Limits + // (http://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html). + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListIndexPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/clouddirectory.ListIndex +type ListIndexPaginator struct { + options ListIndexPaginatorOptions + client ListIndexAPIClient + params *ListIndexInput + nextToken *string + firstPage bool + done bool +} + +// NewListIndexPaginator returns a new ListIndexPaginator +func NewListIndexPaginator(client ListIndexAPIClient, params *ListIndexInput, optFns ...func(*ListIndexPaginatorOptions)) *ListIndexPaginator { + options := ListIndexPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListIndexPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListIndexPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListIndex page. +func (p *ListIndexPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListIndexOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListIndex(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListObjectPoliciesAPIClient is a client that implements the ListObjectPolicies +// operation. +type ListObjectPoliciesAPIClient interface { + ListObjectPolicies(context.Context, *ListObjectPoliciesInput, ...func(*Options)) (*ListObjectPoliciesOutput, error) +} + +var _ ListObjectPoliciesAPIClient = (*Client)(nil) + +// ListObjectPoliciesPaginatorOptions is the paginator options for +// ListObjectPolicies +type ListObjectPoliciesPaginatorOptions struct { + // The maximum number of items to be retrieved in a single call. This is an + // approximate number. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListObjectPoliciesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/clouddirectory.ListObjectPolicies +type ListObjectPoliciesPaginator struct { + options ListObjectPoliciesPaginatorOptions + client ListObjectPoliciesAPIClient + params *ListObjectPoliciesInput + nextToken *string + firstPage bool + done bool +} + +// NewListObjectPoliciesPaginator returns a new ListObjectPoliciesPaginator +func NewListObjectPoliciesPaginator(client ListObjectPoliciesAPIClient, params *ListObjectPoliciesInput, optFns ...func(*ListObjectPoliciesPaginatorOptions)) *ListObjectPoliciesPaginator { + options := ListObjectPoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListObjectPoliciesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListObjectPoliciesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListObjectPolicies page. +func (p *ListObjectPoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListObjectPoliciesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListObjectPolicies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTypedLinkFacetNamesAPIClient is a client that implements the +// ListTypedLinkFacetNames operation. +type ListTypedLinkFacetNamesAPIClient interface { + ListTypedLinkFacetNames(context.Context, *ListTypedLinkFacetNamesInput, ...func(*Options)) (*ListTypedLinkFacetNamesOutput, error) +} + +var _ ListTypedLinkFacetNamesAPIClient = (*Client)(nil) + +// ListTypedLinkFacetNamesPaginatorOptions is the paginator options for +// ListTypedLinkFacetNames +type ListTypedLinkFacetNamesPaginatorOptions struct { + // The maximum number of results to retrieve. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTypedLinkFacetNamesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/clouddirectory.ListTypedLinkFacetNames +type ListTypedLinkFacetNamesPaginator struct { + options ListTypedLinkFacetNamesPaginatorOptions + client ListTypedLinkFacetNamesAPIClient + params *ListTypedLinkFacetNamesInput + nextToken *string + firstPage bool + done bool +} + +// NewListTypedLinkFacetNamesPaginator returns a new +// ListTypedLinkFacetNamesPaginator +func NewListTypedLinkFacetNamesPaginator(client ListTypedLinkFacetNamesAPIClient, params *ListTypedLinkFacetNamesInput, optFns ...func(*ListTypedLinkFacetNamesPaginatorOptions)) *ListTypedLinkFacetNamesPaginator { + options := ListTypedLinkFacetNamesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTypedLinkFacetNamesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTypedLinkFacetNamesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTypedLinkFacetNames page. +func (p *ListTypedLinkFacetNamesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTypedLinkFacetNamesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListTypedLinkFacetNames(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListAttachedIndicesAPIClient is a client that implements the ListAttachedIndices +// operation. +type ListAttachedIndicesAPIClient interface { + ListAttachedIndices(context.Context, *ListAttachedIndicesInput, ...func(*Options)) (*ListAttachedIndicesOutput, error) +} + +var _ ListAttachedIndicesAPIClient = (*Client)(nil) + +// ListAttachedIndicesPaginatorOptions is the paginator options for +// ListAttachedIndices +type ListAttachedIndicesPaginatorOptions struct { + // The maximum number of results to retrieve. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAttachedIndicesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/clouddirectory.ListAttachedIndices +type ListAttachedIndicesPaginator struct { + options ListAttachedIndicesPaginatorOptions + client ListAttachedIndicesAPIClient + params *ListAttachedIndicesInput + nextToken *string + firstPage bool + done bool +} + +// NewListAttachedIndicesPaginator returns a new ListAttachedIndicesPaginator +func NewListAttachedIndicesPaginator(client ListAttachedIndicesAPIClient, params *ListAttachedIndicesInput, optFns ...func(*ListAttachedIndicesPaginatorOptions)) *ListAttachedIndicesPaginator { + options := ListAttachedIndicesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAttachedIndicesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAttachedIndicesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAttachedIndices page. +func (p *ListAttachedIndicesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAttachedIndicesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListAttachedIndices(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListObjectParentPathsAPIClient is a client that implements the +// ListObjectParentPaths operation. +type ListObjectParentPathsAPIClient interface { + ListObjectParentPaths(context.Context, *ListObjectParentPathsInput, ...func(*Options)) (*ListObjectParentPathsOutput, error) +} + +var _ ListObjectParentPathsAPIClient = (*Client)(nil) + +// ListObjectParentPathsPaginatorOptions is the paginator options for +// ListObjectParentPaths +type ListObjectParentPathsPaginatorOptions struct { + // The maximum number of items to be retrieved in a single call. This is an + // approximate number. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListObjectParentPathsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/clouddirectory.ListObjectParentPaths +type ListObjectParentPathsPaginator struct { + options ListObjectParentPathsPaginatorOptions + client ListObjectParentPathsAPIClient + params *ListObjectParentPathsInput + nextToken *string + firstPage bool + done bool +} + +// NewListObjectParentPathsPaginator returns a new ListObjectParentPathsPaginator +func NewListObjectParentPathsPaginator(client ListObjectParentPathsAPIClient, params *ListObjectParentPathsInput, optFns ...func(*ListObjectParentPathsPaginatorOptions)) *ListObjectParentPathsPaginator { + options := ListObjectParentPathsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListObjectParentPathsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListObjectParentPathsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListObjectParentPaths page. +func (p *ListObjectParentPathsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListObjectParentPathsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListObjectParentPaths(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListFacetNamesAPIClient is a client that implements the ListFacetNames +// operation. +type ListFacetNamesAPIClient interface { + ListFacetNames(context.Context, *ListFacetNamesInput, ...func(*Options)) (*ListFacetNamesOutput, error) +} + +var _ ListFacetNamesAPIClient = (*Client)(nil) + +// ListFacetNamesPaginatorOptions is the paginator options for ListFacetNames +type ListFacetNamesPaginatorOptions struct { + // The maximum number of results to retrieve. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListFacetNamesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/clouddirectory.ListFacetNames +type ListFacetNamesPaginator struct { + options ListFacetNamesPaginatorOptions + client ListFacetNamesAPIClient + params *ListFacetNamesInput + nextToken *string + firstPage bool + done bool +} + +// NewListFacetNamesPaginator returns a new ListFacetNamesPaginator +func NewListFacetNamesPaginator(client ListFacetNamesAPIClient, params *ListFacetNamesInput, optFns ...func(*ListFacetNamesPaginatorOptions)) *ListFacetNamesPaginator { + options := ListFacetNamesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListFacetNamesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListFacetNamesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListFacetNames page. +func (p *ListFacetNamesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFacetNamesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListFacetNames(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListFacetAttributesAPIClient is a client that implements the ListFacetAttributes +// operation. +type ListFacetAttributesAPIClient interface { + ListFacetAttributes(context.Context, *ListFacetAttributesInput, ...func(*Options)) (*ListFacetAttributesOutput, error) +} + +var _ ListFacetAttributesAPIClient = (*Client)(nil) + +// ListFacetAttributesPaginatorOptions is the paginator options for +// ListFacetAttributes +type ListFacetAttributesPaginatorOptions struct { + // The maximum number of results to retrieve. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListFacetAttributesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/clouddirectory.ListFacetAttributes +type ListFacetAttributesPaginator struct { + options ListFacetAttributesPaginatorOptions + client ListFacetAttributesAPIClient + params *ListFacetAttributesInput + nextToken *string + firstPage bool + done bool +} + +// NewListFacetAttributesPaginator returns a new ListFacetAttributesPaginator +func NewListFacetAttributesPaginator(client ListFacetAttributesAPIClient, params *ListFacetAttributesInput, optFns ...func(*ListFacetAttributesPaginatorOptions)) *ListFacetAttributesPaginator { + options := ListFacetAttributesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListFacetAttributesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListFacetAttributesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListFacetAttributes page. +func (p *ListFacetAttributesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFacetAttributesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListFacetAttributes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListAppliedSchemaArnsAPIClient is a client that implements the +// ListAppliedSchemaArns operation. +type ListAppliedSchemaArnsAPIClient interface { + ListAppliedSchemaArns(context.Context, *ListAppliedSchemaArnsInput, ...func(*Options)) (*ListAppliedSchemaArnsOutput, error) +} + +var _ ListAppliedSchemaArnsAPIClient = (*Client)(nil) + +// ListAppliedSchemaArnsPaginatorOptions is the paginator options for +// ListAppliedSchemaArns +type ListAppliedSchemaArnsPaginatorOptions struct { + // The maximum number of results to retrieve. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAppliedSchemaArnsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/clouddirectory.ListAppliedSchemaArns +type ListAppliedSchemaArnsPaginator struct { + options ListAppliedSchemaArnsPaginatorOptions + client ListAppliedSchemaArnsAPIClient + params *ListAppliedSchemaArnsInput + nextToken *string + firstPage bool + done bool +} + +// NewListAppliedSchemaArnsPaginator returns a new ListAppliedSchemaArnsPaginator +func NewListAppliedSchemaArnsPaginator(client ListAppliedSchemaArnsAPIClient, params *ListAppliedSchemaArnsInput, optFns ...func(*ListAppliedSchemaArnsPaginatorOptions)) *ListAppliedSchemaArnsPaginator { + options := ListAppliedSchemaArnsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAppliedSchemaArnsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAppliedSchemaArnsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAppliedSchemaArns page. +func (p *ListAppliedSchemaArnsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAppliedSchemaArnsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListAppliedSchemaArns(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTagsForResourceAPIClient is a client that implements the ListTagsForResource +// operation. +type ListTagsForResourceAPIClient interface { + ListTagsForResource(context.Context, *ListTagsForResourceInput, ...func(*Options)) (*ListTagsForResourceOutput, error) +} + +var _ ListTagsForResourceAPIClient = (*Client)(nil) + +// ListTagsForResourcePaginatorOptions is the paginator options for +// ListTagsForResource +type ListTagsForResourcePaginatorOptions struct { + // The MaxResults parameter sets the maximum number of results returned in a single + // page. This is for future use and is not supported currently. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTagsForResourcePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/clouddirectory.ListTagsForResource +type ListTagsForResourcePaginator struct { + options ListTagsForResourcePaginatorOptions + client ListTagsForResourceAPIClient + params *ListTagsForResourceInput + nextToken *string + firstPage bool + done bool +} + +// NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator +func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator { + options := ListTagsForResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTagsForResourcePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTagsForResourcePaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTagsForResource page. +func (p *ListTagsForResourcePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListTagsForResource(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListPublishedSchemaArnsAPIClient is a client that implements the +// ListPublishedSchemaArns operation. +type ListPublishedSchemaArnsAPIClient interface { + ListPublishedSchemaArns(context.Context, *ListPublishedSchemaArnsInput, ...func(*Options)) (*ListPublishedSchemaArnsOutput, error) +} + +var _ ListPublishedSchemaArnsAPIClient = (*Client)(nil) + +// ListPublishedSchemaArnsPaginatorOptions is the paginator options for +// ListPublishedSchemaArns +type ListPublishedSchemaArnsPaginatorOptions struct { + // The maximum number of results to retrieve. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListPublishedSchemaArnsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/clouddirectory.ListPublishedSchemaArns +type ListPublishedSchemaArnsPaginator struct { + options ListPublishedSchemaArnsPaginatorOptions + client ListPublishedSchemaArnsAPIClient + params *ListPublishedSchemaArnsInput + nextToken *string + firstPage bool + done bool +} + +// NewListPublishedSchemaArnsPaginator returns a new +// ListPublishedSchemaArnsPaginator +func NewListPublishedSchemaArnsPaginator(client ListPublishedSchemaArnsAPIClient, params *ListPublishedSchemaArnsInput, optFns ...func(*ListPublishedSchemaArnsPaginatorOptions)) *ListPublishedSchemaArnsPaginator { + options := ListPublishedSchemaArnsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListPublishedSchemaArnsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPublishedSchemaArnsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListPublishedSchemaArns page. +func (p *ListPublishedSchemaArnsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPublishedSchemaArnsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListPublishedSchemaArns(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDevelopmentSchemaArnsAPIClient is a client that implements the +// ListDevelopmentSchemaArns operation. +type ListDevelopmentSchemaArnsAPIClient interface { + ListDevelopmentSchemaArns(context.Context, *ListDevelopmentSchemaArnsInput, ...func(*Options)) (*ListDevelopmentSchemaArnsOutput, error) +} + +var _ ListDevelopmentSchemaArnsAPIClient = (*Client)(nil) + +// ListDevelopmentSchemaArnsPaginatorOptions is the paginator options for +// ListDevelopmentSchemaArns +type ListDevelopmentSchemaArnsPaginatorOptions struct { + // The maximum number of results to retrieve. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDevelopmentSchemaArnsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/clouddirectory.ListDevelopmentSchemaArns +type ListDevelopmentSchemaArnsPaginator struct { + options ListDevelopmentSchemaArnsPaginatorOptions + client ListDevelopmentSchemaArnsAPIClient + params *ListDevelopmentSchemaArnsInput + nextToken *string + firstPage bool + done bool +} + +// NewListDevelopmentSchemaArnsPaginator returns a new +// ListDevelopmentSchemaArnsPaginator +func NewListDevelopmentSchemaArnsPaginator(client ListDevelopmentSchemaArnsAPIClient, params *ListDevelopmentSchemaArnsInput, optFns ...func(*ListDevelopmentSchemaArnsPaginatorOptions)) *ListDevelopmentSchemaArnsPaginator { + options := ListDevelopmentSchemaArnsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDevelopmentSchemaArnsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDevelopmentSchemaArnsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDevelopmentSchemaArns page. +func (p *ListDevelopmentSchemaArnsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDevelopmentSchemaArnsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListDevelopmentSchemaArns(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListObjectChildrenAPIClient is a client that implements the ListObjectChildren +// operation. +type ListObjectChildrenAPIClient interface { + ListObjectChildren(context.Context, *ListObjectChildrenInput, ...func(*Options)) (*ListObjectChildrenOutput, error) +} + +var _ ListObjectChildrenAPIClient = (*Client)(nil) + +// ListObjectChildrenPaginatorOptions is the paginator options for +// ListObjectChildren +type ListObjectChildrenPaginatorOptions struct { + // The maximum number of items to be retrieved in a single call. This is an + // approximate number. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListObjectChildrenPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/clouddirectory.ListObjectChildren +type ListObjectChildrenPaginator struct { + options ListObjectChildrenPaginatorOptions + client ListObjectChildrenAPIClient + params *ListObjectChildrenInput + nextToken *string + firstPage bool + done bool +} + +// NewListObjectChildrenPaginator returns a new ListObjectChildrenPaginator +func NewListObjectChildrenPaginator(client ListObjectChildrenAPIClient, params *ListObjectChildrenInput, optFns ...func(*ListObjectChildrenPaginatorOptions)) *ListObjectChildrenPaginator { + options := ListObjectChildrenPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListObjectChildrenPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListObjectChildrenPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListObjectChildren page. +func (p *ListObjectChildrenPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListObjectChildrenOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListObjectChildren(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListManagedSchemaArnsAPIClient is a client that implements the +// ListManagedSchemaArns operation. +type ListManagedSchemaArnsAPIClient interface { + ListManagedSchemaArns(context.Context, *ListManagedSchemaArnsInput, ...func(*Options)) (*ListManagedSchemaArnsOutput, error) +} + +var _ ListManagedSchemaArnsAPIClient = (*Client)(nil) + +// ListManagedSchemaArnsPaginatorOptions is the paginator options for +// ListManagedSchemaArns +type ListManagedSchemaArnsPaginatorOptions struct { + // The maximum number of results to retrieve. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListManagedSchemaArnsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/clouddirectory.ListManagedSchemaArns +type ListManagedSchemaArnsPaginator struct { + options ListManagedSchemaArnsPaginatorOptions + client ListManagedSchemaArnsAPIClient + params *ListManagedSchemaArnsInput + nextToken *string + firstPage bool + done bool +} + +// NewListManagedSchemaArnsPaginator returns a new ListManagedSchemaArnsPaginator +func NewListManagedSchemaArnsPaginator(client ListManagedSchemaArnsAPIClient, params *ListManagedSchemaArnsInput, optFns ...func(*ListManagedSchemaArnsPaginatorOptions)) *ListManagedSchemaArnsPaginator { + options := ListManagedSchemaArnsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListManagedSchemaArnsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListManagedSchemaArnsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListManagedSchemaArns page. +func (p *ListManagedSchemaArnsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListManagedSchemaArnsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListManagedSchemaArns(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListObjectAttributesAPIClient is a client that implements the +// ListObjectAttributes operation. +type ListObjectAttributesAPIClient interface { + ListObjectAttributes(context.Context, *ListObjectAttributesInput, ...func(*Options)) (*ListObjectAttributesOutput, error) +} + +var _ ListObjectAttributesAPIClient = (*Client)(nil) + +// ListObjectAttributesPaginatorOptions is the paginator options for +// ListObjectAttributes +type ListObjectAttributesPaginatorOptions struct { + // The maximum number of items to be retrieved in a single call. This is an + // approximate number. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListObjectAttributesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/clouddirectory.ListObjectAttributes +type ListObjectAttributesPaginator struct { + options ListObjectAttributesPaginatorOptions + client ListObjectAttributesAPIClient + params *ListObjectAttributesInput + nextToken *string + firstPage bool + done bool +} + +// NewListObjectAttributesPaginator returns a new ListObjectAttributesPaginator +func NewListObjectAttributesPaginator(client ListObjectAttributesAPIClient, params *ListObjectAttributesInput, optFns ...func(*ListObjectAttributesPaginatorOptions)) *ListObjectAttributesPaginator { + options := ListObjectAttributesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListObjectAttributesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListObjectAttributesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListObjectAttributes page. +func (p *ListObjectAttributesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListObjectAttributesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListObjectAttributes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListObjectParentsAPIClient is a client that implements the ListObjectParents +// operation. +type ListObjectParentsAPIClient interface { + ListObjectParents(context.Context, *ListObjectParentsInput, ...func(*Options)) (*ListObjectParentsOutput, error) +} + +var _ ListObjectParentsAPIClient = (*Client)(nil) + +// ListObjectParentsPaginatorOptions is the paginator options for ListObjectParents +type ListObjectParentsPaginatorOptions struct { + // The maximum number of items to be retrieved in a single call. This is an + // approximate number. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListObjectParentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/clouddirectory.ListObjectParents +type ListObjectParentsPaginator struct { + options ListObjectParentsPaginatorOptions + client ListObjectParentsAPIClient + params *ListObjectParentsInput + nextToken *string + firstPage bool + done bool +} + +// NewListObjectParentsPaginator returns a new ListObjectParentsPaginator +func NewListObjectParentsPaginator(client ListObjectParentsAPIClient, params *ListObjectParentsInput, optFns ...func(*ListObjectParentsPaginatorOptions)) *ListObjectParentsPaginator { + options := ListObjectParentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListObjectParentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListObjectParentsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListObjectParents page. +func (p *ListObjectParentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListObjectParentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListObjectParents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListPolicyAttachmentsAPIClient is a client that implements the +// ListPolicyAttachments operation. +type ListPolicyAttachmentsAPIClient interface { + ListPolicyAttachments(context.Context, *ListPolicyAttachmentsInput, ...func(*Options)) (*ListPolicyAttachmentsOutput, error) +} + +var _ ListPolicyAttachmentsAPIClient = (*Client)(nil) + +// ListPolicyAttachmentsPaginatorOptions is the paginator options for +// ListPolicyAttachments +type ListPolicyAttachmentsPaginatorOptions struct { + // The maximum number of items to be retrieved in a single call. This is an + // approximate number. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListPolicyAttachmentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/clouddirectory.ListPolicyAttachments +type ListPolicyAttachmentsPaginator struct { + options ListPolicyAttachmentsPaginatorOptions + client ListPolicyAttachmentsAPIClient + params *ListPolicyAttachmentsInput + nextToken *string + firstPage bool + done bool +} + +// NewListPolicyAttachmentsPaginator returns a new ListPolicyAttachmentsPaginator +func NewListPolicyAttachmentsPaginator(client ListPolicyAttachmentsAPIClient, params *ListPolicyAttachmentsInput, optFns ...func(*ListPolicyAttachmentsPaginatorOptions)) *ListPolicyAttachmentsPaginator { + options := ListPolicyAttachmentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListPolicyAttachmentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPolicyAttachmentsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListPolicyAttachments page. +func (p *ListPolicyAttachmentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPolicyAttachmentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListPolicyAttachments(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/cloudformation/go.sum b/service/cloudformation/go.sum index c669e324b14..32595049f96 100644 --- a/service/cloudformation/go.sum +++ b/service/cloudformation/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/cloudformation/paginators.go b/service/cloudformation/paginators.go new file mode 100644 index 00000000000..9da90dcfd33 --- /dev/null +++ b/service/cloudformation/paginators.go @@ -0,0 +1,1205 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudformation + +import ( + "context" + "fmt" +) + +// DescribeAccountLimitsAPIClient is a client that implements the +// DescribeAccountLimits operation. +type DescribeAccountLimitsAPIClient interface { + DescribeAccountLimits(context.Context, *DescribeAccountLimitsInput, ...func(*Options)) (*DescribeAccountLimitsOutput, error) +} + +var _ DescribeAccountLimitsAPIClient = (*Client)(nil) + +// DescribeAccountLimitsPaginatorOptions is the paginator options for +// DescribeAccountLimits +type DescribeAccountLimitsPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeAccountLimitsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudformation.DescribeAccountLimits +type DescribeAccountLimitsPaginator struct { + options DescribeAccountLimitsPaginatorOptions + client DescribeAccountLimitsAPIClient + params *DescribeAccountLimitsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeAccountLimitsPaginator returns a new DescribeAccountLimitsPaginator +func NewDescribeAccountLimitsPaginator(client DescribeAccountLimitsAPIClient, params *DescribeAccountLimitsInput, optFns ...func(*DescribeAccountLimitsPaginatorOptions)) *DescribeAccountLimitsPaginator { + options := DescribeAccountLimitsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeAccountLimitsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeAccountLimitsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeAccountLimits page. +func (p *DescribeAccountLimitsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeAccountLimitsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.DescribeAccountLimits(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListStacksAPIClient is a client that implements the ListStacks operation. +type ListStacksAPIClient interface { + ListStacks(context.Context, *ListStacksInput, ...func(*Options)) (*ListStacksOutput, error) +} + +var _ ListStacksAPIClient = (*Client)(nil) + +// ListStacksPaginatorOptions is the paginator options for ListStacks +type ListStacksPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListStacksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudformation.ListStacks +type ListStacksPaginator struct { + options ListStacksPaginatorOptions + client ListStacksAPIClient + params *ListStacksInput + nextToken *string + firstPage bool + done bool +} + +// NewListStacksPaginator returns a new ListStacksPaginator +func NewListStacksPaginator(client ListStacksAPIClient, params *ListStacksInput, optFns ...func(*ListStacksPaginatorOptions)) *ListStacksPaginator { + options := ListStacksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListStacksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListStacksPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListStacks page. +func (p *ListStacksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListStacksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListStacks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeStacksAPIClient is a client that implements the DescribeStacks +// operation. +type DescribeStacksAPIClient interface { + DescribeStacks(context.Context, *DescribeStacksInput, ...func(*Options)) (*DescribeStacksOutput, error) +} + +var _ DescribeStacksAPIClient = (*Client)(nil) + +// DescribeStacksPaginatorOptions is the paginator options for DescribeStacks +type DescribeStacksPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeStacksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudformation.DescribeStacks +type DescribeStacksPaginator struct { + options DescribeStacksPaginatorOptions + client DescribeStacksAPIClient + params *DescribeStacksInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeStacksPaginator returns a new DescribeStacksPaginator +func NewDescribeStacksPaginator(client DescribeStacksAPIClient, params *DescribeStacksInput, optFns ...func(*DescribeStacksPaginatorOptions)) *DescribeStacksPaginator { + options := DescribeStacksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeStacksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeStacksPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeStacks page. +func (p *DescribeStacksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeStacksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.DescribeStacks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTypeVersionsAPIClient is a client that implements the ListTypeVersions +// operation. +type ListTypeVersionsAPIClient interface { + ListTypeVersions(context.Context, *ListTypeVersionsInput, ...func(*Options)) (*ListTypeVersionsOutput, error) +} + +var _ ListTypeVersionsAPIClient = (*Client)(nil) + +// ListTypeVersionsPaginatorOptions is the paginator options for ListTypeVersions +type ListTypeVersionsPaginatorOptions struct { + // The maximum number of results to be returned with a single call. If the number + // of available results exceeds this maximum, the response includes a NextToken + // value that you can assign to the NextToken request parameter to get the next set + // of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTypeVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudformation.ListTypeVersions +type ListTypeVersionsPaginator struct { + options ListTypeVersionsPaginatorOptions + client ListTypeVersionsAPIClient + params *ListTypeVersionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListTypeVersionsPaginator returns a new ListTypeVersionsPaginator +func NewListTypeVersionsPaginator(client ListTypeVersionsAPIClient, params *ListTypeVersionsInput, optFns ...func(*ListTypeVersionsPaginatorOptions)) *ListTypeVersionsPaginator { + options := ListTypeVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTypeVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTypeVersionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTypeVersions page. +func (p *ListTypeVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTypeVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListTypeVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeStackEventsAPIClient is a client that implements the DescribeStackEvents +// operation. +type DescribeStackEventsAPIClient interface { + DescribeStackEvents(context.Context, *DescribeStackEventsInput, ...func(*Options)) (*DescribeStackEventsOutput, error) +} + +var _ DescribeStackEventsAPIClient = (*Client)(nil) + +// DescribeStackEventsPaginatorOptions is the paginator options for +// DescribeStackEvents +type DescribeStackEventsPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeStackEventsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudformation.DescribeStackEvents +type DescribeStackEventsPaginator struct { + options DescribeStackEventsPaginatorOptions + client DescribeStackEventsAPIClient + params *DescribeStackEventsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeStackEventsPaginator returns a new DescribeStackEventsPaginator +func NewDescribeStackEventsPaginator(client DescribeStackEventsAPIClient, params *DescribeStackEventsInput, optFns ...func(*DescribeStackEventsPaginatorOptions)) *DescribeStackEventsPaginator { + options := DescribeStackEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeStackEventsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeStackEventsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeStackEvents page. +func (p *DescribeStackEventsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeStackEventsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.DescribeStackEvents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTypesAPIClient is a client that implements the ListTypes operation. +type ListTypesAPIClient interface { + ListTypes(context.Context, *ListTypesInput, ...func(*Options)) (*ListTypesOutput, error) +} + +var _ ListTypesAPIClient = (*Client)(nil) + +// ListTypesPaginatorOptions is the paginator options for ListTypes +type ListTypesPaginatorOptions struct { + // The maximum number of results to be returned with a single call. If the number + // of available results exceeds this maximum, the response includes a NextToken + // value that you can assign to the NextToken request parameter to get the next set + // of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTypesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudformation.ListTypes +type ListTypesPaginator struct { + options ListTypesPaginatorOptions + client ListTypesAPIClient + params *ListTypesInput + nextToken *string + firstPage bool + done bool +} + +// NewListTypesPaginator returns a new ListTypesPaginator +func NewListTypesPaginator(client ListTypesAPIClient, params *ListTypesInput, optFns ...func(*ListTypesPaginatorOptions)) *ListTypesPaginator { + options := ListTypesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTypesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTypesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTypes page. +func (p *ListTypesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTypesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListTypes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListStackSetsAPIClient is a client that implements the ListStackSets operation. +type ListStackSetsAPIClient interface { + ListStackSets(context.Context, *ListStackSetsInput, ...func(*Options)) (*ListStackSetsOutput, error) +} + +var _ ListStackSetsAPIClient = (*Client)(nil) + +// ListStackSetsPaginatorOptions is the paginator options for ListStackSets +type ListStackSetsPaginatorOptions struct { + // The maximum number of results to be returned with a single call. If the number + // of available results exceeds this maximum, the response includes a NextToken + // value that you can assign to the NextToken request parameter to get the next set + // of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListStackSetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudformation.ListStackSets +type ListStackSetsPaginator struct { + options ListStackSetsPaginatorOptions + client ListStackSetsAPIClient + params *ListStackSetsInput + nextToken *string + firstPage bool + done bool +} + +// NewListStackSetsPaginator returns a new ListStackSetsPaginator +func NewListStackSetsPaginator(client ListStackSetsAPIClient, params *ListStackSetsInput, optFns ...func(*ListStackSetsPaginatorOptions)) *ListStackSetsPaginator { + options := ListStackSetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListStackSetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListStackSetsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListStackSets page. +func (p *ListStackSetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListStackSetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListStackSets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListImportsAPIClient is a client that implements the ListImports operation. +type ListImportsAPIClient interface { + ListImports(context.Context, *ListImportsInput, ...func(*Options)) (*ListImportsOutput, error) +} + +var _ ListImportsAPIClient = (*Client)(nil) + +// ListImportsPaginatorOptions is the paginator options for ListImports +type ListImportsPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListImportsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudformation.ListImports +type ListImportsPaginator struct { + options ListImportsPaginatorOptions + client ListImportsAPIClient + params *ListImportsInput + nextToken *string + firstPage bool + done bool +} + +// NewListImportsPaginator returns a new ListImportsPaginator +func NewListImportsPaginator(client ListImportsAPIClient, params *ListImportsInput, optFns ...func(*ListImportsPaginatorOptions)) *ListImportsPaginator { + options := ListImportsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListImportsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListImportsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListImports page. +func (p *ListImportsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListImportsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListImports(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListStackSetOperationResultsAPIClient is a client that implements the +// ListStackSetOperationResults operation. +type ListStackSetOperationResultsAPIClient interface { + ListStackSetOperationResults(context.Context, *ListStackSetOperationResultsInput, ...func(*Options)) (*ListStackSetOperationResultsOutput, error) +} + +var _ ListStackSetOperationResultsAPIClient = (*Client)(nil) + +// ListStackSetOperationResultsPaginatorOptions is the paginator options for +// ListStackSetOperationResults +type ListStackSetOperationResultsPaginatorOptions struct { + // The maximum number of results to be returned with a single call. If the number + // of available results exceeds this maximum, the response includes a NextToken + // value that you can assign to the NextToken request parameter to get the next set + // of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListStackSetOperationResultsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudformation.ListStackSetOperationResults +type ListStackSetOperationResultsPaginator struct { + options ListStackSetOperationResultsPaginatorOptions + client ListStackSetOperationResultsAPIClient + params *ListStackSetOperationResultsInput + nextToken *string + firstPage bool + done bool +} + +// NewListStackSetOperationResultsPaginator returns a new +// ListStackSetOperationResultsPaginator +func NewListStackSetOperationResultsPaginator(client ListStackSetOperationResultsAPIClient, params *ListStackSetOperationResultsInput, optFns ...func(*ListStackSetOperationResultsPaginatorOptions)) *ListStackSetOperationResultsPaginator { + options := ListStackSetOperationResultsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListStackSetOperationResultsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListStackSetOperationResultsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListStackSetOperationResults page. +func (p *ListStackSetOperationResultsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListStackSetOperationResultsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListStackSetOperationResults(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTypeRegistrationsAPIClient is a client that implements the +// ListTypeRegistrations operation. +type ListTypeRegistrationsAPIClient interface { + ListTypeRegistrations(context.Context, *ListTypeRegistrationsInput, ...func(*Options)) (*ListTypeRegistrationsOutput, error) +} + +var _ ListTypeRegistrationsAPIClient = (*Client)(nil) + +// ListTypeRegistrationsPaginatorOptions is the paginator options for +// ListTypeRegistrations +type ListTypeRegistrationsPaginatorOptions struct { + // The maximum number of results to be returned with a single call. If the number + // of available results exceeds this maximum, the response includes a NextToken + // value that you can assign to the NextToken request parameter to get the next set + // of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTypeRegistrationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudformation.ListTypeRegistrations +type ListTypeRegistrationsPaginator struct { + options ListTypeRegistrationsPaginatorOptions + client ListTypeRegistrationsAPIClient + params *ListTypeRegistrationsInput + nextToken *string + firstPage bool + done bool +} + +// NewListTypeRegistrationsPaginator returns a new ListTypeRegistrationsPaginator +func NewListTypeRegistrationsPaginator(client ListTypeRegistrationsAPIClient, params *ListTypeRegistrationsInput, optFns ...func(*ListTypeRegistrationsPaginatorOptions)) *ListTypeRegistrationsPaginator { + options := ListTypeRegistrationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTypeRegistrationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTypeRegistrationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTypeRegistrations page. +func (p *ListTypeRegistrationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTypeRegistrationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListTypeRegistrations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeStackResourceDriftsAPIClient is a client that implements the +// DescribeStackResourceDrifts operation. +type DescribeStackResourceDriftsAPIClient interface { + DescribeStackResourceDrifts(context.Context, *DescribeStackResourceDriftsInput, ...func(*Options)) (*DescribeStackResourceDriftsOutput, error) +} + +var _ DescribeStackResourceDriftsAPIClient = (*Client)(nil) + +// DescribeStackResourceDriftsPaginatorOptions is the paginator options for +// DescribeStackResourceDrifts +type DescribeStackResourceDriftsPaginatorOptions struct { + // The maximum number of results to be returned with a single call. If the number + // of available results exceeds this maximum, the response includes a NextToken + // value that you can assign to the NextToken request parameter to get the next set + // of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeStackResourceDriftsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudformation.DescribeStackResourceDrifts +type DescribeStackResourceDriftsPaginator struct { + options DescribeStackResourceDriftsPaginatorOptions + client DescribeStackResourceDriftsAPIClient + params *DescribeStackResourceDriftsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeStackResourceDriftsPaginator returns a new +// DescribeStackResourceDriftsPaginator +func NewDescribeStackResourceDriftsPaginator(client DescribeStackResourceDriftsAPIClient, params *DescribeStackResourceDriftsInput, optFns ...func(*DescribeStackResourceDriftsPaginatorOptions)) *DescribeStackResourceDriftsPaginator { + options := DescribeStackResourceDriftsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeStackResourceDriftsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeStackResourceDriftsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeStackResourceDrifts page. +func (p *DescribeStackResourceDriftsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeStackResourceDriftsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeStackResourceDrifts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListExportsAPIClient is a client that implements the ListExports operation. +type ListExportsAPIClient interface { + ListExports(context.Context, *ListExportsInput, ...func(*Options)) (*ListExportsOutput, error) +} + +var _ ListExportsAPIClient = (*Client)(nil) + +// ListExportsPaginatorOptions is the paginator options for ListExports +type ListExportsPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListExportsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudformation.ListExports +type ListExportsPaginator struct { + options ListExportsPaginatorOptions + client ListExportsAPIClient + params *ListExportsInput + nextToken *string + firstPage bool + done bool +} + +// NewListExportsPaginator returns a new ListExportsPaginator +func NewListExportsPaginator(client ListExportsAPIClient, params *ListExportsInput, optFns ...func(*ListExportsPaginatorOptions)) *ListExportsPaginator { + options := ListExportsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListExportsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListExportsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListExports page. +func (p *ListExportsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListExportsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListExports(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListStackInstancesAPIClient is a client that implements the ListStackInstances +// operation. +type ListStackInstancesAPIClient interface { + ListStackInstances(context.Context, *ListStackInstancesInput, ...func(*Options)) (*ListStackInstancesOutput, error) +} + +var _ ListStackInstancesAPIClient = (*Client)(nil) + +// ListStackInstancesPaginatorOptions is the paginator options for +// ListStackInstances +type ListStackInstancesPaginatorOptions struct { + // The maximum number of results to be returned with a single call. If the number + // of available results exceeds this maximum, the response includes a NextToken + // value that you can assign to the NextToken request parameter to get the next set + // of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListStackInstancesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudformation.ListStackInstances +type ListStackInstancesPaginator struct { + options ListStackInstancesPaginatorOptions + client ListStackInstancesAPIClient + params *ListStackInstancesInput + nextToken *string + firstPage bool + done bool +} + +// NewListStackInstancesPaginator returns a new ListStackInstancesPaginator +func NewListStackInstancesPaginator(client ListStackInstancesAPIClient, params *ListStackInstancesInput, optFns ...func(*ListStackInstancesPaginatorOptions)) *ListStackInstancesPaginator { + options := ListStackInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListStackInstancesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListStackInstancesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListStackInstances page. +func (p *ListStackInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListStackInstancesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListStackInstances(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListStackResourcesAPIClient is a client that implements the ListStackResources +// operation. +type ListStackResourcesAPIClient interface { + ListStackResources(context.Context, *ListStackResourcesInput, ...func(*Options)) (*ListStackResourcesOutput, error) +} + +var _ ListStackResourcesAPIClient = (*Client)(nil) + +// ListStackResourcesPaginatorOptions is the paginator options for +// ListStackResources +type ListStackResourcesPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListStackResourcesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudformation.ListStackResources +type ListStackResourcesPaginator struct { + options ListStackResourcesPaginatorOptions + client ListStackResourcesAPIClient + params *ListStackResourcesInput + nextToken *string + firstPage bool + done bool +} + +// NewListStackResourcesPaginator returns a new ListStackResourcesPaginator +func NewListStackResourcesPaginator(client ListStackResourcesAPIClient, params *ListStackResourcesInput, optFns ...func(*ListStackResourcesPaginatorOptions)) *ListStackResourcesPaginator { + options := ListStackResourcesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListStackResourcesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListStackResourcesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListStackResources page. +func (p *ListStackResourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListStackResourcesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListStackResources(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListStackSetOperationsAPIClient is a client that implements the +// ListStackSetOperations operation. +type ListStackSetOperationsAPIClient interface { + ListStackSetOperations(context.Context, *ListStackSetOperationsInput, ...func(*Options)) (*ListStackSetOperationsOutput, error) +} + +var _ ListStackSetOperationsAPIClient = (*Client)(nil) + +// ListStackSetOperationsPaginatorOptions is the paginator options for +// ListStackSetOperations +type ListStackSetOperationsPaginatorOptions struct { + // The maximum number of results to be returned with a single call. If the number + // of available results exceeds this maximum, the response includes a NextToken + // value that you can assign to the NextToken request parameter to get the next set + // of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListStackSetOperationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudformation.ListStackSetOperations +type ListStackSetOperationsPaginator struct { + options ListStackSetOperationsPaginatorOptions + client ListStackSetOperationsAPIClient + params *ListStackSetOperationsInput + nextToken *string + firstPage bool + done bool +} + +// NewListStackSetOperationsPaginator returns a new ListStackSetOperationsPaginator +func NewListStackSetOperationsPaginator(client ListStackSetOperationsAPIClient, params *ListStackSetOperationsInput, optFns ...func(*ListStackSetOperationsPaginatorOptions)) *ListStackSetOperationsPaginator { + options := ListStackSetOperationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListStackSetOperationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListStackSetOperationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListStackSetOperations page. +func (p *ListStackSetOperationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListStackSetOperationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListStackSetOperations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListChangeSetsAPIClient is a client that implements the ListChangeSets +// operation. +type ListChangeSetsAPIClient interface { + ListChangeSets(context.Context, *ListChangeSetsInput, ...func(*Options)) (*ListChangeSetsOutput, error) +} + +var _ ListChangeSetsAPIClient = (*Client)(nil) + +// ListChangeSetsPaginatorOptions is the paginator options for ListChangeSets +type ListChangeSetsPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListChangeSetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudformation.ListChangeSets +type ListChangeSetsPaginator struct { + options ListChangeSetsPaginatorOptions + client ListChangeSetsAPIClient + params *ListChangeSetsInput + nextToken *string + firstPage bool + done bool +} + +// NewListChangeSetsPaginator returns a new ListChangeSetsPaginator +func NewListChangeSetsPaginator(client ListChangeSetsAPIClient, params *ListChangeSetsInput, optFns ...func(*ListChangeSetsPaginatorOptions)) *ListChangeSetsPaginator { + options := ListChangeSetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListChangeSetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListChangeSetsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListChangeSets page. +func (p *ListChangeSetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListChangeSetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListChangeSets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/cloudfront/go.sum b/service/cloudfront/go.sum index c669e324b14..32595049f96 100644 --- a/service/cloudfront/go.sum +++ b/service/cloudfront/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/cloudhsm/go.sum b/service/cloudhsm/go.sum index c669e324b14..32595049f96 100644 --- a/service/cloudhsm/go.sum +++ b/service/cloudhsm/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/cloudhsmv2/go.sum b/service/cloudhsmv2/go.sum index c669e324b14..32595049f96 100644 --- a/service/cloudhsmv2/go.sum +++ b/service/cloudhsmv2/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/cloudhsmv2/paginators.go b/service/cloudhsmv2/paginators.go new file mode 100644 index 00000000000..cc72f356dbf --- /dev/null +++ b/service/cloudhsmv2/paginators.go @@ -0,0 +1,235 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudhsmv2 + +import ( + "context" + "fmt" +) + +// ListTagsAPIClient is a client that implements the ListTags operation. +type ListTagsAPIClient interface { + ListTags(context.Context, *ListTagsInput, ...func(*Options)) (*ListTagsOutput, error) +} + +var _ ListTagsAPIClient = (*Client)(nil) + +// ListTagsPaginatorOptions is the paginator options for ListTags +type ListTagsPaginatorOptions struct { + // The maximum number of tags to return in the response. When there are more tags + // than the number you specify, the response contains a NextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTagsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudhsmv2.ListTags +type ListTagsPaginator struct { + options ListTagsPaginatorOptions + client ListTagsAPIClient + params *ListTagsInput + nextToken *string + firstPage bool + done bool +} + +// NewListTagsPaginator returns a new ListTagsPaginator +func NewListTagsPaginator(client ListTagsAPIClient, params *ListTagsInput, optFns ...func(*ListTagsPaginatorOptions)) *ListTagsPaginator { + options := ListTagsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTagsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTagsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTags page. +func (p *ListTagsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTagsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListTags(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeBackupsAPIClient is a client that implements the DescribeBackups +// operation. +type DescribeBackupsAPIClient interface { + DescribeBackups(context.Context, *DescribeBackupsInput, ...func(*Options)) (*DescribeBackupsOutput, error) +} + +var _ DescribeBackupsAPIClient = (*Client)(nil) + +// DescribeBackupsPaginatorOptions is the paginator options for DescribeBackups +type DescribeBackupsPaginatorOptions struct { + // The maximum number of backups to return in the response. When there are more + // backups than the number you specify, the response contains a NextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeBackupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudhsmv2.DescribeBackups +type DescribeBackupsPaginator struct { + options DescribeBackupsPaginatorOptions + client DescribeBackupsAPIClient + params *DescribeBackupsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeBackupsPaginator returns a new DescribeBackupsPaginator +func NewDescribeBackupsPaginator(client DescribeBackupsAPIClient, params *DescribeBackupsInput, optFns ...func(*DescribeBackupsPaginatorOptions)) *DescribeBackupsPaginator { + options := DescribeBackupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeBackupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeBackupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeBackups page. +func (p *DescribeBackupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeBackupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeBackups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeClustersAPIClient is a client that implements the DescribeClusters +// operation. +type DescribeClustersAPIClient interface { + DescribeClusters(context.Context, *DescribeClustersInput, ...func(*Options)) (*DescribeClustersOutput, error) +} + +var _ DescribeClustersAPIClient = (*Client)(nil) + +// DescribeClustersPaginatorOptions is the paginator options for DescribeClusters +type DescribeClustersPaginatorOptions struct { + // The maximum number of clusters to return in the response. When there are more + // clusters than the number you specify, the response contains a NextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeClustersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudhsmv2.DescribeClusters +type DescribeClustersPaginator struct { + options DescribeClustersPaginatorOptions + client DescribeClustersAPIClient + params *DescribeClustersInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeClustersPaginator returns a new DescribeClustersPaginator +func NewDescribeClustersPaginator(client DescribeClustersAPIClient, params *DescribeClustersInput, optFns ...func(*DescribeClustersPaginatorOptions)) *DescribeClustersPaginator { + options := DescribeClustersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeClustersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeClustersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeClusters page. +func (p *DescribeClustersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeClustersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeClusters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/cloudsearch/go.sum b/service/cloudsearch/go.sum index c669e324b14..32595049f96 100644 --- a/service/cloudsearch/go.sum +++ b/service/cloudsearch/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/cloudsearchdomain/go.sum b/service/cloudsearchdomain/go.sum index c669e324b14..32595049f96 100644 --- a/service/cloudsearchdomain/go.sum +++ b/service/cloudsearchdomain/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/cloudtrail/go.sum b/service/cloudtrail/go.sum index c669e324b14..32595049f96 100644 --- a/service/cloudtrail/go.sum +++ b/service/cloudtrail/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/cloudtrail/paginators.go b/service/cloudtrail/paginators.go new file mode 100644 index 00000000000..ffba3825ed4 --- /dev/null +++ b/service/cloudtrail/paginators.go @@ -0,0 +1,294 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudtrail + +import ( + "context" + "fmt" +) + +// ListTagsAPIClient is a client that implements the ListTags operation. +type ListTagsAPIClient interface { + ListTags(context.Context, *ListTagsInput, ...func(*Options)) (*ListTagsOutput, error) +} + +var _ ListTagsAPIClient = (*Client)(nil) + +// ListTagsPaginatorOptions is the paginator options for ListTags +type ListTagsPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTagsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudtrail.ListTags +type ListTagsPaginator struct { + options ListTagsPaginatorOptions + client ListTagsAPIClient + params *ListTagsInput + nextToken *string + firstPage bool + done bool +} + +// NewListTagsPaginator returns a new ListTagsPaginator +func NewListTagsPaginator(client ListTagsAPIClient, params *ListTagsInput, optFns ...func(*ListTagsPaginatorOptions)) *ListTagsPaginator { + options := ListTagsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTagsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTagsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTags page. +func (p *ListTagsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTagsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListTags(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// LookupEventsAPIClient is a client that implements the LookupEvents operation. +type LookupEventsAPIClient interface { + LookupEvents(context.Context, *LookupEventsInput, ...func(*Options)) (*LookupEventsOutput, error) +} + +var _ LookupEventsAPIClient = (*Client)(nil) + +// LookupEventsPaginatorOptions is the paginator options for LookupEvents +type LookupEventsPaginatorOptions struct { + // The number of events to return. Possible values are 1 through 50. The default is + // 50. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// LookupEventsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudtrail.LookupEvents +type LookupEventsPaginator struct { + options LookupEventsPaginatorOptions + client LookupEventsAPIClient + params *LookupEventsInput + nextToken *string + firstPage bool + done bool +} + +// NewLookupEventsPaginator returns a new LookupEventsPaginator +func NewLookupEventsPaginator(client LookupEventsAPIClient, params *LookupEventsInput, optFns ...func(*LookupEventsPaginatorOptions)) *LookupEventsPaginator { + options := LookupEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &LookupEventsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *LookupEventsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next LookupEvents page. +func (p *LookupEventsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*LookupEventsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.LookupEvents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTrailsAPIClient is a client that implements the ListTrails operation. +type ListTrailsAPIClient interface { + ListTrails(context.Context, *ListTrailsInput, ...func(*Options)) (*ListTrailsOutput, error) +} + +var _ ListTrailsAPIClient = (*Client)(nil) + +// ListTrailsPaginatorOptions is the paginator options for ListTrails +type ListTrailsPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTrailsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudtrail.ListTrails +type ListTrailsPaginator struct { + options ListTrailsPaginatorOptions + client ListTrailsAPIClient + params *ListTrailsInput + nextToken *string + firstPage bool + done bool +} + +// NewListTrailsPaginator returns a new ListTrailsPaginator +func NewListTrailsPaginator(client ListTrailsAPIClient, params *ListTrailsInput, optFns ...func(*ListTrailsPaginatorOptions)) *ListTrailsPaginator { + options := ListTrailsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTrailsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTrailsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTrails page. +func (p *ListTrailsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTrailsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListTrails(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListPublicKeysAPIClient is a client that implements the ListPublicKeys +// operation. +type ListPublicKeysAPIClient interface { + ListPublicKeys(context.Context, *ListPublicKeysInput, ...func(*Options)) (*ListPublicKeysOutput, error) +} + +var _ ListPublicKeysAPIClient = (*Client)(nil) + +// ListPublicKeysPaginatorOptions is the paginator options for ListPublicKeys +type ListPublicKeysPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListPublicKeysPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudtrail.ListPublicKeys +type ListPublicKeysPaginator struct { + options ListPublicKeysPaginatorOptions + client ListPublicKeysAPIClient + params *ListPublicKeysInput + nextToken *string + firstPage bool + done bool +} + +// NewListPublicKeysPaginator returns a new ListPublicKeysPaginator +func NewListPublicKeysPaginator(client ListPublicKeysAPIClient, params *ListPublicKeysInput, optFns ...func(*ListPublicKeysPaginatorOptions)) *ListPublicKeysPaginator { + options := ListPublicKeysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListPublicKeysPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPublicKeysPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListPublicKeys page. +func (p *ListPublicKeysPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPublicKeysOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListPublicKeys(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/cloudwatch/go.sum b/service/cloudwatch/go.sum index c669e324b14..32595049f96 100644 --- a/service/cloudwatch/go.sum +++ b/service/cloudwatch/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/cloudwatch/paginators.go b/service/cloudwatch/paginators.go new file mode 100644 index 00000000000..7333973ca8d --- /dev/null +++ b/service/cloudwatch/paginators.go @@ -0,0 +1,452 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudwatch + +import ( + "context" + "fmt" +) + +// DescribeInsightRulesAPIClient is a client that implements the +// DescribeInsightRules operation. +type DescribeInsightRulesAPIClient interface { + DescribeInsightRules(context.Context, *DescribeInsightRulesInput, ...func(*Options)) (*DescribeInsightRulesOutput, error) +} + +var _ DescribeInsightRulesAPIClient = (*Client)(nil) + +// DescribeInsightRulesPaginatorOptions is the paginator options for +// DescribeInsightRules +type DescribeInsightRulesPaginatorOptions struct { + // This parameter is not currently used. Reserved for future use. If it is used in + // the future, the maximum value might be different. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeInsightRulesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudwatch.DescribeInsightRules +type DescribeInsightRulesPaginator struct { + options DescribeInsightRulesPaginatorOptions + client DescribeInsightRulesAPIClient + params *DescribeInsightRulesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeInsightRulesPaginator returns a new DescribeInsightRulesPaginator +func NewDescribeInsightRulesPaginator(client DescribeInsightRulesAPIClient, params *DescribeInsightRulesInput, optFns ...func(*DescribeInsightRulesPaginatorOptions)) *DescribeInsightRulesPaginator { + options := DescribeInsightRulesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeInsightRulesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeInsightRulesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeInsightRules page. +func (p *DescribeInsightRulesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInsightRulesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeInsightRules(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetMetricDataAPIClient is a client that implements the GetMetricData operation. +type GetMetricDataAPIClient interface { + GetMetricData(context.Context, *GetMetricDataInput, ...func(*Options)) (*GetMetricDataOutput, error) +} + +var _ GetMetricDataAPIClient = (*Client)(nil) + +// GetMetricDataPaginatorOptions is the paginator options for GetMetricData +type GetMetricDataPaginatorOptions struct { + // The maximum number of data points the request should return before paginating. + // If you omit this, the default of 100,800 is used. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetMetricDataPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudwatch.GetMetricData +type GetMetricDataPaginator struct { + options GetMetricDataPaginatorOptions + client GetMetricDataAPIClient + params *GetMetricDataInput + nextToken *string + firstPage bool + done bool +} + +// NewGetMetricDataPaginator returns a new GetMetricDataPaginator +func NewGetMetricDataPaginator(client GetMetricDataAPIClient, params *GetMetricDataInput, optFns ...func(*GetMetricDataPaginatorOptions)) *GetMetricDataPaginator { + options := GetMetricDataPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetMetricDataPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetMetricDataPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetMetricData page. +func (p *GetMetricDataPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetMetricDataOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxDatapoints = p.options.Limit + result, err := p.client.GetMetricData(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDashboardsAPIClient is a client that implements the ListDashboards +// operation. +type ListDashboardsAPIClient interface { + ListDashboards(context.Context, *ListDashboardsInput, ...func(*Options)) (*ListDashboardsOutput, error) +} + +var _ ListDashboardsAPIClient = (*Client)(nil) + +// ListDashboardsPaginatorOptions is the paginator options for ListDashboards +type ListDashboardsPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDashboardsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudwatch.ListDashboards +type ListDashboardsPaginator struct { + options ListDashboardsPaginatorOptions + client ListDashboardsAPIClient + params *ListDashboardsInput + nextToken *string + firstPage bool + done bool +} + +// NewListDashboardsPaginator returns a new ListDashboardsPaginator +func NewListDashboardsPaginator(client ListDashboardsAPIClient, params *ListDashboardsInput, optFns ...func(*ListDashboardsPaginatorOptions)) *ListDashboardsPaginator { + options := ListDashboardsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDashboardsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDashboardsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDashboards page. +func (p *ListDashboardsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDashboardsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListDashboards(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeAlarmsAPIClient is a client that implements the DescribeAlarms +// operation. +type DescribeAlarmsAPIClient interface { + DescribeAlarms(context.Context, *DescribeAlarmsInput, ...func(*Options)) (*DescribeAlarmsOutput, error) +} + +var _ DescribeAlarmsAPIClient = (*Client)(nil) + +// DescribeAlarmsPaginatorOptions is the paginator options for DescribeAlarms +type DescribeAlarmsPaginatorOptions struct { + // The maximum number of alarm descriptions to retrieve. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeAlarmsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudwatch.DescribeAlarms +type DescribeAlarmsPaginator struct { + options DescribeAlarmsPaginatorOptions + client DescribeAlarmsAPIClient + params *DescribeAlarmsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeAlarmsPaginator returns a new DescribeAlarmsPaginator +func NewDescribeAlarmsPaginator(client DescribeAlarmsAPIClient, params *DescribeAlarmsInput, optFns ...func(*DescribeAlarmsPaginatorOptions)) *DescribeAlarmsPaginator { + options := DescribeAlarmsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeAlarmsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeAlarmsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeAlarms page. +func (p *DescribeAlarmsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeAlarmsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeAlarms(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListMetricsAPIClient is a client that implements the ListMetrics operation. +type ListMetricsAPIClient interface { + ListMetrics(context.Context, *ListMetricsInput, ...func(*Options)) (*ListMetricsOutput, error) +} + +var _ ListMetricsAPIClient = (*Client)(nil) + +// ListMetricsPaginatorOptions is the paginator options for ListMetrics +type ListMetricsPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListMetricsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudwatch.ListMetrics +type ListMetricsPaginator struct { + options ListMetricsPaginatorOptions + client ListMetricsAPIClient + params *ListMetricsInput + nextToken *string + firstPage bool + done bool +} + +// NewListMetricsPaginator returns a new ListMetricsPaginator +func NewListMetricsPaginator(client ListMetricsAPIClient, params *ListMetricsInput, optFns ...func(*ListMetricsPaginatorOptions)) *ListMetricsPaginator { + options := ListMetricsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListMetricsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMetricsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListMetrics page. +func (p *ListMetricsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMetricsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListMetrics(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeAlarmHistoryAPIClient is a client that implements the +// DescribeAlarmHistory operation. +type DescribeAlarmHistoryAPIClient interface { + DescribeAlarmHistory(context.Context, *DescribeAlarmHistoryInput, ...func(*Options)) (*DescribeAlarmHistoryOutput, error) +} + +var _ DescribeAlarmHistoryAPIClient = (*Client)(nil) + +// DescribeAlarmHistoryPaginatorOptions is the paginator options for +// DescribeAlarmHistory +type DescribeAlarmHistoryPaginatorOptions struct { + // The maximum number of alarm history records to retrieve. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeAlarmHistoryPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudwatch.DescribeAlarmHistory +type DescribeAlarmHistoryPaginator struct { + options DescribeAlarmHistoryPaginatorOptions + client DescribeAlarmHistoryAPIClient + params *DescribeAlarmHistoryInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeAlarmHistoryPaginator returns a new DescribeAlarmHistoryPaginator +func NewDescribeAlarmHistoryPaginator(client DescribeAlarmHistoryAPIClient, params *DescribeAlarmHistoryInput, optFns ...func(*DescribeAlarmHistoryPaginatorOptions)) *DescribeAlarmHistoryPaginator { + options := DescribeAlarmHistoryPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeAlarmHistoryPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeAlarmHistoryPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeAlarmHistory page. +func (p *DescribeAlarmHistoryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeAlarmHistoryOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeAlarmHistory(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/cloudwatchevents/go.sum b/service/cloudwatchevents/go.sum index c669e324b14..32595049f96 100644 --- a/service/cloudwatchevents/go.sum +++ b/service/cloudwatchevents/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/cloudwatchlogs/go.sum b/service/cloudwatchlogs/go.sum index c669e324b14..32595049f96 100644 --- a/service/cloudwatchlogs/go.sum +++ b/service/cloudwatchlogs/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/cloudwatchlogs/paginators.go b/service/cloudwatchlogs/paginators.go new file mode 100644 index 00000000000..3dd2f1b1cd3 --- /dev/null +++ b/service/cloudwatchlogs/paginators.go @@ -0,0 +1,544 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudwatchlogs + +import ( + "context" + "fmt" +) + +// DescribeSubscriptionFiltersAPIClient is a client that implements the +// DescribeSubscriptionFilters operation. +type DescribeSubscriptionFiltersAPIClient interface { + DescribeSubscriptionFilters(context.Context, *DescribeSubscriptionFiltersInput, ...func(*Options)) (*DescribeSubscriptionFiltersOutput, error) +} + +var _ DescribeSubscriptionFiltersAPIClient = (*Client)(nil) + +// DescribeSubscriptionFiltersPaginatorOptions is the paginator options for +// DescribeSubscriptionFilters +type DescribeSubscriptionFiltersPaginatorOptions struct { + // The maximum number of items returned. If you don't specify a value, the default + // is up to 50 items. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeSubscriptionFiltersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs.DescribeSubscriptionFilters +type DescribeSubscriptionFiltersPaginator struct { + options DescribeSubscriptionFiltersPaginatorOptions + client DescribeSubscriptionFiltersAPIClient + params *DescribeSubscriptionFiltersInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeSubscriptionFiltersPaginator returns a new +// DescribeSubscriptionFiltersPaginator +func NewDescribeSubscriptionFiltersPaginator(client DescribeSubscriptionFiltersAPIClient, params *DescribeSubscriptionFiltersInput, optFns ...func(*DescribeSubscriptionFiltersPaginatorOptions)) *DescribeSubscriptionFiltersPaginator { + options := DescribeSubscriptionFiltersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeSubscriptionFiltersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeSubscriptionFiltersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeSubscriptionFilters page. +func (p *DescribeSubscriptionFiltersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeSubscriptionFiltersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.DescribeSubscriptionFilters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeDestinationsAPIClient is a client that implements the +// DescribeDestinations operation. +type DescribeDestinationsAPIClient interface { + DescribeDestinations(context.Context, *DescribeDestinationsInput, ...func(*Options)) (*DescribeDestinationsOutput, error) +} + +var _ DescribeDestinationsAPIClient = (*Client)(nil) + +// DescribeDestinationsPaginatorOptions is the paginator options for +// DescribeDestinations +type DescribeDestinationsPaginatorOptions struct { + // The maximum number of items returned. If you don't specify a value, the default + // is up to 50 items. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeDestinationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs.DescribeDestinations +type DescribeDestinationsPaginator struct { + options DescribeDestinationsPaginatorOptions + client DescribeDestinationsAPIClient + params *DescribeDestinationsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeDestinationsPaginator returns a new DescribeDestinationsPaginator +func NewDescribeDestinationsPaginator(client DescribeDestinationsAPIClient, params *DescribeDestinationsInput, optFns ...func(*DescribeDestinationsPaginatorOptions)) *DescribeDestinationsPaginator { + options := DescribeDestinationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeDestinationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDestinationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeDestinations page. +func (p *DescribeDestinationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDestinationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.DescribeDestinations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeMetricFiltersAPIClient is a client that implements the +// DescribeMetricFilters operation. +type DescribeMetricFiltersAPIClient interface { + DescribeMetricFilters(context.Context, *DescribeMetricFiltersInput, ...func(*Options)) (*DescribeMetricFiltersOutput, error) +} + +var _ DescribeMetricFiltersAPIClient = (*Client)(nil) + +// DescribeMetricFiltersPaginatorOptions is the paginator options for +// DescribeMetricFilters +type DescribeMetricFiltersPaginatorOptions struct { + // The maximum number of items returned. If you don't specify a value, the default + // is up to 50 items. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeMetricFiltersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs.DescribeMetricFilters +type DescribeMetricFiltersPaginator struct { + options DescribeMetricFiltersPaginatorOptions + client DescribeMetricFiltersAPIClient + params *DescribeMetricFiltersInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeMetricFiltersPaginator returns a new DescribeMetricFiltersPaginator +func NewDescribeMetricFiltersPaginator(client DescribeMetricFiltersAPIClient, params *DescribeMetricFiltersInput, optFns ...func(*DescribeMetricFiltersPaginatorOptions)) *DescribeMetricFiltersPaginator { + options := DescribeMetricFiltersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeMetricFiltersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeMetricFiltersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeMetricFilters page. +func (p *DescribeMetricFiltersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeMetricFiltersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.DescribeMetricFilters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetLogEventsAPIClient is a client that implements the GetLogEvents operation. +type GetLogEventsAPIClient interface { + GetLogEvents(context.Context, *GetLogEventsInput, ...func(*Options)) (*GetLogEventsOutput, error) +} + +var _ GetLogEventsAPIClient = (*Client)(nil) + +// GetLogEventsPaginatorOptions is the paginator options for GetLogEvents +type GetLogEventsPaginatorOptions struct { + // The maximum number of log events returned. If you don't specify a value, the + // maximum is as many log events as can fit in a response size of 1 MB, up to + // 10,000 log events. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetLogEventsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs.GetLogEvents +type GetLogEventsPaginator struct { + options GetLogEventsPaginatorOptions + client GetLogEventsAPIClient + params *GetLogEventsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetLogEventsPaginator returns a new GetLogEventsPaginator +func NewGetLogEventsPaginator(client GetLogEventsAPIClient, params *GetLogEventsInput, optFns ...func(*GetLogEventsPaginatorOptions)) *GetLogEventsPaginator { + options := GetLogEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetLogEventsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetLogEventsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetLogEvents page. +func (p *GetLogEventsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetLogEventsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.GetLogEvents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextForwardToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// FilterLogEventsAPIClient is a client that implements the FilterLogEvents +// operation. +type FilterLogEventsAPIClient interface { + FilterLogEvents(context.Context, *FilterLogEventsInput, ...func(*Options)) (*FilterLogEventsOutput, error) +} + +var _ FilterLogEventsAPIClient = (*Client)(nil) + +// FilterLogEventsPaginatorOptions is the paginator options for FilterLogEvents +type FilterLogEventsPaginatorOptions struct { + // The maximum number of events to return. The default is 10,000 events. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// FilterLogEventsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs.FilterLogEvents +type FilterLogEventsPaginator struct { + options FilterLogEventsPaginatorOptions + client FilterLogEventsAPIClient + params *FilterLogEventsInput + nextToken *string + firstPage bool + done bool +} + +// NewFilterLogEventsPaginator returns a new FilterLogEventsPaginator +func NewFilterLogEventsPaginator(client FilterLogEventsAPIClient, params *FilterLogEventsInput, optFns ...func(*FilterLogEventsPaginatorOptions)) *FilterLogEventsPaginator { + options := FilterLogEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &FilterLogEventsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *FilterLogEventsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next FilterLogEvents page. +func (p *FilterLogEventsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*FilterLogEventsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.FilterLogEvents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeLogGroupsAPIClient is a client that implements the DescribeLogGroups +// operation. +type DescribeLogGroupsAPIClient interface { + DescribeLogGroups(context.Context, *DescribeLogGroupsInput, ...func(*Options)) (*DescribeLogGroupsOutput, error) +} + +var _ DescribeLogGroupsAPIClient = (*Client)(nil) + +// DescribeLogGroupsPaginatorOptions is the paginator options for DescribeLogGroups +type DescribeLogGroupsPaginatorOptions struct { + // The maximum number of items returned. If you don't specify a value, the default + // is up to 50 items. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeLogGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs.DescribeLogGroups +type DescribeLogGroupsPaginator struct { + options DescribeLogGroupsPaginatorOptions + client DescribeLogGroupsAPIClient + params *DescribeLogGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeLogGroupsPaginator returns a new DescribeLogGroupsPaginator +func NewDescribeLogGroupsPaginator(client DescribeLogGroupsAPIClient, params *DescribeLogGroupsInput, optFns ...func(*DescribeLogGroupsPaginatorOptions)) *DescribeLogGroupsPaginator { + options := DescribeLogGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeLogGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeLogGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeLogGroups page. +func (p *DescribeLogGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeLogGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.DescribeLogGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeLogStreamsAPIClient is a client that implements the DescribeLogStreams +// operation. +type DescribeLogStreamsAPIClient interface { + DescribeLogStreams(context.Context, *DescribeLogStreamsInput, ...func(*Options)) (*DescribeLogStreamsOutput, error) +} + +var _ DescribeLogStreamsAPIClient = (*Client)(nil) + +// DescribeLogStreamsPaginatorOptions is the paginator options for +// DescribeLogStreams +type DescribeLogStreamsPaginatorOptions struct { + // The maximum number of items returned. If you don't specify a value, the default + // is up to 50 items. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeLogStreamsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs.DescribeLogStreams +type DescribeLogStreamsPaginator struct { + options DescribeLogStreamsPaginatorOptions + client DescribeLogStreamsAPIClient + params *DescribeLogStreamsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeLogStreamsPaginator returns a new DescribeLogStreamsPaginator +func NewDescribeLogStreamsPaginator(client DescribeLogStreamsAPIClient, params *DescribeLogStreamsInput, optFns ...func(*DescribeLogStreamsPaginatorOptions)) *DescribeLogStreamsPaginator { + options := DescribeLogStreamsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeLogStreamsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeLogStreamsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeLogStreams page. +func (p *DescribeLogStreamsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeLogStreamsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.DescribeLogStreams(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/codeartifact/go.sum b/service/codeartifact/go.sum index c669e324b14..32595049f96 100644 --- a/service/codeartifact/go.sum +++ b/service/codeartifact/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/codeartifact/paginators.go b/service/codeartifact/paginators.go new file mode 100644 index 00000000000..5c50662f4e2 --- /dev/null +++ b/service/codeartifact/paginators.go @@ -0,0 +1,461 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codeartifact + +import ( + "context" + "fmt" +) + +// ListDomainsAPIClient is a client that implements the ListDomains operation. +type ListDomainsAPIClient interface { + ListDomains(context.Context, *ListDomainsInput, ...func(*Options)) (*ListDomainsOutput, error) +} + +var _ ListDomainsAPIClient = (*Client)(nil) + +// ListDomainsPaginatorOptions is the paginator options for ListDomains +type ListDomainsPaginatorOptions struct { + // The maximum number of results to return per page. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDomainsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codeartifact.ListDomains +type ListDomainsPaginator struct { + options ListDomainsPaginatorOptions + client ListDomainsAPIClient + params *ListDomainsInput + nextToken *string + firstPage bool + done bool +} + +// NewListDomainsPaginator returns a new ListDomainsPaginator +func NewListDomainsPaginator(client ListDomainsAPIClient, params *ListDomainsInput, optFns ...func(*ListDomainsPaginatorOptions)) *ListDomainsPaginator { + options := ListDomainsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDomainsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDomainsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDomains page. +func (p *ListDomainsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDomainsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListDomains(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListRepositoriesAPIClient is a client that implements the ListRepositories +// operation. +type ListRepositoriesAPIClient interface { + ListRepositories(context.Context, *ListRepositoriesInput, ...func(*Options)) (*ListRepositoriesOutput, error) +} + +var _ ListRepositoriesAPIClient = (*Client)(nil) + +// ListRepositoriesPaginatorOptions is the paginator options for ListRepositories +type ListRepositoriesPaginatorOptions struct { + // The maximum number of results to return per page. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListRepositoriesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codeartifact.ListRepositories +type ListRepositoriesPaginator struct { + options ListRepositoriesPaginatorOptions + client ListRepositoriesAPIClient + params *ListRepositoriesInput + nextToken *string + firstPage bool + done bool +} + +// NewListRepositoriesPaginator returns a new ListRepositoriesPaginator +func NewListRepositoriesPaginator(client ListRepositoriesAPIClient, params *ListRepositoriesInput, optFns ...func(*ListRepositoriesPaginatorOptions)) *ListRepositoriesPaginator { + options := ListRepositoriesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListRepositoriesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRepositoriesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListRepositories page. +func (p *ListRepositoriesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRepositoriesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListRepositories(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListPackageVersionsAPIClient is a client that implements the ListPackageVersions +// operation. +type ListPackageVersionsAPIClient interface { + ListPackageVersions(context.Context, *ListPackageVersionsInput, ...func(*Options)) (*ListPackageVersionsOutput, error) +} + +var _ ListPackageVersionsAPIClient = (*Client)(nil) + +// ListPackageVersionsPaginatorOptions is the paginator options for +// ListPackageVersions +type ListPackageVersionsPaginatorOptions struct { + // The maximum number of results to return per page. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListPackageVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codeartifact.ListPackageVersions +type ListPackageVersionsPaginator struct { + options ListPackageVersionsPaginatorOptions + client ListPackageVersionsAPIClient + params *ListPackageVersionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListPackageVersionsPaginator returns a new ListPackageVersionsPaginator +func NewListPackageVersionsPaginator(client ListPackageVersionsAPIClient, params *ListPackageVersionsInput, optFns ...func(*ListPackageVersionsPaginatorOptions)) *ListPackageVersionsPaginator { + options := ListPackageVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListPackageVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPackageVersionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListPackageVersions page. +func (p *ListPackageVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPackageVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListPackageVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListPackageVersionAssetsAPIClient is a client that implements the +// ListPackageVersionAssets operation. +type ListPackageVersionAssetsAPIClient interface { + ListPackageVersionAssets(context.Context, *ListPackageVersionAssetsInput, ...func(*Options)) (*ListPackageVersionAssetsOutput, error) +} + +var _ ListPackageVersionAssetsAPIClient = (*Client)(nil) + +// ListPackageVersionAssetsPaginatorOptions is the paginator options for +// ListPackageVersionAssets +type ListPackageVersionAssetsPaginatorOptions struct { + // The maximum number of results to return per page. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListPackageVersionAssetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codeartifact.ListPackageVersionAssets +type ListPackageVersionAssetsPaginator struct { + options ListPackageVersionAssetsPaginatorOptions + client ListPackageVersionAssetsAPIClient + params *ListPackageVersionAssetsInput + nextToken *string + firstPage bool + done bool +} + +// NewListPackageVersionAssetsPaginator returns a new +// ListPackageVersionAssetsPaginator +func NewListPackageVersionAssetsPaginator(client ListPackageVersionAssetsAPIClient, params *ListPackageVersionAssetsInput, optFns ...func(*ListPackageVersionAssetsPaginatorOptions)) *ListPackageVersionAssetsPaginator { + options := ListPackageVersionAssetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListPackageVersionAssetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPackageVersionAssetsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListPackageVersionAssets page. +func (p *ListPackageVersionAssetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPackageVersionAssetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListPackageVersionAssets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListPackagesAPIClient is a client that implements the ListPackages operation. +type ListPackagesAPIClient interface { + ListPackages(context.Context, *ListPackagesInput, ...func(*Options)) (*ListPackagesOutput, error) +} + +var _ ListPackagesAPIClient = (*Client)(nil) + +// ListPackagesPaginatorOptions is the paginator options for ListPackages +type ListPackagesPaginatorOptions struct { + // The maximum number of results to return per page. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListPackagesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codeartifact.ListPackages +type ListPackagesPaginator struct { + options ListPackagesPaginatorOptions + client ListPackagesAPIClient + params *ListPackagesInput + nextToken *string + firstPage bool + done bool +} + +// NewListPackagesPaginator returns a new ListPackagesPaginator +func NewListPackagesPaginator(client ListPackagesAPIClient, params *ListPackagesInput, optFns ...func(*ListPackagesPaginatorOptions)) *ListPackagesPaginator { + options := ListPackagesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListPackagesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPackagesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListPackages page. +func (p *ListPackagesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPackagesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListPackages(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListRepositoriesInDomainAPIClient is a client that implements the +// ListRepositoriesInDomain operation. +type ListRepositoriesInDomainAPIClient interface { + ListRepositoriesInDomain(context.Context, *ListRepositoriesInDomainInput, ...func(*Options)) (*ListRepositoriesInDomainOutput, error) +} + +var _ ListRepositoriesInDomainAPIClient = (*Client)(nil) + +// ListRepositoriesInDomainPaginatorOptions is the paginator options for +// ListRepositoriesInDomain +type ListRepositoriesInDomainPaginatorOptions struct { + // The maximum number of results to return per page. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListRepositoriesInDomainPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codeartifact.ListRepositoriesInDomain +type ListRepositoriesInDomainPaginator struct { + options ListRepositoriesInDomainPaginatorOptions + client ListRepositoriesInDomainAPIClient + params *ListRepositoriesInDomainInput + nextToken *string + firstPage bool + done bool +} + +// NewListRepositoriesInDomainPaginator returns a new +// ListRepositoriesInDomainPaginator +func NewListRepositoriesInDomainPaginator(client ListRepositoriesInDomainAPIClient, params *ListRepositoriesInDomainInput, optFns ...func(*ListRepositoriesInDomainPaginatorOptions)) *ListRepositoriesInDomainPaginator { + options := ListRepositoriesInDomainPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListRepositoriesInDomainPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRepositoriesInDomainPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListRepositoriesInDomain page. +func (p *ListRepositoriesInDomainPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRepositoriesInDomainOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListRepositoriesInDomain(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/codebuild/go.sum b/service/codebuild/go.sum index c669e324b14..32595049f96 100644 --- a/service/codebuild/go.sum +++ b/service/codebuild/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/codebuild/paginators.go b/service/codebuild/paginators.go new file mode 100644 index 00000000000..96e531d5400 --- /dev/null +++ b/service/codebuild/paginators.go @@ -0,0 +1,912 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codebuild + +import ( + "context" + "fmt" +) + +// ListBuildBatchesForProjectAPIClient is a client that implements the +// ListBuildBatchesForProject operation. +type ListBuildBatchesForProjectAPIClient interface { + ListBuildBatchesForProject(context.Context, *ListBuildBatchesForProjectInput, ...func(*Options)) (*ListBuildBatchesForProjectOutput, error) +} + +var _ ListBuildBatchesForProjectAPIClient = (*Client)(nil) + +// ListBuildBatchesForProjectPaginatorOptions is the paginator options for +// ListBuildBatchesForProject +type ListBuildBatchesForProjectPaginatorOptions struct { + // The maximum number of results to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListBuildBatchesForProjectPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codebuild.ListBuildBatchesForProject +type ListBuildBatchesForProjectPaginator struct { + options ListBuildBatchesForProjectPaginatorOptions + client ListBuildBatchesForProjectAPIClient + params *ListBuildBatchesForProjectInput + nextToken *string + firstPage bool + done bool +} + +// NewListBuildBatchesForProjectPaginator returns a new +// ListBuildBatchesForProjectPaginator +func NewListBuildBatchesForProjectPaginator(client ListBuildBatchesForProjectAPIClient, params *ListBuildBatchesForProjectInput, optFns ...func(*ListBuildBatchesForProjectPaginatorOptions)) *ListBuildBatchesForProjectPaginator { + options := ListBuildBatchesForProjectPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListBuildBatchesForProjectPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListBuildBatchesForProjectPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListBuildBatchesForProject page. +func (p *ListBuildBatchesForProjectPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBuildBatchesForProjectOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListBuildBatchesForProject(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListSharedReportGroupsAPIClient is a client that implements the +// ListSharedReportGroups operation. +type ListSharedReportGroupsAPIClient interface { + ListSharedReportGroups(context.Context, *ListSharedReportGroupsInput, ...func(*Options)) (*ListSharedReportGroupsOutput, error) +} + +var _ ListSharedReportGroupsAPIClient = (*Client)(nil) + +// ListSharedReportGroupsPaginatorOptions is the paginator options for +// ListSharedReportGroups +type ListSharedReportGroupsPaginatorOptions struct { + // The maximum number of paginated shared report groups per response. Use nextToken + // to iterate pages in the list of returned ReportGroup objects. The default value + // is 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListSharedReportGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codebuild.ListSharedReportGroups +type ListSharedReportGroupsPaginator struct { + options ListSharedReportGroupsPaginatorOptions + client ListSharedReportGroupsAPIClient + params *ListSharedReportGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewListSharedReportGroupsPaginator returns a new ListSharedReportGroupsPaginator +func NewListSharedReportGroupsPaginator(client ListSharedReportGroupsAPIClient, params *ListSharedReportGroupsInput, optFns ...func(*ListSharedReportGroupsPaginatorOptions)) *ListSharedReportGroupsPaginator { + options := ListSharedReportGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListSharedReportGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSharedReportGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListSharedReportGroups page. +func (p *ListSharedReportGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSharedReportGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListSharedReportGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListProjectsAPIClient is a client that implements the ListProjects operation. +type ListProjectsAPIClient interface { + ListProjects(context.Context, *ListProjectsInput, ...func(*Options)) (*ListProjectsOutput, error) +} + +var _ ListProjectsAPIClient = (*Client)(nil) + +// ListProjectsPaginatorOptions is the paginator options for ListProjects +type ListProjectsPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListProjectsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codebuild.ListProjects +type ListProjectsPaginator struct { + options ListProjectsPaginatorOptions + client ListProjectsAPIClient + params *ListProjectsInput + nextToken *string + firstPage bool + done bool +} + +// NewListProjectsPaginator returns a new ListProjectsPaginator +func NewListProjectsPaginator(client ListProjectsAPIClient, params *ListProjectsInput, optFns ...func(*ListProjectsPaginatorOptions)) *ListProjectsPaginator { + options := ListProjectsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListProjectsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListProjectsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListProjects page. +func (p *ListProjectsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProjectsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListProjects(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListReportsAPIClient is a client that implements the ListReports operation. +type ListReportsAPIClient interface { + ListReports(context.Context, *ListReportsInput, ...func(*Options)) (*ListReportsOutput, error) +} + +var _ ListReportsAPIClient = (*Client)(nil) + +// ListReportsPaginatorOptions is the paginator options for ListReports +type ListReportsPaginatorOptions struct { + // The maximum number of paginated reports returned per response. Use nextToken to + // iterate pages in the list of returned Report objects. The default value is 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListReportsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codebuild.ListReports +type ListReportsPaginator struct { + options ListReportsPaginatorOptions + client ListReportsAPIClient + params *ListReportsInput + nextToken *string + firstPage bool + done bool +} + +// NewListReportsPaginator returns a new ListReportsPaginator +func NewListReportsPaginator(client ListReportsAPIClient, params *ListReportsInput, optFns ...func(*ListReportsPaginatorOptions)) *ListReportsPaginator { + options := ListReportsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListReportsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListReportsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListReports page. +func (p *ListReportsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListReportsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListReports(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListReportGroupsAPIClient is a client that implements the ListReportGroups +// operation. +type ListReportGroupsAPIClient interface { + ListReportGroups(context.Context, *ListReportGroupsInput, ...func(*Options)) (*ListReportGroupsOutput, error) +} + +var _ ListReportGroupsAPIClient = (*Client)(nil) + +// ListReportGroupsPaginatorOptions is the paginator options for ListReportGroups +type ListReportGroupsPaginatorOptions struct { + // The maximum number of paginated report groups returned per response. Use + // nextToken to iterate pages in the list of returned ReportGroup objects. The + // default value is 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListReportGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codebuild.ListReportGroups +type ListReportGroupsPaginator struct { + options ListReportGroupsPaginatorOptions + client ListReportGroupsAPIClient + params *ListReportGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewListReportGroupsPaginator returns a new ListReportGroupsPaginator +func NewListReportGroupsPaginator(client ListReportGroupsAPIClient, params *ListReportGroupsInput, optFns ...func(*ListReportGroupsPaginatorOptions)) *ListReportGroupsPaginator { + options := ListReportGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListReportGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListReportGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListReportGroups page. +func (p *ListReportGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListReportGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListReportGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeTestCasesAPIClient is a client that implements the DescribeTestCases +// operation. +type DescribeTestCasesAPIClient interface { + DescribeTestCases(context.Context, *DescribeTestCasesInput, ...func(*Options)) (*DescribeTestCasesOutput, error) +} + +var _ DescribeTestCasesAPIClient = (*Client)(nil) + +// DescribeTestCasesPaginatorOptions is the paginator options for DescribeTestCases +type DescribeTestCasesPaginatorOptions struct { + // The maximum number of paginated test cases returned per response. Use nextToken + // to iterate pages in the list of returned TestCase objects. The default value is + // 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeTestCasesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codebuild.DescribeTestCases +type DescribeTestCasesPaginator struct { + options DescribeTestCasesPaginatorOptions + client DescribeTestCasesAPIClient + params *DescribeTestCasesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeTestCasesPaginator returns a new DescribeTestCasesPaginator +func NewDescribeTestCasesPaginator(client DescribeTestCasesAPIClient, params *DescribeTestCasesInput, optFns ...func(*DescribeTestCasesPaginatorOptions)) *DescribeTestCasesPaginator { + options := DescribeTestCasesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeTestCasesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeTestCasesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeTestCases page. +func (p *DescribeTestCasesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTestCasesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeTestCases(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListBuildsForProjectAPIClient is a client that implements the +// ListBuildsForProject operation. +type ListBuildsForProjectAPIClient interface { + ListBuildsForProject(context.Context, *ListBuildsForProjectInput, ...func(*Options)) (*ListBuildsForProjectOutput, error) +} + +var _ ListBuildsForProjectAPIClient = (*Client)(nil) + +// ListBuildsForProjectPaginatorOptions is the paginator options for +// ListBuildsForProject +type ListBuildsForProjectPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListBuildsForProjectPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codebuild.ListBuildsForProject +type ListBuildsForProjectPaginator struct { + options ListBuildsForProjectPaginatorOptions + client ListBuildsForProjectAPIClient + params *ListBuildsForProjectInput + nextToken *string + firstPage bool + done bool +} + +// NewListBuildsForProjectPaginator returns a new ListBuildsForProjectPaginator +func NewListBuildsForProjectPaginator(client ListBuildsForProjectAPIClient, params *ListBuildsForProjectInput, optFns ...func(*ListBuildsForProjectPaginatorOptions)) *ListBuildsForProjectPaginator { + options := ListBuildsForProjectPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListBuildsForProjectPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListBuildsForProjectPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListBuildsForProject page. +func (p *ListBuildsForProjectPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBuildsForProjectOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListBuildsForProject(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListBuildBatchesAPIClient is a client that implements the ListBuildBatches +// operation. +type ListBuildBatchesAPIClient interface { + ListBuildBatches(context.Context, *ListBuildBatchesInput, ...func(*Options)) (*ListBuildBatchesOutput, error) +} + +var _ ListBuildBatchesAPIClient = (*Client)(nil) + +// ListBuildBatchesPaginatorOptions is the paginator options for ListBuildBatches +type ListBuildBatchesPaginatorOptions struct { + // The maximum number of results to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListBuildBatchesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codebuild.ListBuildBatches +type ListBuildBatchesPaginator struct { + options ListBuildBatchesPaginatorOptions + client ListBuildBatchesAPIClient + params *ListBuildBatchesInput + nextToken *string + firstPage bool + done bool +} + +// NewListBuildBatchesPaginator returns a new ListBuildBatchesPaginator +func NewListBuildBatchesPaginator(client ListBuildBatchesAPIClient, params *ListBuildBatchesInput, optFns ...func(*ListBuildBatchesPaginatorOptions)) *ListBuildBatchesPaginator { + options := ListBuildBatchesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListBuildBatchesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListBuildBatchesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListBuildBatches page. +func (p *ListBuildBatchesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBuildBatchesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListBuildBatches(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListBuildsAPIClient is a client that implements the ListBuilds operation. +type ListBuildsAPIClient interface { + ListBuilds(context.Context, *ListBuildsInput, ...func(*Options)) (*ListBuildsOutput, error) +} + +var _ ListBuildsAPIClient = (*Client)(nil) + +// ListBuildsPaginatorOptions is the paginator options for ListBuilds +type ListBuildsPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListBuildsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codebuild.ListBuilds +type ListBuildsPaginator struct { + options ListBuildsPaginatorOptions + client ListBuildsAPIClient + params *ListBuildsInput + nextToken *string + firstPage bool + done bool +} + +// NewListBuildsPaginator returns a new ListBuildsPaginator +func NewListBuildsPaginator(client ListBuildsAPIClient, params *ListBuildsInput, optFns ...func(*ListBuildsPaginatorOptions)) *ListBuildsPaginator { + options := ListBuildsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListBuildsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListBuildsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListBuilds page. +func (p *ListBuildsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBuildsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListBuilds(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeCodeCoveragesAPIClient is a client that implements the +// DescribeCodeCoverages operation. +type DescribeCodeCoveragesAPIClient interface { + DescribeCodeCoverages(context.Context, *DescribeCodeCoveragesInput, ...func(*Options)) (*DescribeCodeCoveragesOutput, error) +} + +var _ DescribeCodeCoveragesAPIClient = (*Client)(nil) + +// DescribeCodeCoveragesPaginatorOptions is the paginator options for +// DescribeCodeCoverages +type DescribeCodeCoveragesPaginatorOptions struct { + // The maximum number of results to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeCodeCoveragesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codebuild.DescribeCodeCoverages +type DescribeCodeCoveragesPaginator struct { + options DescribeCodeCoveragesPaginatorOptions + client DescribeCodeCoveragesAPIClient + params *DescribeCodeCoveragesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeCodeCoveragesPaginator returns a new DescribeCodeCoveragesPaginator +func NewDescribeCodeCoveragesPaginator(client DescribeCodeCoveragesAPIClient, params *DescribeCodeCoveragesInput, optFns ...func(*DescribeCodeCoveragesPaginatorOptions)) *DescribeCodeCoveragesPaginator { + options := DescribeCodeCoveragesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeCodeCoveragesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeCodeCoveragesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeCodeCoverages page. +func (p *DescribeCodeCoveragesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCodeCoveragesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeCodeCoverages(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListSharedProjectsAPIClient is a client that implements the ListSharedProjects +// operation. +type ListSharedProjectsAPIClient interface { + ListSharedProjects(context.Context, *ListSharedProjectsInput, ...func(*Options)) (*ListSharedProjectsOutput, error) +} + +var _ ListSharedProjectsAPIClient = (*Client)(nil) + +// ListSharedProjectsPaginatorOptions is the paginator options for +// ListSharedProjects +type ListSharedProjectsPaginatorOptions struct { + // The maximum number of paginated shared build projects returned per response. Use + // nextToken to iterate pages in the list of returned Project objects. The default + // value is 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListSharedProjectsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codebuild.ListSharedProjects +type ListSharedProjectsPaginator struct { + options ListSharedProjectsPaginatorOptions + client ListSharedProjectsAPIClient + params *ListSharedProjectsInput + nextToken *string + firstPage bool + done bool +} + +// NewListSharedProjectsPaginator returns a new ListSharedProjectsPaginator +func NewListSharedProjectsPaginator(client ListSharedProjectsAPIClient, params *ListSharedProjectsInput, optFns ...func(*ListSharedProjectsPaginatorOptions)) *ListSharedProjectsPaginator { + options := ListSharedProjectsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListSharedProjectsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSharedProjectsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListSharedProjects page. +func (p *ListSharedProjectsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSharedProjectsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListSharedProjects(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListReportsForReportGroupAPIClient is a client that implements the +// ListReportsForReportGroup operation. +type ListReportsForReportGroupAPIClient interface { + ListReportsForReportGroup(context.Context, *ListReportsForReportGroupInput, ...func(*Options)) (*ListReportsForReportGroupOutput, error) +} + +var _ ListReportsForReportGroupAPIClient = (*Client)(nil) + +// ListReportsForReportGroupPaginatorOptions is the paginator options for +// ListReportsForReportGroup +type ListReportsForReportGroupPaginatorOptions struct { + // The maximum number of paginated reports in this report group returned per + // response. Use nextToken to iterate pages in the list of returned Report objects. + // The default value is 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListReportsForReportGroupPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codebuild.ListReportsForReportGroup +type ListReportsForReportGroupPaginator struct { + options ListReportsForReportGroupPaginatorOptions + client ListReportsForReportGroupAPIClient + params *ListReportsForReportGroupInput + nextToken *string + firstPage bool + done bool +} + +// NewListReportsForReportGroupPaginator returns a new +// ListReportsForReportGroupPaginator +func NewListReportsForReportGroupPaginator(client ListReportsForReportGroupAPIClient, params *ListReportsForReportGroupInput, optFns ...func(*ListReportsForReportGroupPaginatorOptions)) *ListReportsForReportGroupPaginator { + options := ListReportsForReportGroupPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListReportsForReportGroupPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListReportsForReportGroupPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListReportsForReportGroup page. +func (p *ListReportsForReportGroupPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListReportsForReportGroupOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListReportsForReportGroup(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/codecommit/go.sum b/service/codecommit/go.sum index c669e324b14..32595049f96 100644 --- a/service/codecommit/go.sum +++ b/service/codecommit/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/codecommit/paginators.go b/service/codecommit/paginators.go new file mode 100644 index 00000000000..2f8a8058c54 --- /dev/null +++ b/service/codecommit/paginators.go @@ -0,0 +1,995 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codecommit + +import ( + "context" + "fmt" +) + +// ListPullRequestsAPIClient is a client that implements the ListPullRequests +// operation. +type ListPullRequestsAPIClient interface { + ListPullRequests(context.Context, *ListPullRequestsInput, ...func(*Options)) (*ListPullRequestsOutput, error) +} + +var _ ListPullRequestsAPIClient = (*Client)(nil) + +// ListPullRequestsPaginatorOptions is the paginator options for ListPullRequests +type ListPullRequestsPaginatorOptions struct { + // A non-zero, non-negative integer used to limit the number of returned results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListPullRequestsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codecommit.ListPullRequests +type ListPullRequestsPaginator struct { + options ListPullRequestsPaginatorOptions + client ListPullRequestsAPIClient + params *ListPullRequestsInput + nextToken *string + firstPage bool + done bool +} + +// NewListPullRequestsPaginator returns a new ListPullRequestsPaginator +func NewListPullRequestsPaginator(client ListPullRequestsAPIClient, params *ListPullRequestsInput, optFns ...func(*ListPullRequestsPaginatorOptions)) *ListPullRequestsPaginator { + options := ListPullRequestsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListPullRequestsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPullRequestsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListPullRequests page. +func (p *ListPullRequestsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPullRequestsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListPullRequests(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeMergeConflictsAPIClient is a client that implements the +// DescribeMergeConflicts operation. +type DescribeMergeConflictsAPIClient interface { + DescribeMergeConflicts(context.Context, *DescribeMergeConflictsInput, ...func(*Options)) (*DescribeMergeConflictsOutput, error) +} + +var _ DescribeMergeConflictsAPIClient = (*Client)(nil) + +// DescribeMergeConflictsPaginatorOptions is the paginator options for +// DescribeMergeConflicts +type DescribeMergeConflictsPaginatorOptions struct { + // The maximum number of merge hunks to include in the output. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeMergeConflictsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codecommit.DescribeMergeConflicts +type DescribeMergeConflictsPaginator struct { + options DescribeMergeConflictsPaginatorOptions + client DescribeMergeConflictsAPIClient + params *DescribeMergeConflictsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeMergeConflictsPaginator returns a new DescribeMergeConflictsPaginator +func NewDescribeMergeConflictsPaginator(client DescribeMergeConflictsAPIClient, params *DescribeMergeConflictsInput, optFns ...func(*DescribeMergeConflictsPaginatorOptions)) *DescribeMergeConflictsPaginator { + options := DescribeMergeConflictsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeMergeConflictsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeMergeConflictsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeMergeConflicts page. +func (p *DescribeMergeConflictsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeMergeConflictsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxMergeHunks = p.options.Limit + result, err := p.client.DescribeMergeConflicts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListRepositoriesAPIClient is a client that implements the ListRepositories +// operation. +type ListRepositoriesAPIClient interface { + ListRepositories(context.Context, *ListRepositoriesInput, ...func(*Options)) (*ListRepositoriesOutput, error) +} + +var _ ListRepositoriesAPIClient = (*Client)(nil) + +// ListRepositoriesPaginatorOptions is the paginator options for ListRepositories +type ListRepositoriesPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListRepositoriesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codecommit.ListRepositories +type ListRepositoriesPaginator struct { + options ListRepositoriesPaginatorOptions + client ListRepositoriesAPIClient + params *ListRepositoriesInput + nextToken *string + firstPage bool + done bool +} + +// NewListRepositoriesPaginator returns a new ListRepositoriesPaginator +func NewListRepositoriesPaginator(client ListRepositoriesAPIClient, params *ListRepositoriesInput, optFns ...func(*ListRepositoriesPaginatorOptions)) *ListRepositoriesPaginator { + options := ListRepositoriesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListRepositoriesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRepositoriesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListRepositories page. +func (p *ListRepositoriesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRepositoriesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListRepositories(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListBranchesAPIClient is a client that implements the ListBranches operation. +type ListBranchesAPIClient interface { + ListBranches(context.Context, *ListBranchesInput, ...func(*Options)) (*ListBranchesOutput, error) +} + +var _ ListBranchesAPIClient = (*Client)(nil) + +// ListBranchesPaginatorOptions is the paginator options for ListBranches +type ListBranchesPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListBranchesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codecommit.ListBranches +type ListBranchesPaginator struct { + options ListBranchesPaginatorOptions + client ListBranchesAPIClient + params *ListBranchesInput + nextToken *string + firstPage bool + done bool +} + +// NewListBranchesPaginator returns a new ListBranchesPaginator +func NewListBranchesPaginator(client ListBranchesAPIClient, params *ListBranchesInput, optFns ...func(*ListBranchesPaginatorOptions)) *ListBranchesPaginator { + options := ListBranchesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListBranchesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListBranchesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListBranches page. +func (p *ListBranchesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBranchesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListBranches(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListAssociatedApprovalRuleTemplatesForRepositoryAPIClient is a client that +// implements the ListAssociatedApprovalRuleTemplatesForRepository operation. +type ListAssociatedApprovalRuleTemplatesForRepositoryAPIClient interface { + ListAssociatedApprovalRuleTemplatesForRepository(context.Context, *ListAssociatedApprovalRuleTemplatesForRepositoryInput, ...func(*Options)) (*ListAssociatedApprovalRuleTemplatesForRepositoryOutput, error) +} + +var _ ListAssociatedApprovalRuleTemplatesForRepositoryAPIClient = (*Client)(nil) + +// ListAssociatedApprovalRuleTemplatesForRepositoryPaginatorOptions is the +// paginator options for ListAssociatedApprovalRuleTemplatesForRepository +type ListAssociatedApprovalRuleTemplatesForRepositoryPaginatorOptions struct { + // A non-zero, non-negative integer used to limit the number of returned results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAssociatedApprovalRuleTemplatesForRepositoryPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codecommit.ListAssociatedApprovalRuleTemplatesForRepository +type ListAssociatedApprovalRuleTemplatesForRepositoryPaginator struct { + options ListAssociatedApprovalRuleTemplatesForRepositoryPaginatorOptions + client ListAssociatedApprovalRuleTemplatesForRepositoryAPIClient + params *ListAssociatedApprovalRuleTemplatesForRepositoryInput + nextToken *string + firstPage bool + done bool +} + +// NewListAssociatedApprovalRuleTemplatesForRepositoryPaginator returns a new +// ListAssociatedApprovalRuleTemplatesForRepositoryPaginator +func NewListAssociatedApprovalRuleTemplatesForRepositoryPaginator(client ListAssociatedApprovalRuleTemplatesForRepositoryAPIClient, params *ListAssociatedApprovalRuleTemplatesForRepositoryInput, optFns ...func(*ListAssociatedApprovalRuleTemplatesForRepositoryPaginatorOptions)) *ListAssociatedApprovalRuleTemplatesForRepositoryPaginator { + options := ListAssociatedApprovalRuleTemplatesForRepositoryPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAssociatedApprovalRuleTemplatesForRepositoryPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAssociatedApprovalRuleTemplatesForRepositoryPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAssociatedApprovalRuleTemplatesForRepository +// page. +func (p *ListAssociatedApprovalRuleTemplatesForRepositoryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAssociatedApprovalRuleTemplatesForRepositoryOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListAssociatedApprovalRuleTemplatesForRepository(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetCommentsForPullRequestAPIClient is a client that implements the +// GetCommentsForPullRequest operation. +type GetCommentsForPullRequestAPIClient interface { + GetCommentsForPullRequest(context.Context, *GetCommentsForPullRequestInput, ...func(*Options)) (*GetCommentsForPullRequestOutput, error) +} + +var _ GetCommentsForPullRequestAPIClient = (*Client)(nil) + +// GetCommentsForPullRequestPaginatorOptions is the paginator options for +// GetCommentsForPullRequest +type GetCommentsForPullRequestPaginatorOptions struct { + // A non-zero, non-negative integer used to limit the number of returned results. + // The default is 100 comments. You can return up to 500 comments with a single + // request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetCommentsForPullRequestPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codecommit.GetCommentsForPullRequest +type GetCommentsForPullRequestPaginator struct { + options GetCommentsForPullRequestPaginatorOptions + client GetCommentsForPullRequestAPIClient + params *GetCommentsForPullRequestInput + nextToken *string + firstPage bool + done bool +} + +// NewGetCommentsForPullRequestPaginator returns a new +// GetCommentsForPullRequestPaginator +func NewGetCommentsForPullRequestPaginator(client GetCommentsForPullRequestAPIClient, params *GetCommentsForPullRequestInput, optFns ...func(*GetCommentsForPullRequestPaginatorOptions)) *GetCommentsForPullRequestPaginator { + options := GetCommentsForPullRequestPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetCommentsForPullRequestPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetCommentsForPullRequestPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetCommentsForPullRequest page. +func (p *GetCommentsForPullRequestPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetCommentsForPullRequestOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetCommentsForPullRequest(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListApprovalRuleTemplatesAPIClient is a client that implements the +// ListApprovalRuleTemplates operation. +type ListApprovalRuleTemplatesAPIClient interface { + ListApprovalRuleTemplates(context.Context, *ListApprovalRuleTemplatesInput, ...func(*Options)) (*ListApprovalRuleTemplatesOutput, error) +} + +var _ ListApprovalRuleTemplatesAPIClient = (*Client)(nil) + +// ListApprovalRuleTemplatesPaginatorOptions is the paginator options for +// ListApprovalRuleTemplates +type ListApprovalRuleTemplatesPaginatorOptions struct { + // A non-zero, non-negative integer used to limit the number of returned results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListApprovalRuleTemplatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codecommit.ListApprovalRuleTemplates +type ListApprovalRuleTemplatesPaginator struct { + options ListApprovalRuleTemplatesPaginatorOptions + client ListApprovalRuleTemplatesAPIClient + params *ListApprovalRuleTemplatesInput + nextToken *string + firstPage bool + done bool +} + +// NewListApprovalRuleTemplatesPaginator returns a new +// ListApprovalRuleTemplatesPaginator +func NewListApprovalRuleTemplatesPaginator(client ListApprovalRuleTemplatesAPIClient, params *ListApprovalRuleTemplatesInput, optFns ...func(*ListApprovalRuleTemplatesPaginatorOptions)) *ListApprovalRuleTemplatesPaginator { + options := ListApprovalRuleTemplatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListApprovalRuleTemplatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListApprovalRuleTemplatesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListApprovalRuleTemplates page. +func (p *ListApprovalRuleTemplatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListApprovalRuleTemplatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListApprovalRuleTemplates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetDifferencesAPIClient is a client that implements the GetDifferences +// operation. +type GetDifferencesAPIClient interface { + GetDifferences(context.Context, *GetDifferencesInput, ...func(*Options)) (*GetDifferencesOutput, error) +} + +var _ GetDifferencesAPIClient = (*Client)(nil) + +// GetDifferencesPaginatorOptions is the paginator options for GetDifferences +type GetDifferencesPaginatorOptions struct { + // A non-zero, non-negative integer used to limit the number of returned results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetDifferencesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codecommit.GetDifferences +type GetDifferencesPaginator struct { + options GetDifferencesPaginatorOptions + client GetDifferencesAPIClient + params *GetDifferencesInput + nextToken *string + firstPage bool + done bool +} + +// NewGetDifferencesPaginator returns a new GetDifferencesPaginator +func NewGetDifferencesPaginator(client GetDifferencesAPIClient, params *GetDifferencesInput, optFns ...func(*GetDifferencesPaginatorOptions)) *GetDifferencesPaginator { + options := GetDifferencesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetDifferencesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetDifferencesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetDifferences page. +func (p *GetDifferencesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetDifferencesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetDifferences(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListRepositoriesForApprovalRuleTemplateAPIClient is a client that implements the +// ListRepositoriesForApprovalRuleTemplate operation. +type ListRepositoriesForApprovalRuleTemplateAPIClient interface { + ListRepositoriesForApprovalRuleTemplate(context.Context, *ListRepositoriesForApprovalRuleTemplateInput, ...func(*Options)) (*ListRepositoriesForApprovalRuleTemplateOutput, error) +} + +var _ ListRepositoriesForApprovalRuleTemplateAPIClient = (*Client)(nil) + +// ListRepositoriesForApprovalRuleTemplatePaginatorOptions is the paginator options +// for ListRepositoriesForApprovalRuleTemplate +type ListRepositoriesForApprovalRuleTemplatePaginatorOptions struct { + // A non-zero, non-negative integer used to limit the number of returned results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListRepositoriesForApprovalRuleTemplatePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codecommit.ListRepositoriesForApprovalRuleTemplate +type ListRepositoriesForApprovalRuleTemplatePaginator struct { + options ListRepositoriesForApprovalRuleTemplatePaginatorOptions + client ListRepositoriesForApprovalRuleTemplateAPIClient + params *ListRepositoriesForApprovalRuleTemplateInput + nextToken *string + firstPage bool + done bool +} + +// NewListRepositoriesForApprovalRuleTemplatePaginator returns a new +// ListRepositoriesForApprovalRuleTemplatePaginator +func NewListRepositoriesForApprovalRuleTemplatePaginator(client ListRepositoriesForApprovalRuleTemplateAPIClient, params *ListRepositoriesForApprovalRuleTemplateInput, optFns ...func(*ListRepositoriesForApprovalRuleTemplatePaginatorOptions)) *ListRepositoriesForApprovalRuleTemplatePaginator { + options := ListRepositoriesForApprovalRuleTemplatePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListRepositoriesForApprovalRuleTemplatePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRepositoriesForApprovalRuleTemplatePaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListRepositoriesForApprovalRuleTemplate page. +func (p *ListRepositoriesForApprovalRuleTemplatePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRepositoriesForApprovalRuleTemplateOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListRepositoriesForApprovalRuleTemplate(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribePullRequestEventsAPIClient is a client that implements the +// DescribePullRequestEvents operation. +type DescribePullRequestEventsAPIClient interface { + DescribePullRequestEvents(context.Context, *DescribePullRequestEventsInput, ...func(*Options)) (*DescribePullRequestEventsOutput, error) +} + +var _ DescribePullRequestEventsAPIClient = (*Client)(nil) + +// DescribePullRequestEventsPaginatorOptions is the paginator options for +// DescribePullRequestEvents +type DescribePullRequestEventsPaginatorOptions struct { + // A non-zero, non-negative integer used to limit the number of returned results. + // The default is 100 events, which is also the maximum number of events that can + // be returned in a result. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribePullRequestEventsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codecommit.DescribePullRequestEvents +type DescribePullRequestEventsPaginator struct { + options DescribePullRequestEventsPaginatorOptions + client DescribePullRequestEventsAPIClient + params *DescribePullRequestEventsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribePullRequestEventsPaginator returns a new +// DescribePullRequestEventsPaginator +func NewDescribePullRequestEventsPaginator(client DescribePullRequestEventsAPIClient, params *DescribePullRequestEventsInput, optFns ...func(*DescribePullRequestEventsPaginatorOptions)) *DescribePullRequestEventsPaginator { + options := DescribePullRequestEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribePullRequestEventsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribePullRequestEventsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribePullRequestEvents page. +func (p *DescribePullRequestEventsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribePullRequestEventsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribePullRequestEvents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetCommentReactionsAPIClient is a client that implements the GetCommentReactions +// operation. +type GetCommentReactionsAPIClient interface { + GetCommentReactions(context.Context, *GetCommentReactionsInput, ...func(*Options)) (*GetCommentReactionsOutput, error) +} + +var _ GetCommentReactionsAPIClient = (*Client)(nil) + +// GetCommentReactionsPaginatorOptions is the paginator options for +// GetCommentReactions +type GetCommentReactionsPaginatorOptions struct { + // A non-zero, non-negative integer used to limit the number of returned results. + // The default is the same as the allowed maximum, 1,000. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetCommentReactionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codecommit.GetCommentReactions +type GetCommentReactionsPaginator struct { + options GetCommentReactionsPaginatorOptions + client GetCommentReactionsAPIClient + params *GetCommentReactionsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetCommentReactionsPaginator returns a new GetCommentReactionsPaginator +func NewGetCommentReactionsPaginator(client GetCommentReactionsAPIClient, params *GetCommentReactionsInput, optFns ...func(*GetCommentReactionsPaginatorOptions)) *GetCommentReactionsPaginator { + options := GetCommentReactionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetCommentReactionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetCommentReactionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetCommentReactions page. +func (p *GetCommentReactionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetCommentReactionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetCommentReactions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetMergeConflictsAPIClient is a client that implements the GetMergeConflicts +// operation. +type GetMergeConflictsAPIClient interface { + GetMergeConflicts(context.Context, *GetMergeConflictsInput, ...func(*Options)) (*GetMergeConflictsOutput, error) +} + +var _ GetMergeConflictsAPIClient = (*Client)(nil) + +// GetMergeConflictsPaginatorOptions is the paginator options for GetMergeConflicts +type GetMergeConflictsPaginatorOptions struct { + // The maximum number of files to include in the output. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetMergeConflictsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codecommit.GetMergeConflicts +type GetMergeConflictsPaginator struct { + options GetMergeConflictsPaginatorOptions + client GetMergeConflictsAPIClient + params *GetMergeConflictsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetMergeConflictsPaginator returns a new GetMergeConflictsPaginator +func NewGetMergeConflictsPaginator(client GetMergeConflictsAPIClient, params *GetMergeConflictsInput, optFns ...func(*GetMergeConflictsPaginatorOptions)) *GetMergeConflictsPaginator { + options := GetMergeConflictsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetMergeConflictsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetMergeConflictsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetMergeConflicts page. +func (p *GetMergeConflictsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetMergeConflictsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxConflictFiles = p.options.Limit + result, err := p.client.GetMergeConflicts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetCommentsForComparedCommitAPIClient is a client that implements the +// GetCommentsForComparedCommit operation. +type GetCommentsForComparedCommitAPIClient interface { + GetCommentsForComparedCommit(context.Context, *GetCommentsForComparedCommitInput, ...func(*Options)) (*GetCommentsForComparedCommitOutput, error) +} + +var _ GetCommentsForComparedCommitAPIClient = (*Client)(nil) + +// GetCommentsForComparedCommitPaginatorOptions is the paginator options for +// GetCommentsForComparedCommit +type GetCommentsForComparedCommitPaginatorOptions struct { + // A non-zero, non-negative integer used to limit the number of returned results. + // The default is 100 comments, but you can configure up to 500. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetCommentsForComparedCommitPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codecommit.GetCommentsForComparedCommit +type GetCommentsForComparedCommitPaginator struct { + options GetCommentsForComparedCommitPaginatorOptions + client GetCommentsForComparedCommitAPIClient + params *GetCommentsForComparedCommitInput + nextToken *string + firstPage bool + done bool +} + +// NewGetCommentsForComparedCommitPaginator returns a new +// GetCommentsForComparedCommitPaginator +func NewGetCommentsForComparedCommitPaginator(client GetCommentsForComparedCommitAPIClient, params *GetCommentsForComparedCommitInput, optFns ...func(*GetCommentsForComparedCommitPaginatorOptions)) *GetCommentsForComparedCommitPaginator { + options := GetCommentsForComparedCommitPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetCommentsForComparedCommitPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetCommentsForComparedCommitPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetCommentsForComparedCommit page. +func (p *GetCommentsForComparedCommitPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetCommentsForComparedCommitOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetCommentsForComparedCommit(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/codedeploy/go.sum b/service/codedeploy/go.sum index c669e324b14..32595049f96 100644 --- a/service/codedeploy/go.sum +++ b/service/codedeploy/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/codedeploy/paginators.go b/service/codedeploy/paginators.go new file mode 100644 index 00000000000..de3370e3fb1 --- /dev/null +++ b/service/codedeploy/paginators.go @@ -0,0 +1,440 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codedeploy + +import ( + "context" + "fmt" +) + +// ListDeploymentInstancesAPIClient is a client that implements the +// ListDeploymentInstances operation. +type ListDeploymentInstancesAPIClient interface { + ListDeploymentInstances(context.Context, *ListDeploymentInstancesInput, ...func(*Options)) (*ListDeploymentInstancesOutput, error) +} + +var _ ListDeploymentInstancesAPIClient = (*Client)(nil) + +// ListDeploymentInstancesPaginatorOptions is the paginator options for +// ListDeploymentInstances +type ListDeploymentInstancesPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDeploymentInstancesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codedeploy.ListDeploymentInstances +type ListDeploymentInstancesPaginator struct { + options ListDeploymentInstancesPaginatorOptions + client ListDeploymentInstancesAPIClient + params *ListDeploymentInstancesInput + nextToken *string + firstPage bool + done bool +} + +// NewListDeploymentInstancesPaginator returns a new +// ListDeploymentInstancesPaginator +func NewListDeploymentInstancesPaginator(client ListDeploymentInstancesAPIClient, params *ListDeploymentInstancesInput, optFns ...func(*ListDeploymentInstancesPaginatorOptions)) *ListDeploymentInstancesPaginator { + options := ListDeploymentInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDeploymentInstancesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDeploymentInstancesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDeploymentInstances page. +func (p *ListDeploymentInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDeploymentInstancesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListDeploymentInstances(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDeploymentConfigsAPIClient is a client that implements the +// ListDeploymentConfigs operation. +type ListDeploymentConfigsAPIClient interface { + ListDeploymentConfigs(context.Context, *ListDeploymentConfigsInput, ...func(*Options)) (*ListDeploymentConfigsOutput, error) +} + +var _ ListDeploymentConfigsAPIClient = (*Client)(nil) + +// ListDeploymentConfigsPaginatorOptions is the paginator options for +// ListDeploymentConfigs +type ListDeploymentConfigsPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDeploymentConfigsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codedeploy.ListDeploymentConfigs +type ListDeploymentConfigsPaginator struct { + options ListDeploymentConfigsPaginatorOptions + client ListDeploymentConfigsAPIClient + params *ListDeploymentConfigsInput + nextToken *string + firstPage bool + done bool +} + +// NewListDeploymentConfigsPaginator returns a new ListDeploymentConfigsPaginator +func NewListDeploymentConfigsPaginator(client ListDeploymentConfigsAPIClient, params *ListDeploymentConfigsInput, optFns ...func(*ListDeploymentConfigsPaginatorOptions)) *ListDeploymentConfigsPaginator { + options := ListDeploymentConfigsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDeploymentConfigsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDeploymentConfigsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDeploymentConfigs page. +func (p *ListDeploymentConfigsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDeploymentConfigsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListDeploymentConfigs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListApplicationsAPIClient is a client that implements the ListApplications +// operation. +type ListApplicationsAPIClient interface { + ListApplications(context.Context, *ListApplicationsInput, ...func(*Options)) (*ListApplicationsOutput, error) +} + +var _ ListApplicationsAPIClient = (*Client)(nil) + +// ListApplicationsPaginatorOptions is the paginator options for ListApplications +type ListApplicationsPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListApplicationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codedeploy.ListApplications +type ListApplicationsPaginator struct { + options ListApplicationsPaginatorOptions + client ListApplicationsAPIClient + params *ListApplicationsInput + nextToken *string + firstPage bool + done bool +} + +// NewListApplicationsPaginator returns a new ListApplicationsPaginator +func NewListApplicationsPaginator(client ListApplicationsAPIClient, params *ListApplicationsInput, optFns ...func(*ListApplicationsPaginatorOptions)) *ListApplicationsPaginator { + options := ListApplicationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListApplicationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListApplicationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListApplications page. +func (p *ListApplicationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListApplicationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListApplications(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDeploymentsAPIClient is a client that implements the ListDeployments +// operation. +type ListDeploymentsAPIClient interface { + ListDeployments(context.Context, *ListDeploymentsInput, ...func(*Options)) (*ListDeploymentsOutput, error) +} + +var _ ListDeploymentsAPIClient = (*Client)(nil) + +// ListDeploymentsPaginatorOptions is the paginator options for ListDeployments +type ListDeploymentsPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDeploymentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codedeploy.ListDeployments +type ListDeploymentsPaginator struct { + options ListDeploymentsPaginatorOptions + client ListDeploymentsAPIClient + params *ListDeploymentsInput + nextToken *string + firstPage bool + done bool +} + +// NewListDeploymentsPaginator returns a new ListDeploymentsPaginator +func NewListDeploymentsPaginator(client ListDeploymentsAPIClient, params *ListDeploymentsInput, optFns ...func(*ListDeploymentsPaginatorOptions)) *ListDeploymentsPaginator { + options := ListDeploymentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDeploymentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDeploymentsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDeployments page. +func (p *ListDeploymentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDeploymentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListDeployments(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListApplicationRevisionsAPIClient is a client that implements the +// ListApplicationRevisions operation. +type ListApplicationRevisionsAPIClient interface { + ListApplicationRevisions(context.Context, *ListApplicationRevisionsInput, ...func(*Options)) (*ListApplicationRevisionsOutput, error) +} + +var _ ListApplicationRevisionsAPIClient = (*Client)(nil) + +// ListApplicationRevisionsPaginatorOptions is the paginator options for +// ListApplicationRevisions +type ListApplicationRevisionsPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListApplicationRevisionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codedeploy.ListApplicationRevisions +type ListApplicationRevisionsPaginator struct { + options ListApplicationRevisionsPaginatorOptions + client ListApplicationRevisionsAPIClient + params *ListApplicationRevisionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListApplicationRevisionsPaginator returns a new +// ListApplicationRevisionsPaginator +func NewListApplicationRevisionsPaginator(client ListApplicationRevisionsAPIClient, params *ListApplicationRevisionsInput, optFns ...func(*ListApplicationRevisionsPaginatorOptions)) *ListApplicationRevisionsPaginator { + options := ListApplicationRevisionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListApplicationRevisionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListApplicationRevisionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListApplicationRevisions page. +func (p *ListApplicationRevisionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListApplicationRevisionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListApplicationRevisions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDeploymentGroupsAPIClient is a client that implements the +// ListDeploymentGroups operation. +type ListDeploymentGroupsAPIClient interface { + ListDeploymentGroups(context.Context, *ListDeploymentGroupsInput, ...func(*Options)) (*ListDeploymentGroupsOutput, error) +} + +var _ ListDeploymentGroupsAPIClient = (*Client)(nil) + +// ListDeploymentGroupsPaginatorOptions is the paginator options for +// ListDeploymentGroups +type ListDeploymentGroupsPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDeploymentGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codedeploy.ListDeploymentGroups +type ListDeploymentGroupsPaginator struct { + options ListDeploymentGroupsPaginatorOptions + client ListDeploymentGroupsAPIClient + params *ListDeploymentGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewListDeploymentGroupsPaginator returns a new ListDeploymentGroupsPaginator +func NewListDeploymentGroupsPaginator(client ListDeploymentGroupsAPIClient, params *ListDeploymentGroupsInput, optFns ...func(*ListDeploymentGroupsPaginatorOptions)) *ListDeploymentGroupsPaginator { + options := ListDeploymentGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDeploymentGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDeploymentGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDeploymentGroups page. +func (p *ListDeploymentGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDeploymentGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListDeploymentGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/codeguruprofiler/go.sum b/service/codeguruprofiler/go.sum index c669e324b14..32595049f96 100644 --- a/service/codeguruprofiler/go.sum +++ b/service/codeguruprofiler/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/codeguruprofiler/paginators.go b/service/codeguruprofiler/paginators.go new file mode 100644 index 00000000000..f7828ce7f94 --- /dev/null +++ b/service/codeguruprofiler/paginators.go @@ -0,0 +1,167 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codeguruprofiler + +import ( + "context" + "fmt" +) + +// ListProfilingGroupsAPIClient is a client that implements the ListProfilingGroups +// operation. +type ListProfilingGroupsAPIClient interface { + ListProfilingGroups(context.Context, *ListProfilingGroupsInput, ...func(*Options)) (*ListProfilingGroupsOutput, error) +} + +var _ ListProfilingGroupsAPIClient = (*Client)(nil) + +// ListProfilingGroupsPaginatorOptions is the paginator options for +// ListProfilingGroups +type ListProfilingGroupsPaginatorOptions struct { + // The maximum number of profiling groups results returned by ListProfilingGroups + // in paginated output. When this parameter is used, ListProfilingGroups only + // returns maxResults results in a single page along with a nextToken response + // element. The remaining results of the initial request can be seen by sending + // another ListProfilingGroups request with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListProfilingGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codeguruprofiler.ListProfilingGroups +type ListProfilingGroupsPaginator struct { + options ListProfilingGroupsPaginatorOptions + client ListProfilingGroupsAPIClient + params *ListProfilingGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewListProfilingGroupsPaginator returns a new ListProfilingGroupsPaginator +func NewListProfilingGroupsPaginator(client ListProfilingGroupsAPIClient, params *ListProfilingGroupsInput, optFns ...func(*ListProfilingGroupsPaginatorOptions)) *ListProfilingGroupsPaginator { + options := ListProfilingGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListProfilingGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListProfilingGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListProfilingGroups page. +func (p *ListProfilingGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProfilingGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListProfilingGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListProfileTimesAPIClient is a client that implements the ListProfileTimes +// operation. +type ListProfileTimesAPIClient interface { + ListProfileTimes(context.Context, *ListProfileTimesInput, ...func(*Options)) (*ListProfileTimesOutput, error) +} + +var _ ListProfileTimesAPIClient = (*Client)(nil) + +// ListProfileTimesPaginatorOptions is the paginator options for ListProfileTimes +type ListProfileTimesPaginatorOptions struct { + // The maximum number of profile time results returned by ListProfileTimes in + // paginated output. When this parameter is used, ListProfileTimes only returns + // maxResults results in a single page with a nextToken response element. The + // remaining results of the initial request can be seen by sending another + // ListProfileTimes request with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListProfileTimesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codeguruprofiler.ListProfileTimes +type ListProfileTimesPaginator struct { + options ListProfileTimesPaginatorOptions + client ListProfileTimesAPIClient + params *ListProfileTimesInput + nextToken *string + firstPage bool + done bool +} + +// NewListProfileTimesPaginator returns a new ListProfileTimesPaginator +func NewListProfileTimesPaginator(client ListProfileTimesAPIClient, params *ListProfileTimesInput, optFns ...func(*ListProfileTimesPaginatorOptions)) *ListProfileTimesPaginator { + options := ListProfileTimesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListProfileTimesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListProfileTimesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListProfileTimes page. +func (p *ListProfileTimesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProfileTimesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListProfileTimes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/codegurureviewer/go.sum b/service/codegurureviewer/go.sum index c669e324b14..32595049f96 100644 --- a/service/codegurureviewer/go.sum +++ b/service/codegurureviewer/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/codegurureviewer/paginators.go b/service/codegurureviewer/paginators.go new file mode 100644 index 00000000000..8ad281aa162 --- /dev/null +++ b/service/codegurureviewer/paginators.go @@ -0,0 +1,320 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codegurureviewer + +import ( + "context" + "fmt" +) + +// ListRecommendationsAPIClient is a client that implements the ListRecommendations +// operation. +type ListRecommendationsAPIClient interface { + ListRecommendations(context.Context, *ListRecommendationsInput, ...func(*Options)) (*ListRecommendationsOutput, error) +} + +var _ ListRecommendationsAPIClient = (*Client)(nil) + +// ListRecommendationsPaginatorOptions is the paginator options for +// ListRecommendations +type ListRecommendationsPaginatorOptions struct { + // The maximum number of results that are returned per call. The default is 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListRecommendationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codegurureviewer.ListRecommendations +type ListRecommendationsPaginator struct { + options ListRecommendationsPaginatorOptions + client ListRecommendationsAPIClient + params *ListRecommendationsInput + nextToken *string + firstPage bool + done bool +} + +// NewListRecommendationsPaginator returns a new ListRecommendationsPaginator +func NewListRecommendationsPaginator(client ListRecommendationsAPIClient, params *ListRecommendationsInput, optFns ...func(*ListRecommendationsPaginatorOptions)) *ListRecommendationsPaginator { + options := ListRecommendationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListRecommendationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRecommendationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListRecommendations page. +func (p *ListRecommendationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRecommendationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListRecommendations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListRepositoryAssociationsAPIClient is a client that implements the +// ListRepositoryAssociations operation. +type ListRepositoryAssociationsAPIClient interface { + ListRepositoryAssociations(context.Context, *ListRepositoryAssociationsInput, ...func(*Options)) (*ListRepositoryAssociationsOutput, error) +} + +var _ ListRepositoryAssociationsAPIClient = (*Client)(nil) + +// ListRepositoryAssociationsPaginatorOptions is the paginator options for +// ListRepositoryAssociations +type ListRepositoryAssociationsPaginatorOptions struct { + // The maximum number of repository association results returned by + // ListRepositoryAssociations in paginated output. When this parameter is used, + // ListRepositoryAssociations only returns maxResults results in a single page with + // a nextToken response element. The remaining results of the initial request can + // be seen by sending another ListRepositoryAssociations request with the returned + // nextToken value. This value can be between 1 and 100. If this parameter is not + // used, ListRepositoryAssociations returns up to 100 results and a nextToken value + // if applicable. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListRepositoryAssociationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codegurureviewer.ListRepositoryAssociations +type ListRepositoryAssociationsPaginator struct { + options ListRepositoryAssociationsPaginatorOptions + client ListRepositoryAssociationsAPIClient + params *ListRepositoryAssociationsInput + nextToken *string + firstPage bool + done bool +} + +// NewListRepositoryAssociationsPaginator returns a new +// ListRepositoryAssociationsPaginator +func NewListRepositoryAssociationsPaginator(client ListRepositoryAssociationsAPIClient, params *ListRepositoryAssociationsInput, optFns ...func(*ListRepositoryAssociationsPaginatorOptions)) *ListRepositoryAssociationsPaginator { + options := ListRepositoryAssociationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListRepositoryAssociationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRepositoryAssociationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListRepositoryAssociations page. +func (p *ListRepositoryAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRepositoryAssociationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListRepositoryAssociations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListRecommendationFeedbackAPIClient is a client that implements the +// ListRecommendationFeedback operation. +type ListRecommendationFeedbackAPIClient interface { + ListRecommendationFeedback(context.Context, *ListRecommendationFeedbackInput, ...func(*Options)) (*ListRecommendationFeedbackOutput, error) +} + +var _ ListRecommendationFeedbackAPIClient = (*Client)(nil) + +// ListRecommendationFeedbackPaginatorOptions is the paginator options for +// ListRecommendationFeedback +type ListRecommendationFeedbackPaginatorOptions struct { + // The maximum number of results that are returned per call. The default is 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListRecommendationFeedbackPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codegurureviewer.ListRecommendationFeedback +type ListRecommendationFeedbackPaginator struct { + options ListRecommendationFeedbackPaginatorOptions + client ListRecommendationFeedbackAPIClient + params *ListRecommendationFeedbackInput + nextToken *string + firstPage bool + done bool +} + +// NewListRecommendationFeedbackPaginator returns a new +// ListRecommendationFeedbackPaginator +func NewListRecommendationFeedbackPaginator(client ListRecommendationFeedbackAPIClient, params *ListRecommendationFeedbackInput, optFns ...func(*ListRecommendationFeedbackPaginatorOptions)) *ListRecommendationFeedbackPaginator { + options := ListRecommendationFeedbackPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListRecommendationFeedbackPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRecommendationFeedbackPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListRecommendationFeedback page. +func (p *ListRecommendationFeedbackPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRecommendationFeedbackOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListRecommendationFeedback(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListCodeReviewsAPIClient is a client that implements the ListCodeReviews +// operation. +type ListCodeReviewsAPIClient interface { + ListCodeReviews(context.Context, *ListCodeReviewsInput, ...func(*Options)) (*ListCodeReviewsOutput, error) +} + +var _ ListCodeReviewsAPIClient = (*Client)(nil) + +// ListCodeReviewsPaginatorOptions is the paginator options for ListCodeReviews +type ListCodeReviewsPaginatorOptions struct { + // The maximum number of results that are returned per call. The default is 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListCodeReviewsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codegurureviewer.ListCodeReviews +type ListCodeReviewsPaginator struct { + options ListCodeReviewsPaginatorOptions + client ListCodeReviewsAPIClient + params *ListCodeReviewsInput + nextToken *string + firstPage bool + done bool +} + +// NewListCodeReviewsPaginator returns a new ListCodeReviewsPaginator +func NewListCodeReviewsPaginator(client ListCodeReviewsAPIClient, params *ListCodeReviewsInput, optFns ...func(*ListCodeReviewsPaginatorOptions)) *ListCodeReviewsPaginator { + options := ListCodeReviewsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListCodeReviewsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCodeReviewsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListCodeReviews page. +func (p *ListCodeReviewsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCodeReviewsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListCodeReviews(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/codepipeline/go.sum b/service/codepipeline/go.sum index c669e324b14..32595049f96 100644 --- a/service/codepipeline/go.sum +++ b/service/codepipeline/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/codepipeline/paginators.go b/service/codepipeline/paginators.go new file mode 100644 index 00000000000..dda72931a26 --- /dev/null +++ b/service/codepipeline/paginators.go @@ -0,0 +1,459 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codepipeline + +import ( + "context" + "fmt" +) + +// ListWebhooksAPIClient is a client that implements the ListWebhooks operation. +type ListWebhooksAPIClient interface { + ListWebhooks(context.Context, *ListWebhooksInput, ...func(*Options)) (*ListWebhooksOutput, error) +} + +var _ ListWebhooksAPIClient = (*Client)(nil) + +// ListWebhooksPaginatorOptions is the paginator options for ListWebhooks +type ListWebhooksPaginatorOptions struct { + // The maximum number of results to return in a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListWebhooksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codepipeline.ListWebhooks +type ListWebhooksPaginator struct { + options ListWebhooksPaginatorOptions + client ListWebhooksAPIClient + params *ListWebhooksInput + nextToken *string + firstPage bool + done bool +} + +// NewListWebhooksPaginator returns a new ListWebhooksPaginator +func NewListWebhooksPaginator(client ListWebhooksAPIClient, params *ListWebhooksInput, optFns ...func(*ListWebhooksPaginatorOptions)) *ListWebhooksPaginator { + options := ListWebhooksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListWebhooksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListWebhooksPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListWebhooks page. +func (p *ListWebhooksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListWebhooksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListWebhooks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListActionExecutionsAPIClient is a client that implements the +// ListActionExecutions operation. +type ListActionExecutionsAPIClient interface { + ListActionExecutions(context.Context, *ListActionExecutionsInput, ...func(*Options)) (*ListActionExecutionsOutput, error) +} + +var _ ListActionExecutionsAPIClient = (*Client)(nil) + +// ListActionExecutionsPaginatorOptions is the paginator options for +// ListActionExecutions +type ListActionExecutionsPaginatorOptions struct { + // The maximum number of results to return in a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. Action + // execution history is retained for up to 12 months, based on action execution + // start times. Default value is 100. Detailed execution history is available for + // executions run on or after February 21, 2019. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListActionExecutionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codepipeline.ListActionExecutions +type ListActionExecutionsPaginator struct { + options ListActionExecutionsPaginatorOptions + client ListActionExecutionsAPIClient + params *ListActionExecutionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListActionExecutionsPaginator returns a new ListActionExecutionsPaginator +func NewListActionExecutionsPaginator(client ListActionExecutionsAPIClient, params *ListActionExecutionsInput, optFns ...func(*ListActionExecutionsPaginatorOptions)) *ListActionExecutionsPaginator { + options := ListActionExecutionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListActionExecutionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListActionExecutionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListActionExecutions page. +func (p *ListActionExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListActionExecutionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListActionExecutions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTagsForResourceAPIClient is a client that implements the ListTagsForResource +// operation. +type ListTagsForResourceAPIClient interface { + ListTagsForResource(context.Context, *ListTagsForResourceInput, ...func(*Options)) (*ListTagsForResourceOutput, error) +} + +var _ ListTagsForResourceAPIClient = (*Client)(nil) + +// ListTagsForResourcePaginatorOptions is the paginator options for +// ListTagsForResource +type ListTagsForResourcePaginatorOptions struct { + // The maximum number of results to return in a single call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTagsForResourcePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codepipeline.ListTagsForResource +type ListTagsForResourcePaginator struct { + options ListTagsForResourcePaginatorOptions + client ListTagsForResourceAPIClient + params *ListTagsForResourceInput + nextToken *string + firstPage bool + done bool +} + +// NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator +func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator { + options := ListTagsForResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTagsForResourcePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTagsForResourcePaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTagsForResource page. +func (p *ListTagsForResourcePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListTagsForResource(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListPipelineExecutionsAPIClient is a client that implements the +// ListPipelineExecutions operation. +type ListPipelineExecutionsAPIClient interface { + ListPipelineExecutions(context.Context, *ListPipelineExecutionsInput, ...func(*Options)) (*ListPipelineExecutionsOutput, error) +} + +var _ ListPipelineExecutionsAPIClient = (*Client)(nil) + +// ListPipelineExecutionsPaginatorOptions is the paginator options for +// ListPipelineExecutions +type ListPipelineExecutionsPaginatorOptions struct { + // The maximum number of results to return in a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. Pipeline + // history is limited to the most recent 12 months, based on pipeline execution + // start times. Default value is 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListPipelineExecutionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codepipeline.ListPipelineExecutions +type ListPipelineExecutionsPaginator struct { + options ListPipelineExecutionsPaginatorOptions + client ListPipelineExecutionsAPIClient + params *ListPipelineExecutionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListPipelineExecutionsPaginator returns a new ListPipelineExecutionsPaginator +func NewListPipelineExecutionsPaginator(client ListPipelineExecutionsAPIClient, params *ListPipelineExecutionsInput, optFns ...func(*ListPipelineExecutionsPaginatorOptions)) *ListPipelineExecutionsPaginator { + options := ListPipelineExecutionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListPipelineExecutionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPipelineExecutionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListPipelineExecutions page. +func (p *ListPipelineExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPipelineExecutionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListPipelineExecutions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListPipelinesAPIClient is a client that implements the ListPipelines operation. +type ListPipelinesAPIClient interface { + ListPipelines(context.Context, *ListPipelinesInput, ...func(*Options)) (*ListPipelinesOutput, error) +} + +var _ ListPipelinesAPIClient = (*Client)(nil) + +// ListPipelinesPaginatorOptions is the paginator options for ListPipelines +type ListPipelinesPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListPipelinesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codepipeline.ListPipelines +type ListPipelinesPaginator struct { + options ListPipelinesPaginatorOptions + client ListPipelinesAPIClient + params *ListPipelinesInput + nextToken *string + firstPage bool + done bool +} + +// NewListPipelinesPaginator returns a new ListPipelinesPaginator +func NewListPipelinesPaginator(client ListPipelinesAPIClient, params *ListPipelinesInput, optFns ...func(*ListPipelinesPaginatorOptions)) *ListPipelinesPaginator { + options := ListPipelinesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListPipelinesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPipelinesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListPipelines page. +func (p *ListPipelinesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPipelinesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListPipelines(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListActionTypesAPIClient is a client that implements the ListActionTypes +// operation. +type ListActionTypesAPIClient interface { + ListActionTypes(context.Context, *ListActionTypesInput, ...func(*Options)) (*ListActionTypesOutput, error) +} + +var _ ListActionTypesAPIClient = (*Client)(nil) + +// ListActionTypesPaginatorOptions is the paginator options for ListActionTypes +type ListActionTypesPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListActionTypesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codepipeline.ListActionTypes +type ListActionTypesPaginator struct { + options ListActionTypesPaginatorOptions + client ListActionTypesAPIClient + params *ListActionTypesInput + nextToken *string + firstPage bool + done bool +} + +// NewListActionTypesPaginator returns a new ListActionTypesPaginator +func NewListActionTypesPaginator(client ListActionTypesAPIClient, params *ListActionTypesInput, optFns ...func(*ListActionTypesPaginatorOptions)) *ListActionTypesPaginator { + options := ListActionTypesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListActionTypesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListActionTypesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListActionTypes page. +func (p *ListActionTypesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListActionTypesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListActionTypes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/codestar/go.sum b/service/codestar/go.sum index c669e324b14..32595049f96 100644 --- a/service/codestar/go.sum +++ b/service/codestar/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/codestarconnections/go.sum b/service/codestarconnections/go.sum index c669e324b14..32595049f96 100644 --- a/service/codestarconnections/go.sum +++ b/service/codestarconnections/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/codestarconnections/paginators.go b/service/codestarconnections/paginators.go new file mode 100644 index 00000000000..a8f6d7c8205 --- /dev/null +++ b/service/codestarconnections/paginators.go @@ -0,0 +1,159 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codestarconnections + +import ( + "context" + "fmt" +) + +// ListHostsAPIClient is a client that implements the ListHosts operation. +type ListHostsAPIClient interface { + ListHosts(context.Context, *ListHostsInput, ...func(*Options)) (*ListHostsOutput, error) +} + +var _ ListHostsAPIClient = (*Client)(nil) + +// ListHostsPaginatorOptions is the paginator options for ListHosts +type ListHostsPaginatorOptions struct { + // The maximum number of results to return in a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListHostsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codestarconnections.ListHosts +type ListHostsPaginator struct { + options ListHostsPaginatorOptions + client ListHostsAPIClient + params *ListHostsInput + nextToken *string + firstPage bool + done bool +} + +// NewListHostsPaginator returns a new ListHostsPaginator +func NewListHostsPaginator(client ListHostsAPIClient, params *ListHostsInput, optFns ...func(*ListHostsPaginatorOptions)) *ListHostsPaginator { + options := ListHostsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListHostsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListHostsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListHosts page. +func (p *ListHostsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListHostsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListHosts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListConnectionsAPIClient is a client that implements the ListConnections +// operation. +type ListConnectionsAPIClient interface { + ListConnections(context.Context, *ListConnectionsInput, ...func(*Options)) (*ListConnectionsOutput, error) +} + +var _ ListConnectionsAPIClient = (*Client)(nil) + +// ListConnectionsPaginatorOptions is the paginator options for ListConnections +type ListConnectionsPaginatorOptions struct { + // The maximum number of results to return in a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListConnectionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codestarconnections.ListConnections +type ListConnectionsPaginator struct { + options ListConnectionsPaginatorOptions + client ListConnectionsAPIClient + params *ListConnectionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListConnectionsPaginator returns a new ListConnectionsPaginator +func NewListConnectionsPaginator(client ListConnectionsAPIClient, params *ListConnectionsInput, optFns ...func(*ListConnectionsPaginatorOptions)) *ListConnectionsPaginator { + options := ListConnectionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListConnectionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListConnectionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListConnections page. +func (p *ListConnectionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListConnectionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListConnections(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/codestarnotifications/go.sum b/service/codestarnotifications/go.sum index c669e324b14..32595049f96 100644 --- a/service/codestarnotifications/go.sum +++ b/service/codestarnotifications/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/codestarnotifications/paginators.go b/service/codestarnotifications/paginators.go new file mode 100644 index 00000000000..d9c27b59085 --- /dev/null +++ b/service/codestarnotifications/paginators.go @@ -0,0 +1,236 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codestarnotifications + +import ( + "context" + "fmt" +) + +// ListEventTypesAPIClient is a client that implements the ListEventTypes +// operation. +type ListEventTypesAPIClient interface { + ListEventTypes(context.Context, *ListEventTypesInput, ...func(*Options)) (*ListEventTypesOutput, error) +} + +var _ ListEventTypesAPIClient = (*Client)(nil) + +// ListEventTypesPaginatorOptions is the paginator options for ListEventTypes +type ListEventTypesPaginatorOptions struct { + // A non-negative integer used to limit the number of returned results. The default + // number is 50. The maximum number of results that can be returned is 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListEventTypesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codestarnotifications.ListEventTypes +type ListEventTypesPaginator struct { + options ListEventTypesPaginatorOptions + client ListEventTypesAPIClient + params *ListEventTypesInput + nextToken *string + firstPage bool + done bool +} + +// NewListEventTypesPaginator returns a new ListEventTypesPaginator +func NewListEventTypesPaginator(client ListEventTypesAPIClient, params *ListEventTypesInput, optFns ...func(*ListEventTypesPaginatorOptions)) *ListEventTypesPaginator { + options := ListEventTypesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListEventTypesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListEventTypesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListEventTypes page. +func (p *ListEventTypesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEventTypesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListEventTypes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTargetsAPIClient is a client that implements the ListTargets operation. +type ListTargetsAPIClient interface { + ListTargets(context.Context, *ListTargetsInput, ...func(*Options)) (*ListTargetsOutput, error) +} + +var _ ListTargetsAPIClient = (*Client)(nil) + +// ListTargetsPaginatorOptions is the paginator options for ListTargets +type ListTargetsPaginatorOptions struct { + // A non-negative integer used to limit the number of returned results. The maximum + // number of results that can be returned is 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTargetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codestarnotifications.ListTargets +type ListTargetsPaginator struct { + options ListTargetsPaginatorOptions + client ListTargetsAPIClient + params *ListTargetsInput + nextToken *string + firstPage bool + done bool +} + +// NewListTargetsPaginator returns a new ListTargetsPaginator +func NewListTargetsPaginator(client ListTargetsAPIClient, params *ListTargetsInput, optFns ...func(*ListTargetsPaginatorOptions)) *ListTargetsPaginator { + options := ListTargetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTargetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTargetsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTargets page. +func (p *ListTargetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTargetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListTargets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListNotificationRulesAPIClient is a client that implements the +// ListNotificationRules operation. +type ListNotificationRulesAPIClient interface { + ListNotificationRules(context.Context, *ListNotificationRulesInput, ...func(*Options)) (*ListNotificationRulesOutput, error) +} + +var _ ListNotificationRulesAPIClient = (*Client)(nil) + +// ListNotificationRulesPaginatorOptions is the paginator options for +// ListNotificationRules +type ListNotificationRulesPaginatorOptions struct { + // A non-negative integer used to limit the number of returned results. The maximum + // number of results that can be returned is 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListNotificationRulesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codestarnotifications.ListNotificationRules +type ListNotificationRulesPaginator struct { + options ListNotificationRulesPaginatorOptions + client ListNotificationRulesAPIClient + params *ListNotificationRulesInput + nextToken *string + firstPage bool + done bool +} + +// NewListNotificationRulesPaginator returns a new ListNotificationRulesPaginator +func NewListNotificationRulesPaginator(client ListNotificationRulesAPIClient, params *ListNotificationRulesInput, optFns ...func(*ListNotificationRulesPaginatorOptions)) *ListNotificationRulesPaginator { + options := ListNotificationRulesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListNotificationRulesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListNotificationRulesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListNotificationRules page. +func (p *ListNotificationRulesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListNotificationRulesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListNotificationRules(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/cognitoidentity/go.sum b/service/cognitoidentity/go.sum index c669e324b14..32595049f96 100644 --- a/service/cognitoidentity/go.sum +++ b/service/cognitoidentity/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/cognitoidentityprovider/go.sum b/service/cognitoidentityprovider/go.sum index c669e324b14..32595049f96 100644 --- a/service/cognitoidentityprovider/go.sum +++ b/service/cognitoidentityprovider/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/cognitoidentityprovider/paginators.go b/service/cognitoidentityprovider/paginators.go new file mode 100644 index 00000000000..223a228eb26 --- /dev/null +++ b/service/cognitoidentityprovider/paginators.go @@ -0,0 +1,613 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cognitoidentityprovider + +import ( + "context" + "fmt" +) + +// AdminListUserAuthEventsAPIClient is a client that implements the +// AdminListUserAuthEvents operation. +type AdminListUserAuthEventsAPIClient interface { + AdminListUserAuthEvents(context.Context, *AdminListUserAuthEventsInput, ...func(*Options)) (*AdminListUserAuthEventsOutput, error) +} + +var _ AdminListUserAuthEventsAPIClient = (*Client)(nil) + +// AdminListUserAuthEventsPaginatorOptions is the paginator options for +// AdminListUserAuthEvents +type AdminListUserAuthEventsPaginatorOptions struct { + // The maximum number of authentication events to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// AdminListUserAuthEventsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider.AdminListUserAuthEvents +type AdminListUserAuthEventsPaginator struct { + options AdminListUserAuthEventsPaginatorOptions + client AdminListUserAuthEventsAPIClient + params *AdminListUserAuthEventsInput + nextToken *string + firstPage bool + done bool +} + +// NewAdminListUserAuthEventsPaginator returns a new +// AdminListUserAuthEventsPaginator +func NewAdminListUserAuthEventsPaginator(client AdminListUserAuthEventsAPIClient, params *AdminListUserAuthEventsInput, optFns ...func(*AdminListUserAuthEventsPaginatorOptions)) *AdminListUserAuthEventsPaginator { + options := AdminListUserAuthEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &AdminListUserAuthEventsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *AdminListUserAuthEventsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next AdminListUserAuthEvents page. +func (p *AdminListUserAuthEventsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*AdminListUserAuthEventsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.AdminListUserAuthEvents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListGroupsAPIClient is a client that implements the ListGroups operation. +type ListGroupsAPIClient interface { + ListGroups(context.Context, *ListGroupsInput, ...func(*Options)) (*ListGroupsOutput, error) +} + +var _ ListGroupsAPIClient = (*Client)(nil) + +// ListGroupsPaginatorOptions is the paginator options for ListGroups +type ListGroupsPaginatorOptions struct { + // The limit of the request to list groups. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider.ListGroups +type ListGroupsPaginator struct { + options ListGroupsPaginatorOptions + client ListGroupsAPIClient + params *ListGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewListGroupsPaginator returns a new ListGroupsPaginator +func NewListGroupsPaginator(client ListGroupsAPIClient, params *ListGroupsInput, optFns ...func(*ListGroupsPaginatorOptions)) *ListGroupsPaginator { + options := ListGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListGroups page. +func (p *ListGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.ListGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListUsersInGroupAPIClient is a client that implements the ListUsersInGroup +// operation. +type ListUsersInGroupAPIClient interface { + ListUsersInGroup(context.Context, *ListUsersInGroupInput, ...func(*Options)) (*ListUsersInGroupOutput, error) +} + +var _ ListUsersInGroupAPIClient = (*Client)(nil) + +// ListUsersInGroupPaginatorOptions is the paginator options for ListUsersInGroup +type ListUsersInGroupPaginatorOptions struct { + // The limit of the request to list users. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListUsersInGroupPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider.ListUsersInGroup +type ListUsersInGroupPaginator struct { + options ListUsersInGroupPaginatorOptions + client ListUsersInGroupAPIClient + params *ListUsersInGroupInput + nextToken *string + firstPage bool + done bool +} + +// NewListUsersInGroupPaginator returns a new ListUsersInGroupPaginator +func NewListUsersInGroupPaginator(client ListUsersInGroupAPIClient, params *ListUsersInGroupInput, optFns ...func(*ListUsersInGroupPaginatorOptions)) *ListUsersInGroupPaginator { + options := ListUsersInGroupPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListUsersInGroupPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListUsersInGroupPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListUsersInGroup page. +func (p *ListUsersInGroupPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListUsersInGroupOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.ListUsersInGroup(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListUserPoolClientsAPIClient is a client that implements the ListUserPoolClients +// operation. +type ListUserPoolClientsAPIClient interface { + ListUserPoolClients(context.Context, *ListUserPoolClientsInput, ...func(*Options)) (*ListUserPoolClientsOutput, error) +} + +var _ ListUserPoolClientsAPIClient = (*Client)(nil) + +// ListUserPoolClientsPaginatorOptions is the paginator options for +// ListUserPoolClients +type ListUserPoolClientsPaginatorOptions struct { + // The maximum number of results you want the request to return when listing the + // user pool clients. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListUserPoolClientsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider.ListUserPoolClients +type ListUserPoolClientsPaginator struct { + options ListUserPoolClientsPaginatorOptions + client ListUserPoolClientsAPIClient + params *ListUserPoolClientsInput + nextToken *string + firstPage bool + done bool +} + +// NewListUserPoolClientsPaginator returns a new ListUserPoolClientsPaginator +func NewListUserPoolClientsPaginator(client ListUserPoolClientsAPIClient, params *ListUserPoolClientsInput, optFns ...func(*ListUserPoolClientsPaginatorOptions)) *ListUserPoolClientsPaginator { + options := ListUserPoolClientsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListUserPoolClientsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListUserPoolClientsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListUserPoolClients page. +func (p *ListUserPoolClientsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListUserPoolClientsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListUserPoolClients(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListIdentityProvidersAPIClient is a client that implements the +// ListIdentityProviders operation. +type ListIdentityProvidersAPIClient interface { + ListIdentityProviders(context.Context, *ListIdentityProvidersInput, ...func(*Options)) (*ListIdentityProvidersOutput, error) +} + +var _ ListIdentityProvidersAPIClient = (*Client)(nil) + +// ListIdentityProvidersPaginatorOptions is the paginator options for +// ListIdentityProviders +type ListIdentityProvidersPaginatorOptions struct { + // The maximum number of identity providers to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListIdentityProvidersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider.ListIdentityProviders +type ListIdentityProvidersPaginator struct { + options ListIdentityProvidersPaginatorOptions + client ListIdentityProvidersAPIClient + params *ListIdentityProvidersInput + nextToken *string + firstPage bool + done bool +} + +// NewListIdentityProvidersPaginator returns a new ListIdentityProvidersPaginator +func NewListIdentityProvidersPaginator(client ListIdentityProvidersAPIClient, params *ListIdentityProvidersInput, optFns ...func(*ListIdentityProvidersPaginatorOptions)) *ListIdentityProvidersPaginator { + options := ListIdentityProvidersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListIdentityProvidersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListIdentityProvidersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListIdentityProviders page. +func (p *ListIdentityProvidersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListIdentityProvidersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListIdentityProviders(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListUsersAPIClient is a client that implements the ListUsers operation. +type ListUsersAPIClient interface { + ListUsers(context.Context, *ListUsersInput, ...func(*Options)) (*ListUsersOutput, error) +} + +var _ ListUsersAPIClient = (*Client)(nil) + +// ListUsersPaginatorOptions is the paginator options for ListUsers +type ListUsersPaginatorOptions struct { + // Maximum number of users to be returned. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListUsersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider.ListUsers +type ListUsersPaginator struct { + options ListUsersPaginatorOptions + client ListUsersAPIClient + params *ListUsersInput + nextToken *string + firstPage bool + done bool +} + +// NewListUsersPaginator returns a new ListUsersPaginator +func NewListUsersPaginator(client ListUsersAPIClient, params *ListUsersInput, optFns ...func(*ListUsersPaginatorOptions)) *ListUsersPaginator { + options := ListUsersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListUsersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListUsersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListUsers page. +func (p *ListUsersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListUsersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PaginationToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.ListUsers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.PaginationToken + if p.options.StopOnDuplicateToken && params.PaginationToken != nil && p.nextToken != nil && *params.PaginationToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// AdminListGroupsForUserAPIClient is a client that implements the +// AdminListGroupsForUser operation. +type AdminListGroupsForUserAPIClient interface { + AdminListGroupsForUser(context.Context, *AdminListGroupsForUserInput, ...func(*Options)) (*AdminListGroupsForUserOutput, error) +} + +var _ AdminListGroupsForUserAPIClient = (*Client)(nil) + +// AdminListGroupsForUserPaginatorOptions is the paginator options for +// AdminListGroupsForUser +type AdminListGroupsForUserPaginatorOptions struct { + // The limit of the request to list groups. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// AdminListGroupsForUserPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider.AdminListGroupsForUser +type AdminListGroupsForUserPaginator struct { + options AdminListGroupsForUserPaginatorOptions + client AdminListGroupsForUserAPIClient + params *AdminListGroupsForUserInput + nextToken *string + firstPage bool + done bool +} + +// NewAdminListGroupsForUserPaginator returns a new AdminListGroupsForUserPaginator +func NewAdminListGroupsForUserPaginator(client AdminListGroupsForUserAPIClient, params *AdminListGroupsForUserInput, optFns ...func(*AdminListGroupsForUserPaginatorOptions)) *AdminListGroupsForUserPaginator { + options := AdminListGroupsForUserPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &AdminListGroupsForUserPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *AdminListGroupsForUserPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next AdminListGroupsForUser page. +func (p *AdminListGroupsForUserPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*AdminListGroupsForUserOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.AdminListGroupsForUser(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListResourceServersAPIClient is a client that implements the ListResourceServers +// operation. +type ListResourceServersAPIClient interface { + ListResourceServers(context.Context, *ListResourceServersInput, ...func(*Options)) (*ListResourceServersOutput, error) +} + +var _ ListResourceServersAPIClient = (*Client)(nil) + +// ListResourceServersPaginatorOptions is the paginator options for +// ListResourceServers +type ListResourceServersPaginatorOptions struct { + // The maximum number of resource servers to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListResourceServersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider.ListResourceServers +type ListResourceServersPaginator struct { + options ListResourceServersPaginatorOptions + client ListResourceServersAPIClient + params *ListResourceServersInput + nextToken *string + firstPage bool + done bool +} + +// NewListResourceServersPaginator returns a new ListResourceServersPaginator +func NewListResourceServersPaginator(client ListResourceServersAPIClient, params *ListResourceServersInput, optFns ...func(*ListResourceServersPaginatorOptions)) *ListResourceServersPaginator { + options := ListResourceServersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListResourceServersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListResourceServersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListResourceServers page. +func (p *ListResourceServersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListResourceServersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListResourceServers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/cognitosync/go.sum b/service/cognitosync/go.sum index c669e324b14..32595049f96 100644 --- a/service/cognitosync/go.sum +++ b/service/cognitosync/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/comprehend/go.sum b/service/comprehend/go.sum index c669e324b14..32595049f96 100644 --- a/service/comprehend/go.sum +++ b/service/comprehend/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/comprehend/paginators.go b/service/comprehend/paginators.go new file mode 100644 index 00000000000..4b8a5095a05 --- /dev/null +++ b/service/comprehend/paginators.go @@ -0,0 +1,623 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package comprehend + +import ( + "context" + "fmt" +) + +// ListKeyPhrasesDetectionJobsAPIClient is a client that implements the +// ListKeyPhrasesDetectionJobs operation. +type ListKeyPhrasesDetectionJobsAPIClient interface { + ListKeyPhrasesDetectionJobs(context.Context, *ListKeyPhrasesDetectionJobsInput, ...func(*Options)) (*ListKeyPhrasesDetectionJobsOutput, error) +} + +var _ ListKeyPhrasesDetectionJobsAPIClient = (*Client)(nil) + +// ListKeyPhrasesDetectionJobsPaginatorOptions is the paginator options for +// ListKeyPhrasesDetectionJobs +type ListKeyPhrasesDetectionJobsPaginatorOptions struct { + // The maximum number of results to return in each page. The default is 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListKeyPhrasesDetectionJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/comprehend.ListKeyPhrasesDetectionJobs +type ListKeyPhrasesDetectionJobsPaginator struct { + options ListKeyPhrasesDetectionJobsPaginatorOptions + client ListKeyPhrasesDetectionJobsAPIClient + params *ListKeyPhrasesDetectionJobsInput + nextToken *string + firstPage bool + done bool +} + +// NewListKeyPhrasesDetectionJobsPaginator returns a new +// ListKeyPhrasesDetectionJobsPaginator +func NewListKeyPhrasesDetectionJobsPaginator(client ListKeyPhrasesDetectionJobsAPIClient, params *ListKeyPhrasesDetectionJobsInput, optFns ...func(*ListKeyPhrasesDetectionJobsPaginatorOptions)) *ListKeyPhrasesDetectionJobsPaginator { + options := ListKeyPhrasesDetectionJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListKeyPhrasesDetectionJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListKeyPhrasesDetectionJobsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListKeyPhrasesDetectionJobs page. +func (p *ListKeyPhrasesDetectionJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListKeyPhrasesDetectionJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListKeyPhrasesDetectionJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDocumentClassificationJobsAPIClient is a client that implements the +// ListDocumentClassificationJobs operation. +type ListDocumentClassificationJobsAPIClient interface { + ListDocumentClassificationJobs(context.Context, *ListDocumentClassificationJobsInput, ...func(*Options)) (*ListDocumentClassificationJobsOutput, error) +} + +var _ ListDocumentClassificationJobsAPIClient = (*Client)(nil) + +// ListDocumentClassificationJobsPaginatorOptions is the paginator options for +// ListDocumentClassificationJobs +type ListDocumentClassificationJobsPaginatorOptions struct { + // The maximum number of results to return in each page. The default is 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDocumentClassificationJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/comprehend.ListDocumentClassificationJobs +type ListDocumentClassificationJobsPaginator struct { + options ListDocumentClassificationJobsPaginatorOptions + client ListDocumentClassificationJobsAPIClient + params *ListDocumentClassificationJobsInput + nextToken *string + firstPage bool + done bool +} + +// NewListDocumentClassificationJobsPaginator returns a new +// ListDocumentClassificationJobsPaginator +func NewListDocumentClassificationJobsPaginator(client ListDocumentClassificationJobsAPIClient, params *ListDocumentClassificationJobsInput, optFns ...func(*ListDocumentClassificationJobsPaginatorOptions)) *ListDocumentClassificationJobsPaginator { + options := ListDocumentClassificationJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDocumentClassificationJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDocumentClassificationJobsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDocumentClassificationJobs page. +func (p *ListDocumentClassificationJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDocumentClassificationJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListDocumentClassificationJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListSentimentDetectionJobsAPIClient is a client that implements the +// ListSentimentDetectionJobs operation. +type ListSentimentDetectionJobsAPIClient interface { + ListSentimentDetectionJobs(context.Context, *ListSentimentDetectionJobsInput, ...func(*Options)) (*ListSentimentDetectionJobsOutput, error) +} + +var _ ListSentimentDetectionJobsAPIClient = (*Client)(nil) + +// ListSentimentDetectionJobsPaginatorOptions is the paginator options for +// ListSentimentDetectionJobs +type ListSentimentDetectionJobsPaginatorOptions struct { + // The maximum number of results to return in each page. The default is 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListSentimentDetectionJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/comprehend.ListSentimentDetectionJobs +type ListSentimentDetectionJobsPaginator struct { + options ListSentimentDetectionJobsPaginatorOptions + client ListSentimentDetectionJobsAPIClient + params *ListSentimentDetectionJobsInput + nextToken *string + firstPage bool + done bool +} + +// NewListSentimentDetectionJobsPaginator returns a new +// ListSentimentDetectionJobsPaginator +func NewListSentimentDetectionJobsPaginator(client ListSentimentDetectionJobsAPIClient, params *ListSentimentDetectionJobsInput, optFns ...func(*ListSentimentDetectionJobsPaginatorOptions)) *ListSentimentDetectionJobsPaginator { + options := ListSentimentDetectionJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListSentimentDetectionJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSentimentDetectionJobsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListSentimentDetectionJobs page. +func (p *ListSentimentDetectionJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSentimentDetectionJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListSentimentDetectionJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDocumentClassifiersAPIClient is a client that implements the +// ListDocumentClassifiers operation. +type ListDocumentClassifiersAPIClient interface { + ListDocumentClassifiers(context.Context, *ListDocumentClassifiersInput, ...func(*Options)) (*ListDocumentClassifiersOutput, error) +} + +var _ ListDocumentClassifiersAPIClient = (*Client)(nil) + +// ListDocumentClassifiersPaginatorOptions is the paginator options for +// ListDocumentClassifiers +type ListDocumentClassifiersPaginatorOptions struct { + // The maximum number of results to return in each page. The default is 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDocumentClassifiersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/comprehend.ListDocumentClassifiers +type ListDocumentClassifiersPaginator struct { + options ListDocumentClassifiersPaginatorOptions + client ListDocumentClassifiersAPIClient + params *ListDocumentClassifiersInput + nextToken *string + firstPage bool + done bool +} + +// NewListDocumentClassifiersPaginator returns a new +// ListDocumentClassifiersPaginator +func NewListDocumentClassifiersPaginator(client ListDocumentClassifiersAPIClient, params *ListDocumentClassifiersInput, optFns ...func(*ListDocumentClassifiersPaginatorOptions)) *ListDocumentClassifiersPaginator { + options := ListDocumentClassifiersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDocumentClassifiersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDocumentClassifiersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDocumentClassifiers page. +func (p *ListDocumentClassifiersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDocumentClassifiersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListDocumentClassifiers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDominantLanguageDetectionJobsAPIClient is a client that implements the +// ListDominantLanguageDetectionJobs operation. +type ListDominantLanguageDetectionJobsAPIClient interface { + ListDominantLanguageDetectionJobs(context.Context, *ListDominantLanguageDetectionJobsInput, ...func(*Options)) (*ListDominantLanguageDetectionJobsOutput, error) +} + +var _ ListDominantLanguageDetectionJobsAPIClient = (*Client)(nil) + +// ListDominantLanguageDetectionJobsPaginatorOptions is the paginator options for +// ListDominantLanguageDetectionJobs +type ListDominantLanguageDetectionJobsPaginatorOptions struct { + // The maximum number of results to return in each page. The default is 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDominantLanguageDetectionJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/comprehend.ListDominantLanguageDetectionJobs +type ListDominantLanguageDetectionJobsPaginator struct { + options ListDominantLanguageDetectionJobsPaginatorOptions + client ListDominantLanguageDetectionJobsAPIClient + params *ListDominantLanguageDetectionJobsInput + nextToken *string + firstPage bool + done bool +} + +// NewListDominantLanguageDetectionJobsPaginator returns a new +// ListDominantLanguageDetectionJobsPaginator +func NewListDominantLanguageDetectionJobsPaginator(client ListDominantLanguageDetectionJobsAPIClient, params *ListDominantLanguageDetectionJobsInput, optFns ...func(*ListDominantLanguageDetectionJobsPaginatorOptions)) *ListDominantLanguageDetectionJobsPaginator { + options := ListDominantLanguageDetectionJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDominantLanguageDetectionJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDominantLanguageDetectionJobsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDominantLanguageDetectionJobs page. +func (p *ListDominantLanguageDetectionJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDominantLanguageDetectionJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListDominantLanguageDetectionJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTopicsDetectionJobsAPIClient is a client that implements the +// ListTopicsDetectionJobs operation. +type ListTopicsDetectionJobsAPIClient interface { + ListTopicsDetectionJobs(context.Context, *ListTopicsDetectionJobsInput, ...func(*Options)) (*ListTopicsDetectionJobsOutput, error) +} + +var _ ListTopicsDetectionJobsAPIClient = (*Client)(nil) + +// ListTopicsDetectionJobsPaginatorOptions is the paginator options for +// ListTopicsDetectionJobs +type ListTopicsDetectionJobsPaginatorOptions struct { + // The maximum number of results to return in each page. The default is 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTopicsDetectionJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/comprehend.ListTopicsDetectionJobs +type ListTopicsDetectionJobsPaginator struct { + options ListTopicsDetectionJobsPaginatorOptions + client ListTopicsDetectionJobsAPIClient + params *ListTopicsDetectionJobsInput + nextToken *string + firstPage bool + done bool +} + +// NewListTopicsDetectionJobsPaginator returns a new +// ListTopicsDetectionJobsPaginator +func NewListTopicsDetectionJobsPaginator(client ListTopicsDetectionJobsAPIClient, params *ListTopicsDetectionJobsInput, optFns ...func(*ListTopicsDetectionJobsPaginatorOptions)) *ListTopicsDetectionJobsPaginator { + options := ListTopicsDetectionJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTopicsDetectionJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTopicsDetectionJobsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTopicsDetectionJobs page. +func (p *ListTopicsDetectionJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTopicsDetectionJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListTopicsDetectionJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListEntityRecognizersAPIClient is a client that implements the +// ListEntityRecognizers operation. +type ListEntityRecognizersAPIClient interface { + ListEntityRecognizers(context.Context, *ListEntityRecognizersInput, ...func(*Options)) (*ListEntityRecognizersOutput, error) +} + +var _ ListEntityRecognizersAPIClient = (*Client)(nil) + +// ListEntityRecognizersPaginatorOptions is the paginator options for +// ListEntityRecognizers +type ListEntityRecognizersPaginatorOptions struct { + // The maximum number of results to return on each page. The default is 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListEntityRecognizersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/comprehend.ListEntityRecognizers +type ListEntityRecognizersPaginator struct { + options ListEntityRecognizersPaginatorOptions + client ListEntityRecognizersAPIClient + params *ListEntityRecognizersInput + nextToken *string + firstPage bool + done bool +} + +// NewListEntityRecognizersPaginator returns a new ListEntityRecognizersPaginator +func NewListEntityRecognizersPaginator(client ListEntityRecognizersAPIClient, params *ListEntityRecognizersInput, optFns ...func(*ListEntityRecognizersPaginatorOptions)) *ListEntityRecognizersPaginator { + options := ListEntityRecognizersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListEntityRecognizersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListEntityRecognizersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListEntityRecognizers page. +func (p *ListEntityRecognizersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEntityRecognizersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListEntityRecognizers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListEntitiesDetectionJobsAPIClient is a client that implements the +// ListEntitiesDetectionJobs operation. +type ListEntitiesDetectionJobsAPIClient interface { + ListEntitiesDetectionJobs(context.Context, *ListEntitiesDetectionJobsInput, ...func(*Options)) (*ListEntitiesDetectionJobsOutput, error) +} + +var _ ListEntitiesDetectionJobsAPIClient = (*Client)(nil) + +// ListEntitiesDetectionJobsPaginatorOptions is the paginator options for +// ListEntitiesDetectionJobs +type ListEntitiesDetectionJobsPaginatorOptions struct { + // The maximum number of results to return in each page. The default is 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListEntitiesDetectionJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/comprehend.ListEntitiesDetectionJobs +type ListEntitiesDetectionJobsPaginator struct { + options ListEntitiesDetectionJobsPaginatorOptions + client ListEntitiesDetectionJobsAPIClient + params *ListEntitiesDetectionJobsInput + nextToken *string + firstPage bool + done bool +} + +// NewListEntitiesDetectionJobsPaginator returns a new +// ListEntitiesDetectionJobsPaginator +func NewListEntitiesDetectionJobsPaginator(client ListEntitiesDetectionJobsAPIClient, params *ListEntitiesDetectionJobsInput, optFns ...func(*ListEntitiesDetectionJobsPaginatorOptions)) *ListEntitiesDetectionJobsPaginator { + options := ListEntitiesDetectionJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListEntitiesDetectionJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListEntitiesDetectionJobsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListEntitiesDetectionJobs page. +func (p *ListEntitiesDetectionJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEntitiesDetectionJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListEntitiesDetectionJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/comprehendmedical/go.sum b/service/comprehendmedical/go.sum index c669e324b14..32595049f96 100644 --- a/service/comprehendmedical/go.sum +++ b/service/comprehendmedical/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/computeoptimizer/go.sum b/service/computeoptimizer/go.sum index c669e324b14..32595049f96 100644 --- a/service/computeoptimizer/go.sum +++ b/service/computeoptimizer/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/configservice/go.sum b/service/configservice/go.sum index c669e324b14..32595049f96 100644 --- a/service/configservice/go.sum +++ b/service/configservice/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/configservice/paginators.go b/service/configservice/paginators.go new file mode 100644 index 00000000000..ae2e154c639 --- /dev/null +++ b/service/configservice/paginators.go @@ -0,0 +1,321 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package configservice + +import ( + "context" + "fmt" +) + +// DescribeRemediationExceptionsAPIClient is a client that implements the +// DescribeRemediationExceptions operation. +type DescribeRemediationExceptionsAPIClient interface { + DescribeRemediationExceptions(context.Context, *DescribeRemediationExceptionsInput, ...func(*Options)) (*DescribeRemediationExceptionsOutput, error) +} + +var _ DescribeRemediationExceptionsAPIClient = (*Client)(nil) + +// DescribeRemediationExceptionsPaginatorOptions is the paginator options for +// DescribeRemediationExceptions +type DescribeRemediationExceptionsPaginatorOptions struct { + // The maximum number of RemediationExceptionResourceKey returned on each page. The + // default is 25. If you specify 0, AWS Config uses the default. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeRemediationExceptionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/configservice.DescribeRemediationExceptions +type DescribeRemediationExceptionsPaginator struct { + options DescribeRemediationExceptionsPaginatorOptions + client DescribeRemediationExceptionsAPIClient + params *DescribeRemediationExceptionsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeRemediationExceptionsPaginator returns a new +// DescribeRemediationExceptionsPaginator +func NewDescribeRemediationExceptionsPaginator(client DescribeRemediationExceptionsAPIClient, params *DescribeRemediationExceptionsInput, optFns ...func(*DescribeRemediationExceptionsPaginatorOptions)) *DescribeRemediationExceptionsPaginator { + options := DescribeRemediationExceptionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeRemediationExceptionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeRemediationExceptionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeRemediationExceptions page. +func (p *DescribeRemediationExceptionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeRemediationExceptionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.DescribeRemediationExceptions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeRemediationExecutionStatusAPIClient is a client that implements the +// DescribeRemediationExecutionStatus operation. +type DescribeRemediationExecutionStatusAPIClient interface { + DescribeRemediationExecutionStatus(context.Context, *DescribeRemediationExecutionStatusInput, ...func(*Options)) (*DescribeRemediationExecutionStatusOutput, error) +} + +var _ DescribeRemediationExecutionStatusAPIClient = (*Client)(nil) + +// DescribeRemediationExecutionStatusPaginatorOptions is the paginator options for +// DescribeRemediationExecutionStatus +type DescribeRemediationExecutionStatusPaginatorOptions struct { + // The maximum number of RemediationExecutionStatuses returned on each page. The + // default is maximum. If you specify 0, AWS Config uses the default. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeRemediationExecutionStatusPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/configservice.DescribeRemediationExecutionStatus +type DescribeRemediationExecutionStatusPaginator struct { + options DescribeRemediationExecutionStatusPaginatorOptions + client DescribeRemediationExecutionStatusAPIClient + params *DescribeRemediationExecutionStatusInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeRemediationExecutionStatusPaginator returns a new +// DescribeRemediationExecutionStatusPaginator +func NewDescribeRemediationExecutionStatusPaginator(client DescribeRemediationExecutionStatusAPIClient, params *DescribeRemediationExecutionStatusInput, optFns ...func(*DescribeRemediationExecutionStatusPaginatorOptions)) *DescribeRemediationExecutionStatusPaginator { + options := DescribeRemediationExecutionStatusPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeRemediationExecutionStatusPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeRemediationExecutionStatusPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeRemediationExecutionStatus page. +func (p *DescribeRemediationExecutionStatusPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeRemediationExecutionStatusOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.DescribeRemediationExecutionStatus(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// SelectAggregateResourceConfigAPIClient is a client that implements the +// SelectAggregateResourceConfig operation. +type SelectAggregateResourceConfigAPIClient interface { + SelectAggregateResourceConfig(context.Context, *SelectAggregateResourceConfigInput, ...func(*Options)) (*SelectAggregateResourceConfigOutput, error) +} + +var _ SelectAggregateResourceConfigAPIClient = (*Client)(nil) + +// SelectAggregateResourceConfigPaginatorOptions is the paginator options for +// SelectAggregateResourceConfig +type SelectAggregateResourceConfigPaginatorOptions struct { + // The maximum number of query results returned on each page. AWS Config also + // allows the Limit request parameter. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// SelectAggregateResourceConfigPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/configservice.SelectAggregateResourceConfig +type SelectAggregateResourceConfigPaginator struct { + options SelectAggregateResourceConfigPaginatorOptions + client SelectAggregateResourceConfigAPIClient + params *SelectAggregateResourceConfigInput + nextToken *string + firstPage bool + done bool +} + +// NewSelectAggregateResourceConfigPaginator returns a new +// SelectAggregateResourceConfigPaginator +func NewSelectAggregateResourceConfigPaginator(client SelectAggregateResourceConfigAPIClient, params *SelectAggregateResourceConfigInput, optFns ...func(*SelectAggregateResourceConfigPaginatorOptions)) *SelectAggregateResourceConfigPaginator { + options := SelectAggregateResourceConfigPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &SelectAggregateResourceConfigPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SelectAggregateResourceConfigPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next SelectAggregateResourceConfig page. +func (p *SelectAggregateResourceConfigPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SelectAggregateResourceConfigOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.SelectAggregateResourceConfig(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetResourceConfigHistoryAPIClient is a client that implements the +// GetResourceConfigHistory operation. +type GetResourceConfigHistoryAPIClient interface { + GetResourceConfigHistory(context.Context, *GetResourceConfigHistoryInput, ...func(*Options)) (*GetResourceConfigHistoryOutput, error) +} + +var _ GetResourceConfigHistoryAPIClient = (*Client)(nil) + +// GetResourceConfigHistoryPaginatorOptions is the paginator options for +// GetResourceConfigHistory +type GetResourceConfigHistoryPaginatorOptions struct { + // The maximum number of configuration items returned on each page. The default is + // 10. You cannot specify a number greater than 100. If you specify 0, AWS Config + // uses the default. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetResourceConfigHistoryPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/configservice.GetResourceConfigHistory +type GetResourceConfigHistoryPaginator struct { + options GetResourceConfigHistoryPaginatorOptions + client GetResourceConfigHistoryAPIClient + params *GetResourceConfigHistoryInput + nextToken *string + firstPage bool + done bool +} + +// NewGetResourceConfigHistoryPaginator returns a new +// GetResourceConfigHistoryPaginator +func NewGetResourceConfigHistoryPaginator(client GetResourceConfigHistoryAPIClient, params *GetResourceConfigHistoryInput, optFns ...func(*GetResourceConfigHistoryPaginatorOptions)) *GetResourceConfigHistoryPaginator { + options := GetResourceConfigHistoryPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetResourceConfigHistoryPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetResourceConfigHistoryPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetResourceConfigHistory page. +func (p *GetResourceConfigHistoryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetResourceConfigHistoryOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.GetResourceConfigHistory(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/connect/go.sum b/service/connect/go.sum index c669e324b14..32595049f96 100644 --- a/service/connect/go.sum +++ b/service/connect/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/connect/paginators.go b/service/connect/paginators.go new file mode 100644 index 00000000000..71ea0a69e57 --- /dev/null +++ b/service/connect/paginators.go @@ -0,0 +1,912 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connect + +import ( + "context" + "fmt" +) + +// ListHoursOfOperationsAPIClient is a client that implements the +// ListHoursOfOperations operation. +type ListHoursOfOperationsAPIClient interface { + ListHoursOfOperations(context.Context, *ListHoursOfOperationsInput, ...func(*Options)) (*ListHoursOfOperationsOutput, error) +} + +var _ ListHoursOfOperationsAPIClient = (*Client)(nil) + +// ListHoursOfOperationsPaginatorOptions is the paginator options for +// ListHoursOfOperations +type ListHoursOfOperationsPaginatorOptions struct { + // The maximimum number of results to return per page. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListHoursOfOperationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/connect.ListHoursOfOperations +type ListHoursOfOperationsPaginator struct { + options ListHoursOfOperationsPaginatorOptions + client ListHoursOfOperationsAPIClient + params *ListHoursOfOperationsInput + nextToken *string + firstPage bool + done bool +} + +// NewListHoursOfOperationsPaginator returns a new ListHoursOfOperationsPaginator +func NewListHoursOfOperationsPaginator(client ListHoursOfOperationsAPIClient, params *ListHoursOfOperationsInput, optFns ...func(*ListHoursOfOperationsPaginatorOptions)) *ListHoursOfOperationsPaginator { + options := ListHoursOfOperationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListHoursOfOperationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListHoursOfOperationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListHoursOfOperations page. +func (p *ListHoursOfOperationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListHoursOfOperationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListHoursOfOperations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListContactFlowsAPIClient is a client that implements the ListContactFlows +// operation. +type ListContactFlowsAPIClient interface { + ListContactFlows(context.Context, *ListContactFlowsInput, ...func(*Options)) (*ListContactFlowsOutput, error) +} + +var _ ListContactFlowsAPIClient = (*Client)(nil) + +// ListContactFlowsPaginatorOptions is the paginator options for ListContactFlows +type ListContactFlowsPaginatorOptions struct { + // The maximimum number of results to return per page. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListContactFlowsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/connect.ListContactFlows +type ListContactFlowsPaginator struct { + options ListContactFlowsPaginatorOptions + client ListContactFlowsAPIClient + params *ListContactFlowsInput + nextToken *string + firstPage bool + done bool +} + +// NewListContactFlowsPaginator returns a new ListContactFlowsPaginator +func NewListContactFlowsPaginator(client ListContactFlowsAPIClient, params *ListContactFlowsInput, optFns ...func(*ListContactFlowsPaginatorOptions)) *ListContactFlowsPaginator { + options := ListContactFlowsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListContactFlowsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListContactFlowsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListContactFlows page. +func (p *ListContactFlowsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListContactFlowsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListContactFlows(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetCurrentMetricDataAPIClient is a client that implements the +// GetCurrentMetricData operation. +type GetCurrentMetricDataAPIClient interface { + GetCurrentMetricData(context.Context, *GetCurrentMetricDataInput, ...func(*Options)) (*GetCurrentMetricDataOutput, error) +} + +var _ GetCurrentMetricDataAPIClient = (*Client)(nil) + +// GetCurrentMetricDataPaginatorOptions is the paginator options for +// GetCurrentMetricData +type GetCurrentMetricDataPaginatorOptions struct { + // The maximimum number of results to return per page. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetCurrentMetricDataPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/connect.GetCurrentMetricData +type GetCurrentMetricDataPaginator struct { + options GetCurrentMetricDataPaginatorOptions + client GetCurrentMetricDataAPIClient + params *GetCurrentMetricDataInput + nextToken *string + firstPage bool + done bool +} + +// NewGetCurrentMetricDataPaginator returns a new GetCurrentMetricDataPaginator +func NewGetCurrentMetricDataPaginator(client GetCurrentMetricDataAPIClient, params *GetCurrentMetricDataInput, optFns ...func(*GetCurrentMetricDataPaginatorOptions)) *GetCurrentMetricDataPaginator { + options := GetCurrentMetricDataPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetCurrentMetricDataPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetCurrentMetricDataPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetCurrentMetricData page. +func (p *GetCurrentMetricDataPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetCurrentMetricDataOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetCurrentMetricData(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListUsersAPIClient is a client that implements the ListUsers operation. +type ListUsersAPIClient interface { + ListUsers(context.Context, *ListUsersInput, ...func(*Options)) (*ListUsersOutput, error) +} + +var _ ListUsersAPIClient = (*Client)(nil) + +// ListUsersPaginatorOptions is the paginator options for ListUsers +type ListUsersPaginatorOptions struct { + // The maximimum number of results to return per page. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListUsersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/connect.ListUsers +type ListUsersPaginator struct { + options ListUsersPaginatorOptions + client ListUsersAPIClient + params *ListUsersInput + nextToken *string + firstPage bool + done bool +} + +// NewListUsersPaginator returns a new ListUsersPaginator +func NewListUsersPaginator(client ListUsersAPIClient, params *ListUsersInput, optFns ...func(*ListUsersPaginatorOptions)) *ListUsersPaginator { + options := ListUsersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListUsersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListUsersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListUsers page. +func (p *ListUsersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListUsersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListUsers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListRoutingProfilesAPIClient is a client that implements the ListRoutingProfiles +// operation. +type ListRoutingProfilesAPIClient interface { + ListRoutingProfiles(context.Context, *ListRoutingProfilesInput, ...func(*Options)) (*ListRoutingProfilesOutput, error) +} + +var _ ListRoutingProfilesAPIClient = (*Client)(nil) + +// ListRoutingProfilesPaginatorOptions is the paginator options for +// ListRoutingProfiles +type ListRoutingProfilesPaginatorOptions struct { + // The maximimum number of results to return per page. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListRoutingProfilesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/connect.ListRoutingProfiles +type ListRoutingProfilesPaginator struct { + options ListRoutingProfilesPaginatorOptions + client ListRoutingProfilesAPIClient + params *ListRoutingProfilesInput + nextToken *string + firstPage bool + done bool +} + +// NewListRoutingProfilesPaginator returns a new ListRoutingProfilesPaginator +func NewListRoutingProfilesPaginator(client ListRoutingProfilesAPIClient, params *ListRoutingProfilesInput, optFns ...func(*ListRoutingProfilesPaginatorOptions)) *ListRoutingProfilesPaginator { + options := ListRoutingProfilesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListRoutingProfilesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRoutingProfilesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListRoutingProfiles page. +func (p *ListRoutingProfilesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRoutingProfilesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListRoutingProfiles(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListPhoneNumbersAPIClient is a client that implements the ListPhoneNumbers +// operation. +type ListPhoneNumbersAPIClient interface { + ListPhoneNumbers(context.Context, *ListPhoneNumbersInput, ...func(*Options)) (*ListPhoneNumbersOutput, error) +} + +var _ ListPhoneNumbersAPIClient = (*Client)(nil) + +// ListPhoneNumbersPaginatorOptions is the paginator options for ListPhoneNumbers +type ListPhoneNumbersPaginatorOptions struct { + // The maximimum number of results to return per page. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListPhoneNumbersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/connect.ListPhoneNumbers +type ListPhoneNumbersPaginator struct { + options ListPhoneNumbersPaginatorOptions + client ListPhoneNumbersAPIClient + params *ListPhoneNumbersInput + nextToken *string + firstPage bool + done bool +} + +// NewListPhoneNumbersPaginator returns a new ListPhoneNumbersPaginator +func NewListPhoneNumbersPaginator(client ListPhoneNumbersAPIClient, params *ListPhoneNumbersInput, optFns ...func(*ListPhoneNumbersPaginatorOptions)) *ListPhoneNumbersPaginator { + options := ListPhoneNumbersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListPhoneNumbersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPhoneNumbersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListPhoneNumbers page. +func (p *ListPhoneNumbersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPhoneNumbersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListPhoneNumbers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListQueuesAPIClient is a client that implements the ListQueues operation. +type ListQueuesAPIClient interface { + ListQueues(context.Context, *ListQueuesInput, ...func(*Options)) (*ListQueuesOutput, error) +} + +var _ ListQueuesAPIClient = (*Client)(nil) + +// ListQueuesPaginatorOptions is the paginator options for ListQueues +type ListQueuesPaginatorOptions struct { + // The maximimum number of results to return per page. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListQueuesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/connect.ListQueues +type ListQueuesPaginator struct { + options ListQueuesPaginatorOptions + client ListQueuesAPIClient + params *ListQueuesInput + nextToken *string + firstPage bool + done bool +} + +// NewListQueuesPaginator returns a new ListQueuesPaginator +func NewListQueuesPaginator(client ListQueuesAPIClient, params *ListQueuesInput, optFns ...func(*ListQueuesPaginatorOptions)) *ListQueuesPaginator { + options := ListQueuesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListQueuesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListQueuesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListQueues page. +func (p *ListQueuesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListQueuesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListQueues(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListSecurityProfilesAPIClient is a client that implements the +// ListSecurityProfiles operation. +type ListSecurityProfilesAPIClient interface { + ListSecurityProfiles(context.Context, *ListSecurityProfilesInput, ...func(*Options)) (*ListSecurityProfilesOutput, error) +} + +var _ ListSecurityProfilesAPIClient = (*Client)(nil) + +// ListSecurityProfilesPaginatorOptions is the paginator options for +// ListSecurityProfiles +type ListSecurityProfilesPaginatorOptions struct { + // The maximimum number of results to return per page. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListSecurityProfilesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/connect.ListSecurityProfiles +type ListSecurityProfilesPaginator struct { + options ListSecurityProfilesPaginatorOptions + client ListSecurityProfilesAPIClient + params *ListSecurityProfilesInput + nextToken *string + firstPage bool + done bool +} + +// NewListSecurityProfilesPaginator returns a new ListSecurityProfilesPaginator +func NewListSecurityProfilesPaginator(client ListSecurityProfilesAPIClient, params *ListSecurityProfilesInput, optFns ...func(*ListSecurityProfilesPaginatorOptions)) *ListSecurityProfilesPaginator { + options := ListSecurityProfilesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListSecurityProfilesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSecurityProfilesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListSecurityProfiles page. +func (p *ListSecurityProfilesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSecurityProfilesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListSecurityProfiles(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListUserHierarchyGroupsAPIClient is a client that implements the +// ListUserHierarchyGroups operation. +type ListUserHierarchyGroupsAPIClient interface { + ListUserHierarchyGroups(context.Context, *ListUserHierarchyGroupsInput, ...func(*Options)) (*ListUserHierarchyGroupsOutput, error) +} + +var _ ListUserHierarchyGroupsAPIClient = (*Client)(nil) + +// ListUserHierarchyGroupsPaginatorOptions is the paginator options for +// ListUserHierarchyGroups +type ListUserHierarchyGroupsPaginatorOptions struct { + // The maximimum number of results to return per page. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListUserHierarchyGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/connect.ListUserHierarchyGroups +type ListUserHierarchyGroupsPaginator struct { + options ListUserHierarchyGroupsPaginatorOptions + client ListUserHierarchyGroupsAPIClient + params *ListUserHierarchyGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewListUserHierarchyGroupsPaginator returns a new +// ListUserHierarchyGroupsPaginator +func NewListUserHierarchyGroupsPaginator(client ListUserHierarchyGroupsAPIClient, params *ListUserHierarchyGroupsInput, optFns ...func(*ListUserHierarchyGroupsPaginatorOptions)) *ListUserHierarchyGroupsPaginator { + options := ListUserHierarchyGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListUserHierarchyGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListUserHierarchyGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListUserHierarchyGroups page. +func (p *ListUserHierarchyGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListUserHierarchyGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListUserHierarchyGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetMetricDataAPIClient is a client that implements the GetMetricData operation. +type GetMetricDataAPIClient interface { + GetMetricData(context.Context, *GetMetricDataInput, ...func(*Options)) (*GetMetricDataOutput, error) +} + +var _ GetMetricDataAPIClient = (*Client)(nil) + +// GetMetricDataPaginatorOptions is the paginator options for GetMetricData +type GetMetricDataPaginatorOptions struct { + // The maximimum number of results to return per page. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetMetricDataPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/connect.GetMetricData +type GetMetricDataPaginator struct { + options GetMetricDataPaginatorOptions + client GetMetricDataAPIClient + params *GetMetricDataInput + nextToken *string + firstPage bool + done bool +} + +// NewGetMetricDataPaginator returns a new GetMetricDataPaginator +func NewGetMetricDataPaginator(client GetMetricDataAPIClient, params *GetMetricDataInput, optFns ...func(*GetMetricDataPaginatorOptions)) *GetMetricDataPaginator { + options := GetMetricDataPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetMetricDataPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetMetricDataPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetMetricData page. +func (p *GetMetricDataPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetMetricDataOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetMetricData(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListPromptsAPIClient is a client that implements the ListPrompts operation. +type ListPromptsAPIClient interface { + ListPrompts(context.Context, *ListPromptsInput, ...func(*Options)) (*ListPromptsOutput, error) +} + +var _ ListPromptsAPIClient = (*Client)(nil) + +// ListPromptsPaginatorOptions is the paginator options for ListPrompts +type ListPromptsPaginatorOptions struct { + // The maximum number of results to return per page. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListPromptsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/connect.ListPrompts +type ListPromptsPaginator struct { + options ListPromptsPaginatorOptions + client ListPromptsAPIClient + params *ListPromptsInput + nextToken *string + firstPage bool + done bool +} + +// NewListPromptsPaginator returns a new ListPromptsPaginator +func NewListPromptsPaginator(client ListPromptsAPIClient, params *ListPromptsInput, optFns ...func(*ListPromptsPaginatorOptions)) *ListPromptsPaginator { + options := ListPromptsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListPromptsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPromptsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListPrompts page. +func (p *ListPromptsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPromptsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListPrompts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListRoutingProfileQueuesAPIClient is a client that implements the +// ListRoutingProfileQueues operation. +type ListRoutingProfileQueuesAPIClient interface { + ListRoutingProfileQueues(context.Context, *ListRoutingProfileQueuesInput, ...func(*Options)) (*ListRoutingProfileQueuesOutput, error) +} + +var _ ListRoutingProfileQueuesAPIClient = (*Client)(nil) + +// ListRoutingProfileQueuesPaginatorOptions is the paginator options for +// ListRoutingProfileQueues +type ListRoutingProfileQueuesPaginatorOptions struct { + // The maximimum number of results to return per page. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListRoutingProfileQueuesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/connect.ListRoutingProfileQueues +type ListRoutingProfileQueuesPaginator struct { + options ListRoutingProfileQueuesPaginatorOptions + client ListRoutingProfileQueuesAPIClient + params *ListRoutingProfileQueuesInput + nextToken *string + firstPage bool + done bool +} + +// NewListRoutingProfileQueuesPaginator returns a new +// ListRoutingProfileQueuesPaginator +func NewListRoutingProfileQueuesPaginator(client ListRoutingProfileQueuesAPIClient, params *ListRoutingProfileQueuesInput, optFns ...func(*ListRoutingProfileQueuesPaginatorOptions)) *ListRoutingProfileQueuesPaginator { + options := ListRoutingProfileQueuesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListRoutingProfileQueuesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRoutingProfileQueuesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListRoutingProfileQueues page. +func (p *ListRoutingProfileQueuesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRoutingProfileQueuesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListRoutingProfileQueues(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/connectparticipant/go.sum b/service/connectparticipant/go.sum index c669e324b14..32595049f96 100644 --- a/service/connectparticipant/go.sum +++ b/service/connectparticipant/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/connectparticipant/paginators.go b/service/connectparticipant/paginators.go new file mode 100644 index 00000000000..3d36b984f10 --- /dev/null +++ b/service/connectparticipant/paginators.go @@ -0,0 +1,82 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectparticipant + +import ( + "context" + "fmt" +) + +// GetTranscriptAPIClient is a client that implements the GetTranscript operation. +type GetTranscriptAPIClient interface { + GetTranscript(context.Context, *GetTranscriptInput, ...func(*Options)) (*GetTranscriptOutput, error) +} + +var _ GetTranscriptAPIClient = (*Client)(nil) + +// GetTranscriptPaginatorOptions is the paginator options for GetTranscript +type GetTranscriptPaginatorOptions struct { + // The maximum number of results to return in the page. Default: 10. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetTranscriptPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/connectparticipant.GetTranscript +type GetTranscriptPaginator struct { + options GetTranscriptPaginatorOptions + client GetTranscriptAPIClient + params *GetTranscriptInput + nextToken *string + firstPage bool + done bool +} + +// NewGetTranscriptPaginator returns a new GetTranscriptPaginator +func NewGetTranscriptPaginator(client GetTranscriptAPIClient, params *GetTranscriptInput, optFns ...func(*GetTranscriptPaginatorOptions)) *GetTranscriptPaginator { + options := GetTranscriptPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetTranscriptPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetTranscriptPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetTranscript page. +func (p *GetTranscriptPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetTranscriptOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetTranscript(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/costandusagereportservice/go.sum b/service/costandusagereportservice/go.sum index c669e324b14..32595049f96 100644 --- a/service/costandusagereportservice/go.sum +++ b/service/costandusagereportservice/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/costandusagereportservice/paginators.go b/service/costandusagereportservice/paginators.go new file mode 100644 index 00000000000..8cd9abb66b4 --- /dev/null +++ b/service/costandusagereportservice/paginators.go @@ -0,0 +1,85 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package costandusagereportservice + +import ( + "context" + "fmt" +) + +// DescribeReportDefinitionsAPIClient is a client that implements the +// DescribeReportDefinitions operation. +type DescribeReportDefinitionsAPIClient interface { + DescribeReportDefinitions(context.Context, *DescribeReportDefinitionsInput, ...func(*Options)) (*DescribeReportDefinitionsOutput, error) +} + +var _ DescribeReportDefinitionsAPIClient = (*Client)(nil) + +// DescribeReportDefinitionsPaginatorOptions is the paginator options for +// DescribeReportDefinitions +type DescribeReportDefinitionsPaginatorOptions struct { + // The maximum number of results that AWS returns for the operation. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeReportDefinitionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/costandusagereportservice.DescribeReportDefinitions +type DescribeReportDefinitionsPaginator struct { + options DescribeReportDefinitionsPaginatorOptions + client DescribeReportDefinitionsAPIClient + params *DescribeReportDefinitionsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeReportDefinitionsPaginator returns a new +// DescribeReportDefinitionsPaginator +func NewDescribeReportDefinitionsPaginator(client DescribeReportDefinitionsAPIClient, params *DescribeReportDefinitionsInput, optFns ...func(*DescribeReportDefinitionsPaginatorOptions)) *DescribeReportDefinitionsPaginator { + options := DescribeReportDefinitionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeReportDefinitionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeReportDefinitionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeReportDefinitions page. +func (p *DescribeReportDefinitionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeReportDefinitionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeReportDefinitions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/costexplorer/go.sum b/service/costexplorer/go.sum index c669e324b14..32595049f96 100644 --- a/service/costexplorer/go.sum +++ b/service/costexplorer/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/costexplorer/paginators.go b/service/costexplorer/paginators.go new file mode 100644 index 00000000000..4ed068c054a --- /dev/null +++ b/service/costexplorer/paginators.go @@ -0,0 +1,241 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package costexplorer + +import ( + "context" + "fmt" +) + +// ListCostCategoryDefinitionsAPIClient is a client that implements the +// ListCostCategoryDefinitions operation. +type ListCostCategoryDefinitionsAPIClient interface { + ListCostCategoryDefinitions(context.Context, *ListCostCategoryDefinitionsInput, ...func(*Options)) (*ListCostCategoryDefinitionsOutput, error) +} + +var _ ListCostCategoryDefinitionsAPIClient = (*Client)(nil) + +// ListCostCategoryDefinitionsPaginatorOptions is the paginator options for +// ListCostCategoryDefinitions +type ListCostCategoryDefinitionsPaginatorOptions struct { + // The number of entries a paginated response contains. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListCostCategoryDefinitionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/costexplorer.ListCostCategoryDefinitions +type ListCostCategoryDefinitionsPaginator struct { + options ListCostCategoryDefinitionsPaginatorOptions + client ListCostCategoryDefinitionsAPIClient + params *ListCostCategoryDefinitionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListCostCategoryDefinitionsPaginator returns a new +// ListCostCategoryDefinitionsPaginator +func NewListCostCategoryDefinitionsPaginator(client ListCostCategoryDefinitionsAPIClient, params *ListCostCategoryDefinitionsInput, optFns ...func(*ListCostCategoryDefinitionsPaginatorOptions)) *ListCostCategoryDefinitionsPaginator { + options := ListCostCategoryDefinitionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListCostCategoryDefinitionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCostCategoryDefinitionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListCostCategoryDefinitions page. +func (p *ListCostCategoryDefinitionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCostCategoryDefinitionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListCostCategoryDefinitions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetSavingsPlansCoverageAPIClient is a client that implements the +// GetSavingsPlansCoverage operation. +type GetSavingsPlansCoverageAPIClient interface { + GetSavingsPlansCoverage(context.Context, *GetSavingsPlansCoverageInput, ...func(*Options)) (*GetSavingsPlansCoverageOutput, error) +} + +var _ GetSavingsPlansCoverageAPIClient = (*Client)(nil) + +// GetSavingsPlansCoveragePaginatorOptions is the paginator options for +// GetSavingsPlansCoverage +type GetSavingsPlansCoveragePaginatorOptions struct { + // The number of items to be returned in a response. The default is 20, with a + // minimum value of 1. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetSavingsPlansCoveragePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/costexplorer.GetSavingsPlansCoverage +type GetSavingsPlansCoveragePaginator struct { + options GetSavingsPlansCoveragePaginatorOptions + client GetSavingsPlansCoverageAPIClient + params *GetSavingsPlansCoverageInput + nextToken *string + firstPage bool + done bool +} + +// NewGetSavingsPlansCoveragePaginator returns a new +// GetSavingsPlansCoveragePaginator +func NewGetSavingsPlansCoveragePaginator(client GetSavingsPlansCoverageAPIClient, params *GetSavingsPlansCoverageInput, optFns ...func(*GetSavingsPlansCoveragePaginatorOptions)) *GetSavingsPlansCoveragePaginator { + options := GetSavingsPlansCoveragePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetSavingsPlansCoveragePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetSavingsPlansCoveragePaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetSavingsPlansCoverage page. +func (p *GetSavingsPlansCoveragePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetSavingsPlansCoverageOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetSavingsPlansCoverage(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetSavingsPlansUtilizationDetailsAPIClient is a client that implements the +// GetSavingsPlansUtilizationDetails operation. +type GetSavingsPlansUtilizationDetailsAPIClient interface { + GetSavingsPlansUtilizationDetails(context.Context, *GetSavingsPlansUtilizationDetailsInput, ...func(*Options)) (*GetSavingsPlansUtilizationDetailsOutput, error) +} + +var _ GetSavingsPlansUtilizationDetailsAPIClient = (*Client)(nil) + +// GetSavingsPlansUtilizationDetailsPaginatorOptions is the paginator options for +// GetSavingsPlansUtilizationDetails +type GetSavingsPlansUtilizationDetailsPaginatorOptions struct { + // The number of items to be returned in a response. The default is 20, with a + // minimum value of 1. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetSavingsPlansUtilizationDetailsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/costexplorer.GetSavingsPlansUtilizationDetails +type GetSavingsPlansUtilizationDetailsPaginator struct { + options GetSavingsPlansUtilizationDetailsPaginatorOptions + client GetSavingsPlansUtilizationDetailsAPIClient + params *GetSavingsPlansUtilizationDetailsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetSavingsPlansUtilizationDetailsPaginator returns a new +// GetSavingsPlansUtilizationDetailsPaginator +func NewGetSavingsPlansUtilizationDetailsPaginator(client GetSavingsPlansUtilizationDetailsAPIClient, params *GetSavingsPlansUtilizationDetailsInput, optFns ...func(*GetSavingsPlansUtilizationDetailsPaginatorOptions)) *GetSavingsPlansUtilizationDetailsPaginator { + options := GetSavingsPlansUtilizationDetailsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetSavingsPlansUtilizationDetailsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetSavingsPlansUtilizationDetailsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetSavingsPlansUtilizationDetails page. +func (p *GetSavingsPlansUtilizationDetailsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetSavingsPlansUtilizationDetailsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetSavingsPlansUtilizationDetails(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/databasemigrationservice/go.sum b/service/databasemigrationservice/go.sum index c669e324b14..32595049f96 100644 --- a/service/databasemigrationservice/go.sum +++ b/service/databasemigrationservice/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/databasemigrationservice/paginators.go b/service/databasemigrationservice/paginators.go new file mode 100644 index 00000000000..a50738e0eb1 --- /dev/null +++ b/service/databasemigrationservice/paginators.go @@ -0,0 +1,1436 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package databasemigrationservice + +import ( + "context" + "fmt" +) + +// DescribeEndpointsAPIClient is a client that implements the DescribeEndpoints +// operation. +type DescribeEndpointsAPIClient interface { + DescribeEndpoints(context.Context, *DescribeEndpointsInput, ...func(*Options)) (*DescribeEndpointsOutput, error) +} + +var _ DescribeEndpointsAPIClient = (*Client)(nil) + +// DescribeEndpointsPaginatorOptions is the paginator options for DescribeEndpoints +type DescribeEndpointsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeEndpointsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/databasemigrationservice.DescribeEndpoints +type DescribeEndpointsPaginator struct { + options DescribeEndpointsPaginatorOptions + client DescribeEndpointsAPIClient + params *DescribeEndpointsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeEndpointsPaginator returns a new DescribeEndpointsPaginator +func NewDescribeEndpointsPaginator(client DescribeEndpointsAPIClient, params *DescribeEndpointsInput, optFns ...func(*DescribeEndpointsPaginatorOptions)) *DescribeEndpointsPaginator { + options := DescribeEndpointsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeEndpointsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEndpointsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeEndpoints page. +func (p *DescribeEndpointsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEndpointsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeEndpoints(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeTableStatisticsAPIClient is a client that implements the +// DescribeTableStatistics operation. +type DescribeTableStatisticsAPIClient interface { + DescribeTableStatistics(context.Context, *DescribeTableStatisticsInput, ...func(*Options)) (*DescribeTableStatisticsOutput, error) +} + +var _ DescribeTableStatisticsAPIClient = (*Client)(nil) + +// DescribeTableStatisticsPaginatorOptions is the paginator options for +// DescribeTableStatistics +type DescribeTableStatisticsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: Minimum 20, maximum 500. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeTableStatisticsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/databasemigrationservice.DescribeTableStatistics +type DescribeTableStatisticsPaginator struct { + options DescribeTableStatisticsPaginatorOptions + client DescribeTableStatisticsAPIClient + params *DescribeTableStatisticsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeTableStatisticsPaginator returns a new +// DescribeTableStatisticsPaginator +func NewDescribeTableStatisticsPaginator(client DescribeTableStatisticsAPIClient, params *DescribeTableStatisticsInput, optFns ...func(*DescribeTableStatisticsPaginatorOptions)) *DescribeTableStatisticsPaginator { + options := DescribeTableStatisticsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeTableStatisticsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeTableStatisticsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeTableStatistics page. +func (p *DescribeTableStatisticsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTableStatisticsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeTableStatistics(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeReplicationTaskIndividualAssessmentsAPIClient is a client that +// implements the DescribeReplicationTaskIndividualAssessments operation. +type DescribeReplicationTaskIndividualAssessmentsAPIClient interface { + DescribeReplicationTaskIndividualAssessments(context.Context, *DescribeReplicationTaskIndividualAssessmentsInput, ...func(*Options)) (*DescribeReplicationTaskIndividualAssessmentsOutput, error) +} + +var _ DescribeReplicationTaskIndividualAssessmentsAPIClient = (*Client)(nil) + +// DescribeReplicationTaskIndividualAssessmentsPaginatorOptions is the paginator +// options for DescribeReplicationTaskIndividualAssessments +type DescribeReplicationTaskIndividualAssessmentsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeReplicationTaskIndividualAssessmentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/databasemigrationservice.DescribeReplicationTaskIndividualAssessments +type DescribeReplicationTaskIndividualAssessmentsPaginator struct { + options DescribeReplicationTaskIndividualAssessmentsPaginatorOptions + client DescribeReplicationTaskIndividualAssessmentsAPIClient + params *DescribeReplicationTaskIndividualAssessmentsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeReplicationTaskIndividualAssessmentsPaginator returns a new +// DescribeReplicationTaskIndividualAssessmentsPaginator +func NewDescribeReplicationTaskIndividualAssessmentsPaginator(client DescribeReplicationTaskIndividualAssessmentsAPIClient, params *DescribeReplicationTaskIndividualAssessmentsInput, optFns ...func(*DescribeReplicationTaskIndividualAssessmentsPaginatorOptions)) *DescribeReplicationTaskIndividualAssessmentsPaginator { + options := DescribeReplicationTaskIndividualAssessmentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeReplicationTaskIndividualAssessmentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeReplicationTaskIndividualAssessmentsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeReplicationTaskIndividualAssessments page. +func (p *DescribeReplicationTaskIndividualAssessmentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeReplicationTaskIndividualAssessmentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeReplicationTaskIndividualAssessments(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeReplicationTaskAssessmentRunsAPIClient is a client that implements the +// DescribeReplicationTaskAssessmentRuns operation. +type DescribeReplicationTaskAssessmentRunsAPIClient interface { + DescribeReplicationTaskAssessmentRuns(context.Context, *DescribeReplicationTaskAssessmentRunsInput, ...func(*Options)) (*DescribeReplicationTaskAssessmentRunsOutput, error) +} + +var _ DescribeReplicationTaskAssessmentRunsAPIClient = (*Client)(nil) + +// DescribeReplicationTaskAssessmentRunsPaginatorOptions is the paginator options +// for DescribeReplicationTaskAssessmentRuns +type DescribeReplicationTaskAssessmentRunsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeReplicationTaskAssessmentRunsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/databasemigrationservice.DescribeReplicationTaskAssessmentRuns +type DescribeReplicationTaskAssessmentRunsPaginator struct { + options DescribeReplicationTaskAssessmentRunsPaginatorOptions + client DescribeReplicationTaskAssessmentRunsAPIClient + params *DescribeReplicationTaskAssessmentRunsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeReplicationTaskAssessmentRunsPaginator returns a new +// DescribeReplicationTaskAssessmentRunsPaginator +func NewDescribeReplicationTaskAssessmentRunsPaginator(client DescribeReplicationTaskAssessmentRunsAPIClient, params *DescribeReplicationTaskAssessmentRunsInput, optFns ...func(*DescribeReplicationTaskAssessmentRunsPaginatorOptions)) *DescribeReplicationTaskAssessmentRunsPaginator { + options := DescribeReplicationTaskAssessmentRunsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeReplicationTaskAssessmentRunsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeReplicationTaskAssessmentRunsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeReplicationTaskAssessmentRuns page. +func (p *DescribeReplicationTaskAssessmentRunsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeReplicationTaskAssessmentRunsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeReplicationTaskAssessmentRuns(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeCertificatesAPIClient is a client that implements the +// DescribeCertificates operation. +type DescribeCertificatesAPIClient interface { + DescribeCertificates(context.Context, *DescribeCertificatesInput, ...func(*Options)) (*DescribeCertificatesOutput, error) +} + +var _ DescribeCertificatesAPIClient = (*Client)(nil) + +// DescribeCertificatesPaginatorOptions is the paginator options for +// DescribeCertificates +type DescribeCertificatesPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 10 + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeCertificatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/databasemigrationservice.DescribeCertificates +type DescribeCertificatesPaginator struct { + options DescribeCertificatesPaginatorOptions + client DescribeCertificatesAPIClient + params *DescribeCertificatesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeCertificatesPaginator returns a new DescribeCertificatesPaginator +func NewDescribeCertificatesPaginator(client DescribeCertificatesAPIClient, params *DescribeCertificatesInput, optFns ...func(*DescribeCertificatesPaginatorOptions)) *DescribeCertificatesPaginator { + options := DescribeCertificatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeCertificatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeCertificatesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeCertificates page. +func (p *DescribeCertificatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCertificatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeCertificates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeReplicationSubnetGroupsAPIClient is a client that implements the +// DescribeReplicationSubnetGroups operation. +type DescribeReplicationSubnetGroupsAPIClient interface { + DescribeReplicationSubnetGroups(context.Context, *DescribeReplicationSubnetGroupsInput, ...func(*Options)) (*DescribeReplicationSubnetGroupsOutput, error) +} + +var _ DescribeReplicationSubnetGroupsAPIClient = (*Client)(nil) + +// DescribeReplicationSubnetGroupsPaginatorOptions is the paginator options for +// DescribeReplicationSubnetGroups +type DescribeReplicationSubnetGroupsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeReplicationSubnetGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/databasemigrationservice.DescribeReplicationSubnetGroups +type DescribeReplicationSubnetGroupsPaginator struct { + options DescribeReplicationSubnetGroupsPaginatorOptions + client DescribeReplicationSubnetGroupsAPIClient + params *DescribeReplicationSubnetGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeReplicationSubnetGroupsPaginator returns a new +// DescribeReplicationSubnetGroupsPaginator +func NewDescribeReplicationSubnetGroupsPaginator(client DescribeReplicationSubnetGroupsAPIClient, params *DescribeReplicationSubnetGroupsInput, optFns ...func(*DescribeReplicationSubnetGroupsPaginatorOptions)) *DescribeReplicationSubnetGroupsPaginator { + options := DescribeReplicationSubnetGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeReplicationSubnetGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeReplicationSubnetGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeReplicationSubnetGroups page. +func (p *DescribeReplicationSubnetGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeReplicationSubnetGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeReplicationSubnetGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeApplicableIndividualAssessmentsAPIClient is a client that implements the +// DescribeApplicableIndividualAssessments operation. +type DescribeApplicableIndividualAssessmentsAPIClient interface { + DescribeApplicableIndividualAssessments(context.Context, *DescribeApplicableIndividualAssessmentsInput, ...func(*Options)) (*DescribeApplicableIndividualAssessmentsOutput, error) +} + +var _ DescribeApplicableIndividualAssessmentsAPIClient = (*Client)(nil) + +// DescribeApplicableIndividualAssessmentsPaginatorOptions is the paginator options +// for DescribeApplicableIndividualAssessments +type DescribeApplicableIndividualAssessmentsPaginatorOptions struct { + // Maximum number of records to include in the response. If more records exist than + // the specified MaxRecords value, a pagination token called a marker is included + // in the response so that the remaining results can be retrieved. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeApplicableIndividualAssessmentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/databasemigrationservice.DescribeApplicableIndividualAssessments +type DescribeApplicableIndividualAssessmentsPaginator struct { + options DescribeApplicableIndividualAssessmentsPaginatorOptions + client DescribeApplicableIndividualAssessmentsAPIClient + params *DescribeApplicableIndividualAssessmentsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeApplicableIndividualAssessmentsPaginator returns a new +// DescribeApplicableIndividualAssessmentsPaginator +func NewDescribeApplicableIndividualAssessmentsPaginator(client DescribeApplicableIndividualAssessmentsAPIClient, params *DescribeApplicableIndividualAssessmentsInput, optFns ...func(*DescribeApplicableIndividualAssessmentsPaginatorOptions)) *DescribeApplicableIndividualAssessmentsPaginator { + options := DescribeApplicableIndividualAssessmentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeApplicableIndividualAssessmentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeApplicableIndividualAssessmentsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeApplicableIndividualAssessments page. +func (p *DescribeApplicableIndividualAssessmentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeApplicableIndividualAssessmentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeApplicableIndividualAssessments(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeReplicationTasksAPIClient is a client that implements the +// DescribeReplicationTasks operation. +type DescribeReplicationTasksAPIClient interface { + DescribeReplicationTasks(context.Context, *DescribeReplicationTasksInput, ...func(*Options)) (*DescribeReplicationTasksOutput, error) +} + +var _ DescribeReplicationTasksAPIClient = (*Client)(nil) + +// DescribeReplicationTasksPaginatorOptions is the paginator options for +// DescribeReplicationTasks +type DescribeReplicationTasksPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeReplicationTasksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/databasemigrationservice.DescribeReplicationTasks +type DescribeReplicationTasksPaginator struct { + options DescribeReplicationTasksPaginatorOptions + client DescribeReplicationTasksAPIClient + params *DescribeReplicationTasksInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeReplicationTasksPaginator returns a new +// DescribeReplicationTasksPaginator +func NewDescribeReplicationTasksPaginator(client DescribeReplicationTasksAPIClient, params *DescribeReplicationTasksInput, optFns ...func(*DescribeReplicationTasksPaginatorOptions)) *DescribeReplicationTasksPaginator { + options := DescribeReplicationTasksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeReplicationTasksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeReplicationTasksPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeReplicationTasks page. +func (p *DescribeReplicationTasksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeReplicationTasksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeReplicationTasks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeReplicationInstanceTaskLogsAPIClient is a client that implements the +// DescribeReplicationInstanceTaskLogs operation. +type DescribeReplicationInstanceTaskLogsAPIClient interface { + DescribeReplicationInstanceTaskLogs(context.Context, *DescribeReplicationInstanceTaskLogsInput, ...func(*Options)) (*DescribeReplicationInstanceTaskLogsOutput, error) +} + +var _ DescribeReplicationInstanceTaskLogsAPIClient = (*Client)(nil) + +// DescribeReplicationInstanceTaskLogsPaginatorOptions is the paginator options for +// DescribeReplicationInstanceTaskLogs +type DescribeReplicationInstanceTaskLogsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeReplicationInstanceTaskLogsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/databasemigrationservice.DescribeReplicationInstanceTaskLogs +type DescribeReplicationInstanceTaskLogsPaginator struct { + options DescribeReplicationInstanceTaskLogsPaginatorOptions + client DescribeReplicationInstanceTaskLogsAPIClient + params *DescribeReplicationInstanceTaskLogsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeReplicationInstanceTaskLogsPaginator returns a new +// DescribeReplicationInstanceTaskLogsPaginator +func NewDescribeReplicationInstanceTaskLogsPaginator(client DescribeReplicationInstanceTaskLogsAPIClient, params *DescribeReplicationInstanceTaskLogsInput, optFns ...func(*DescribeReplicationInstanceTaskLogsPaginatorOptions)) *DescribeReplicationInstanceTaskLogsPaginator { + options := DescribeReplicationInstanceTaskLogsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeReplicationInstanceTaskLogsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeReplicationInstanceTaskLogsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeReplicationInstanceTaskLogs page. +func (p *DescribeReplicationInstanceTaskLogsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeReplicationInstanceTaskLogsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeReplicationInstanceTaskLogs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeEventsAPIClient is a client that implements the DescribeEvents +// operation. +type DescribeEventsAPIClient interface { + DescribeEvents(context.Context, *DescribeEventsInput, ...func(*Options)) (*DescribeEventsOutput, error) +} + +var _ DescribeEventsAPIClient = (*Client)(nil) + +// DescribeEventsPaginatorOptions is the paginator options for DescribeEvents +type DescribeEventsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeEventsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/databasemigrationservice.DescribeEvents +type DescribeEventsPaginator struct { + options DescribeEventsPaginatorOptions + client DescribeEventsAPIClient + params *DescribeEventsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeEventsPaginator returns a new DescribeEventsPaginator +func NewDescribeEventsPaginator(client DescribeEventsAPIClient, params *DescribeEventsInput, optFns ...func(*DescribeEventsPaginatorOptions)) *DescribeEventsPaginator { + options := DescribeEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeEventsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEventsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeEvents page. +func (p *DescribeEventsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEventsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeEvents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeSchemasAPIClient is a client that implements the DescribeSchemas +// operation. +type DescribeSchemasAPIClient interface { + DescribeSchemas(context.Context, *DescribeSchemasInput, ...func(*Options)) (*DescribeSchemasOutput, error) +} + +var _ DescribeSchemasAPIClient = (*Client)(nil) + +// DescribeSchemasPaginatorOptions is the paginator options for DescribeSchemas +type DescribeSchemasPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeSchemasPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/databasemigrationservice.DescribeSchemas +type DescribeSchemasPaginator struct { + options DescribeSchemasPaginatorOptions + client DescribeSchemasAPIClient + params *DescribeSchemasInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeSchemasPaginator returns a new DescribeSchemasPaginator +func NewDescribeSchemasPaginator(client DescribeSchemasAPIClient, params *DescribeSchemasInput, optFns ...func(*DescribeSchemasPaginatorOptions)) *DescribeSchemasPaginator { + options := DescribeSchemasPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeSchemasPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeSchemasPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeSchemas page. +func (p *DescribeSchemasPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeSchemasOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeSchemas(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeReplicationTaskAssessmentResultsAPIClient is a client that implements +// the DescribeReplicationTaskAssessmentResults operation. +type DescribeReplicationTaskAssessmentResultsAPIClient interface { + DescribeReplicationTaskAssessmentResults(context.Context, *DescribeReplicationTaskAssessmentResultsInput, ...func(*Options)) (*DescribeReplicationTaskAssessmentResultsOutput, error) +} + +var _ DescribeReplicationTaskAssessmentResultsAPIClient = (*Client)(nil) + +// DescribeReplicationTaskAssessmentResultsPaginatorOptions is the paginator +// options for DescribeReplicationTaskAssessmentResults +type DescribeReplicationTaskAssessmentResultsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeReplicationTaskAssessmentResultsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/databasemigrationservice.DescribeReplicationTaskAssessmentResults +type DescribeReplicationTaskAssessmentResultsPaginator struct { + options DescribeReplicationTaskAssessmentResultsPaginatorOptions + client DescribeReplicationTaskAssessmentResultsAPIClient + params *DescribeReplicationTaskAssessmentResultsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeReplicationTaskAssessmentResultsPaginator returns a new +// DescribeReplicationTaskAssessmentResultsPaginator +func NewDescribeReplicationTaskAssessmentResultsPaginator(client DescribeReplicationTaskAssessmentResultsAPIClient, params *DescribeReplicationTaskAssessmentResultsInput, optFns ...func(*DescribeReplicationTaskAssessmentResultsPaginatorOptions)) *DescribeReplicationTaskAssessmentResultsPaginator { + options := DescribeReplicationTaskAssessmentResultsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeReplicationTaskAssessmentResultsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeReplicationTaskAssessmentResultsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeReplicationTaskAssessmentResults page. +func (p *DescribeReplicationTaskAssessmentResultsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeReplicationTaskAssessmentResultsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeReplicationTaskAssessmentResults(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeEndpointTypesAPIClient is a client that implements the +// DescribeEndpointTypes operation. +type DescribeEndpointTypesAPIClient interface { + DescribeEndpointTypes(context.Context, *DescribeEndpointTypesInput, ...func(*Options)) (*DescribeEndpointTypesOutput, error) +} + +var _ DescribeEndpointTypesAPIClient = (*Client)(nil) + +// DescribeEndpointTypesPaginatorOptions is the paginator options for +// DescribeEndpointTypes +type DescribeEndpointTypesPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeEndpointTypesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/databasemigrationservice.DescribeEndpointTypes +type DescribeEndpointTypesPaginator struct { + options DescribeEndpointTypesPaginatorOptions + client DescribeEndpointTypesAPIClient + params *DescribeEndpointTypesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeEndpointTypesPaginator returns a new DescribeEndpointTypesPaginator +func NewDescribeEndpointTypesPaginator(client DescribeEndpointTypesAPIClient, params *DescribeEndpointTypesInput, optFns ...func(*DescribeEndpointTypesPaginatorOptions)) *DescribeEndpointTypesPaginator { + options := DescribeEndpointTypesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeEndpointTypesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEndpointTypesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeEndpointTypes page. +func (p *DescribeEndpointTypesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEndpointTypesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeEndpointTypes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeEventSubscriptionsAPIClient is a client that implements the +// DescribeEventSubscriptions operation. +type DescribeEventSubscriptionsAPIClient interface { + DescribeEventSubscriptions(context.Context, *DescribeEventSubscriptionsInput, ...func(*Options)) (*DescribeEventSubscriptionsOutput, error) +} + +var _ DescribeEventSubscriptionsAPIClient = (*Client)(nil) + +// DescribeEventSubscriptionsPaginatorOptions is the paginator options for +// DescribeEventSubscriptions +type DescribeEventSubscriptionsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeEventSubscriptionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/databasemigrationservice.DescribeEventSubscriptions +type DescribeEventSubscriptionsPaginator struct { + options DescribeEventSubscriptionsPaginatorOptions + client DescribeEventSubscriptionsAPIClient + params *DescribeEventSubscriptionsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeEventSubscriptionsPaginator returns a new +// DescribeEventSubscriptionsPaginator +func NewDescribeEventSubscriptionsPaginator(client DescribeEventSubscriptionsAPIClient, params *DescribeEventSubscriptionsInput, optFns ...func(*DescribeEventSubscriptionsPaginatorOptions)) *DescribeEventSubscriptionsPaginator { + options := DescribeEventSubscriptionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeEventSubscriptionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEventSubscriptionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeEventSubscriptions page. +func (p *DescribeEventSubscriptionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEventSubscriptionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeEventSubscriptions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeConnectionsAPIClient is a client that implements the DescribeConnections +// operation. +type DescribeConnectionsAPIClient interface { + DescribeConnections(context.Context, *DescribeConnectionsInput, ...func(*Options)) (*DescribeConnectionsOutput, error) +} + +var _ DescribeConnectionsAPIClient = (*Client)(nil) + +// DescribeConnectionsPaginatorOptions is the paginator options for +// DescribeConnections +type DescribeConnectionsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeConnectionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/databasemigrationservice.DescribeConnections +type DescribeConnectionsPaginator struct { + options DescribeConnectionsPaginatorOptions + client DescribeConnectionsAPIClient + params *DescribeConnectionsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeConnectionsPaginator returns a new DescribeConnectionsPaginator +func NewDescribeConnectionsPaginator(client DescribeConnectionsAPIClient, params *DescribeConnectionsInput, optFns ...func(*DescribeConnectionsPaginatorOptions)) *DescribeConnectionsPaginator { + options := DescribeConnectionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeConnectionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeConnectionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeConnections page. +func (p *DescribeConnectionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeConnectionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeConnections(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribePendingMaintenanceActionsAPIClient is a client that implements the +// DescribePendingMaintenanceActions operation. +type DescribePendingMaintenanceActionsAPIClient interface { + DescribePendingMaintenanceActions(context.Context, *DescribePendingMaintenanceActionsInput, ...func(*Options)) (*DescribePendingMaintenanceActionsOutput, error) +} + +var _ DescribePendingMaintenanceActionsAPIClient = (*Client)(nil) + +// DescribePendingMaintenanceActionsPaginatorOptions is the paginator options for +// DescribePendingMaintenanceActions +type DescribePendingMaintenanceActionsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribePendingMaintenanceActionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/databasemigrationservice.DescribePendingMaintenanceActions +type DescribePendingMaintenanceActionsPaginator struct { + options DescribePendingMaintenanceActionsPaginatorOptions + client DescribePendingMaintenanceActionsAPIClient + params *DescribePendingMaintenanceActionsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribePendingMaintenanceActionsPaginator returns a new +// DescribePendingMaintenanceActionsPaginator +func NewDescribePendingMaintenanceActionsPaginator(client DescribePendingMaintenanceActionsAPIClient, params *DescribePendingMaintenanceActionsInput, optFns ...func(*DescribePendingMaintenanceActionsPaginatorOptions)) *DescribePendingMaintenanceActionsPaginator { + options := DescribePendingMaintenanceActionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribePendingMaintenanceActionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribePendingMaintenanceActionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribePendingMaintenanceActions page. +func (p *DescribePendingMaintenanceActionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribePendingMaintenanceActionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribePendingMaintenanceActions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeReplicationInstancesAPIClient is a client that implements the +// DescribeReplicationInstances operation. +type DescribeReplicationInstancesAPIClient interface { + DescribeReplicationInstances(context.Context, *DescribeReplicationInstancesInput, ...func(*Options)) (*DescribeReplicationInstancesOutput, error) +} + +var _ DescribeReplicationInstancesAPIClient = (*Client)(nil) + +// DescribeReplicationInstancesPaginatorOptions is the paginator options for +// DescribeReplicationInstances +type DescribeReplicationInstancesPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeReplicationInstancesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/databasemigrationservice.DescribeReplicationInstances +type DescribeReplicationInstancesPaginator struct { + options DescribeReplicationInstancesPaginatorOptions + client DescribeReplicationInstancesAPIClient + params *DescribeReplicationInstancesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeReplicationInstancesPaginator returns a new +// DescribeReplicationInstancesPaginator +func NewDescribeReplicationInstancesPaginator(client DescribeReplicationInstancesAPIClient, params *DescribeReplicationInstancesInput, optFns ...func(*DescribeReplicationInstancesPaginatorOptions)) *DescribeReplicationInstancesPaginator { + options := DescribeReplicationInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeReplicationInstancesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeReplicationInstancesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeReplicationInstances page. +func (p *DescribeReplicationInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeReplicationInstancesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeReplicationInstances(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeOrderableReplicationInstancesAPIClient is a client that implements the +// DescribeOrderableReplicationInstances operation. +type DescribeOrderableReplicationInstancesAPIClient interface { + DescribeOrderableReplicationInstances(context.Context, *DescribeOrderableReplicationInstancesInput, ...func(*Options)) (*DescribeOrderableReplicationInstancesOutput, error) +} + +var _ DescribeOrderableReplicationInstancesAPIClient = (*Client)(nil) + +// DescribeOrderableReplicationInstancesPaginatorOptions is the paginator options +// for DescribeOrderableReplicationInstances +type DescribeOrderableReplicationInstancesPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeOrderableReplicationInstancesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/databasemigrationservice.DescribeOrderableReplicationInstances +type DescribeOrderableReplicationInstancesPaginator struct { + options DescribeOrderableReplicationInstancesPaginatorOptions + client DescribeOrderableReplicationInstancesAPIClient + params *DescribeOrderableReplicationInstancesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeOrderableReplicationInstancesPaginator returns a new +// DescribeOrderableReplicationInstancesPaginator +func NewDescribeOrderableReplicationInstancesPaginator(client DescribeOrderableReplicationInstancesAPIClient, params *DescribeOrderableReplicationInstancesInput, optFns ...func(*DescribeOrderableReplicationInstancesPaginatorOptions)) *DescribeOrderableReplicationInstancesPaginator { + options := DescribeOrderableReplicationInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeOrderableReplicationInstancesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeOrderableReplicationInstancesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeOrderableReplicationInstances page. +func (p *DescribeOrderableReplicationInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeOrderableReplicationInstancesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeOrderableReplicationInstances(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/dataexchange/go.sum b/service/dataexchange/go.sum index c669e324b14..32595049f96 100644 --- a/service/dataexchange/go.sum +++ b/service/dataexchange/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/dataexchange/paginators.go b/service/dataexchange/paginators.go new file mode 100644 index 00000000000..b649d90827f --- /dev/null +++ b/service/dataexchange/paginators.go @@ -0,0 +1,308 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package dataexchange + +import ( + "context" + "fmt" +) + +// ListJobsAPIClient is a client that implements the ListJobs operation. +type ListJobsAPIClient interface { + ListJobs(context.Context, *ListJobsInput, ...func(*Options)) (*ListJobsOutput, error) +} + +var _ ListJobsAPIClient = (*Client)(nil) + +// ListJobsPaginatorOptions is the paginator options for ListJobs +type ListJobsPaginatorOptions struct { + // The maximum number of results returned by a single call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/dataexchange.ListJobs +type ListJobsPaginator struct { + options ListJobsPaginatorOptions + client ListJobsAPIClient + params *ListJobsInput + nextToken *string + firstPage bool + done bool +} + +// NewListJobsPaginator returns a new ListJobsPaginator +func NewListJobsPaginator(client ListJobsAPIClient, params *ListJobsInput, optFns ...func(*ListJobsPaginatorOptions)) *ListJobsPaginator { + options := ListJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListJobsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListJobs page. +func (p *ListJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListRevisionAssetsAPIClient is a client that implements the ListRevisionAssets +// operation. +type ListRevisionAssetsAPIClient interface { + ListRevisionAssets(context.Context, *ListRevisionAssetsInput, ...func(*Options)) (*ListRevisionAssetsOutput, error) +} + +var _ ListRevisionAssetsAPIClient = (*Client)(nil) + +// ListRevisionAssetsPaginatorOptions is the paginator options for +// ListRevisionAssets +type ListRevisionAssetsPaginatorOptions struct { + // The maximum number of results returned by a single call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListRevisionAssetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/dataexchange.ListRevisionAssets +type ListRevisionAssetsPaginator struct { + options ListRevisionAssetsPaginatorOptions + client ListRevisionAssetsAPIClient + params *ListRevisionAssetsInput + nextToken *string + firstPage bool + done bool +} + +// NewListRevisionAssetsPaginator returns a new ListRevisionAssetsPaginator +func NewListRevisionAssetsPaginator(client ListRevisionAssetsAPIClient, params *ListRevisionAssetsInput, optFns ...func(*ListRevisionAssetsPaginatorOptions)) *ListRevisionAssetsPaginator { + options := ListRevisionAssetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListRevisionAssetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRevisionAssetsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListRevisionAssets page. +func (p *ListRevisionAssetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRevisionAssetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListRevisionAssets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDataSetRevisionsAPIClient is a client that implements the +// ListDataSetRevisions operation. +type ListDataSetRevisionsAPIClient interface { + ListDataSetRevisions(context.Context, *ListDataSetRevisionsInput, ...func(*Options)) (*ListDataSetRevisionsOutput, error) +} + +var _ ListDataSetRevisionsAPIClient = (*Client)(nil) + +// ListDataSetRevisionsPaginatorOptions is the paginator options for +// ListDataSetRevisions +type ListDataSetRevisionsPaginatorOptions struct { + // The maximum number of results returned by a single call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDataSetRevisionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/dataexchange.ListDataSetRevisions +type ListDataSetRevisionsPaginator struct { + options ListDataSetRevisionsPaginatorOptions + client ListDataSetRevisionsAPIClient + params *ListDataSetRevisionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListDataSetRevisionsPaginator returns a new ListDataSetRevisionsPaginator +func NewListDataSetRevisionsPaginator(client ListDataSetRevisionsAPIClient, params *ListDataSetRevisionsInput, optFns ...func(*ListDataSetRevisionsPaginatorOptions)) *ListDataSetRevisionsPaginator { + options := ListDataSetRevisionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDataSetRevisionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDataSetRevisionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDataSetRevisions page. +func (p *ListDataSetRevisionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDataSetRevisionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListDataSetRevisions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDataSetsAPIClient is a client that implements the ListDataSets operation. +type ListDataSetsAPIClient interface { + ListDataSets(context.Context, *ListDataSetsInput, ...func(*Options)) (*ListDataSetsOutput, error) +} + +var _ ListDataSetsAPIClient = (*Client)(nil) + +// ListDataSetsPaginatorOptions is the paginator options for ListDataSets +type ListDataSetsPaginatorOptions struct { + // The maximum number of results returned by a single call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDataSetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/dataexchange.ListDataSets +type ListDataSetsPaginator struct { + options ListDataSetsPaginatorOptions + client ListDataSetsAPIClient + params *ListDataSetsInput + nextToken *string + firstPage bool + done bool +} + +// NewListDataSetsPaginator returns a new ListDataSetsPaginator +func NewListDataSetsPaginator(client ListDataSetsAPIClient, params *ListDataSetsInput, optFns ...func(*ListDataSetsPaginatorOptions)) *ListDataSetsPaginator { + options := ListDataSetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDataSetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDataSetsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDataSets page. +func (p *ListDataSetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDataSetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListDataSets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/datapipeline/go.sum b/service/datapipeline/go.sum index c669e324b14..32595049f96 100644 --- a/service/datapipeline/go.sum +++ b/service/datapipeline/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/datapipeline/paginators.go b/service/datapipeline/paginators.go new file mode 100644 index 00000000000..a7f6bb135f3 --- /dev/null +++ b/service/datapipeline/paginators.go @@ -0,0 +1,224 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package datapipeline + +import ( + "context" + "fmt" +) + +// QueryObjectsAPIClient is a client that implements the QueryObjects operation. +type QueryObjectsAPIClient interface { + QueryObjects(context.Context, *QueryObjectsInput, ...func(*Options)) (*QueryObjectsOutput, error) +} + +var _ QueryObjectsAPIClient = (*Client)(nil) + +// QueryObjectsPaginatorOptions is the paginator options for QueryObjects +type QueryObjectsPaginatorOptions struct { + // The maximum number of object names that QueryObjects will return in a single + // call. The default value is 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// QueryObjectsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/datapipeline.QueryObjects +type QueryObjectsPaginator struct { + options QueryObjectsPaginatorOptions + client QueryObjectsAPIClient + params *QueryObjectsInput + nextToken *string + firstPage bool + done bool +} + +// NewQueryObjectsPaginator returns a new QueryObjectsPaginator +func NewQueryObjectsPaginator(client QueryObjectsAPIClient, params *QueryObjectsInput, optFns ...func(*QueryObjectsPaginatorOptions)) *QueryObjectsPaginator { + options := QueryObjectsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &QueryObjectsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *QueryObjectsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next QueryObjects page. +func (p *QueryObjectsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*QueryObjectsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.QueryObjects(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListPipelinesAPIClient is a client that implements the ListPipelines operation. +type ListPipelinesAPIClient interface { + ListPipelines(context.Context, *ListPipelinesInput, ...func(*Options)) (*ListPipelinesOutput, error) +} + +var _ ListPipelinesAPIClient = (*Client)(nil) + +// ListPipelinesPaginatorOptions is the paginator options for ListPipelines +type ListPipelinesPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListPipelinesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/datapipeline.ListPipelines +type ListPipelinesPaginator struct { + options ListPipelinesPaginatorOptions + client ListPipelinesAPIClient + params *ListPipelinesInput + nextToken *string + firstPage bool + done bool +} + +// NewListPipelinesPaginator returns a new ListPipelinesPaginator +func NewListPipelinesPaginator(client ListPipelinesAPIClient, params *ListPipelinesInput, optFns ...func(*ListPipelinesPaginatorOptions)) *ListPipelinesPaginator { + options := ListPipelinesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListPipelinesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPipelinesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListPipelines page. +func (p *ListPipelinesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPipelinesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + result, err := p.client.ListPipelines(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeObjectsAPIClient is a client that implements the DescribeObjects +// operation. +type DescribeObjectsAPIClient interface { + DescribeObjects(context.Context, *DescribeObjectsInput, ...func(*Options)) (*DescribeObjectsOutput, error) +} + +var _ DescribeObjectsAPIClient = (*Client)(nil) + +// DescribeObjectsPaginatorOptions is the paginator options for DescribeObjects +type DescribeObjectsPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeObjectsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/datapipeline.DescribeObjects +type DescribeObjectsPaginator struct { + options DescribeObjectsPaginatorOptions + client DescribeObjectsAPIClient + params *DescribeObjectsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeObjectsPaginator returns a new DescribeObjectsPaginator +func NewDescribeObjectsPaginator(client DescribeObjectsAPIClient, params *DescribeObjectsInput, optFns ...func(*DescribeObjectsPaginatorOptions)) *DescribeObjectsPaginator { + options := DescribeObjectsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeObjectsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeObjectsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeObjects page. +func (p *DescribeObjectsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeObjectsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + result, err := p.client.DescribeObjects(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/datasync/go.sum b/service/datasync/go.sum index c669e324b14..32595049f96 100644 --- a/service/datasync/go.sum +++ b/service/datasync/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/datasync/paginators.go b/service/datasync/paginators.go new file mode 100644 index 00000000000..0d4bb29a600 --- /dev/null +++ b/service/datasync/paginators.go @@ -0,0 +1,382 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package datasync + +import ( + "context" + "fmt" +) + +// ListLocationsAPIClient is a client that implements the ListLocations operation. +type ListLocationsAPIClient interface { + ListLocations(context.Context, *ListLocationsInput, ...func(*Options)) (*ListLocationsOutput, error) +} + +var _ ListLocationsAPIClient = (*Client)(nil) + +// ListLocationsPaginatorOptions is the paginator options for ListLocations +type ListLocationsPaginatorOptions struct { + // The maximum number of locations to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListLocationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/datasync.ListLocations +type ListLocationsPaginator struct { + options ListLocationsPaginatorOptions + client ListLocationsAPIClient + params *ListLocationsInput + nextToken *string + firstPage bool + done bool +} + +// NewListLocationsPaginator returns a new ListLocationsPaginator +func NewListLocationsPaginator(client ListLocationsAPIClient, params *ListLocationsInput, optFns ...func(*ListLocationsPaginatorOptions)) *ListLocationsPaginator { + options := ListLocationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListLocationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListLocationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListLocations page. +func (p *ListLocationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListLocationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListLocations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTasksAPIClient is a client that implements the ListTasks operation. +type ListTasksAPIClient interface { + ListTasks(context.Context, *ListTasksInput, ...func(*Options)) (*ListTasksOutput, error) +} + +var _ ListTasksAPIClient = (*Client)(nil) + +// ListTasksPaginatorOptions is the paginator options for ListTasks +type ListTasksPaginatorOptions struct { + // The maximum number of tasks to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTasksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/datasync.ListTasks +type ListTasksPaginator struct { + options ListTasksPaginatorOptions + client ListTasksAPIClient + params *ListTasksInput + nextToken *string + firstPage bool + done bool +} + +// NewListTasksPaginator returns a new ListTasksPaginator +func NewListTasksPaginator(client ListTasksAPIClient, params *ListTasksInput, optFns ...func(*ListTasksPaginatorOptions)) *ListTasksPaginator { + options := ListTasksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTasksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTasksPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTasks page. +func (p *ListTasksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTasksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListTasks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTagsForResourceAPIClient is a client that implements the ListTagsForResource +// operation. +type ListTagsForResourceAPIClient interface { + ListTagsForResource(context.Context, *ListTagsForResourceInput, ...func(*Options)) (*ListTagsForResourceOutput, error) +} + +var _ ListTagsForResourceAPIClient = (*Client)(nil) + +// ListTagsForResourcePaginatorOptions is the paginator options for +// ListTagsForResource +type ListTagsForResourcePaginatorOptions struct { + // The maximum number of locations to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTagsForResourcePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/datasync.ListTagsForResource +type ListTagsForResourcePaginator struct { + options ListTagsForResourcePaginatorOptions + client ListTagsForResourceAPIClient + params *ListTagsForResourceInput + nextToken *string + firstPage bool + done bool +} + +// NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator +func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator { + options := ListTagsForResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTagsForResourcePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTagsForResourcePaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTagsForResource page. +func (p *ListTagsForResourcePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListTagsForResource(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTaskExecutionsAPIClient is a client that implements the ListTaskExecutions +// operation. +type ListTaskExecutionsAPIClient interface { + ListTaskExecutions(context.Context, *ListTaskExecutionsInput, ...func(*Options)) (*ListTaskExecutionsOutput, error) +} + +var _ ListTaskExecutionsAPIClient = (*Client)(nil) + +// ListTaskExecutionsPaginatorOptions is the paginator options for +// ListTaskExecutions +type ListTaskExecutionsPaginatorOptions struct { + // The maximum number of executed tasks to list. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTaskExecutionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/datasync.ListTaskExecutions +type ListTaskExecutionsPaginator struct { + options ListTaskExecutionsPaginatorOptions + client ListTaskExecutionsAPIClient + params *ListTaskExecutionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListTaskExecutionsPaginator returns a new ListTaskExecutionsPaginator +func NewListTaskExecutionsPaginator(client ListTaskExecutionsAPIClient, params *ListTaskExecutionsInput, optFns ...func(*ListTaskExecutionsPaginatorOptions)) *ListTaskExecutionsPaginator { + options := ListTaskExecutionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTaskExecutionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTaskExecutionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTaskExecutions page. +func (p *ListTaskExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTaskExecutionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListTaskExecutions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListAgentsAPIClient is a client that implements the ListAgents operation. +type ListAgentsAPIClient interface { + ListAgents(context.Context, *ListAgentsInput, ...func(*Options)) (*ListAgentsOutput, error) +} + +var _ ListAgentsAPIClient = (*Client)(nil) + +// ListAgentsPaginatorOptions is the paginator options for ListAgents +type ListAgentsPaginatorOptions struct { + // The maximum number of agents to list. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAgentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/datasync.ListAgents +type ListAgentsPaginator struct { + options ListAgentsPaginatorOptions + client ListAgentsAPIClient + params *ListAgentsInput + nextToken *string + firstPage bool + done bool +} + +// NewListAgentsPaginator returns a new ListAgentsPaginator +func NewListAgentsPaginator(client ListAgentsAPIClient, params *ListAgentsInput, optFns ...func(*ListAgentsPaginatorOptions)) *ListAgentsPaginator { + options := ListAgentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAgentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAgentsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAgents page. +func (p *ListAgentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAgentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListAgents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/dax/go.sum b/service/dax/go.sum index c669e324b14..32595049f96 100644 --- a/service/dax/go.sum +++ b/service/dax/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/detective/go.sum b/service/detective/go.sum index c669e324b14..32595049f96 100644 --- a/service/detective/go.sum +++ b/service/detective/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/detective/paginators.go b/service/detective/paginators.go new file mode 100644 index 00000000000..5a3f10b5808 --- /dev/null +++ b/service/detective/paginators.go @@ -0,0 +1,236 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package detective + +import ( + "context" + "fmt" +) + +// ListInvitationsAPIClient is a client that implements the ListInvitations +// operation. +type ListInvitationsAPIClient interface { + ListInvitations(context.Context, *ListInvitationsInput, ...func(*Options)) (*ListInvitationsOutput, error) +} + +var _ ListInvitationsAPIClient = (*Client)(nil) + +// ListInvitationsPaginatorOptions is the paginator options for ListInvitations +type ListInvitationsPaginatorOptions struct { + // The maximum number of behavior graph invitations to return in the response. The + // total must be less than the overall limit on the number of results to return, + // which is currently 200. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListInvitationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/detective.ListInvitations +type ListInvitationsPaginator struct { + options ListInvitationsPaginatorOptions + client ListInvitationsAPIClient + params *ListInvitationsInput + nextToken *string + firstPage bool + done bool +} + +// NewListInvitationsPaginator returns a new ListInvitationsPaginator +func NewListInvitationsPaginator(client ListInvitationsAPIClient, params *ListInvitationsInput, optFns ...func(*ListInvitationsPaginatorOptions)) *ListInvitationsPaginator { + options := ListInvitationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListInvitationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListInvitationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListInvitations page. +func (p *ListInvitationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListInvitationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListInvitations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListMembersAPIClient is a client that implements the ListMembers operation. +type ListMembersAPIClient interface { + ListMembers(context.Context, *ListMembersInput, ...func(*Options)) (*ListMembersOutput, error) +} + +var _ ListMembersAPIClient = (*Client)(nil) + +// ListMembersPaginatorOptions is the paginator options for ListMembers +type ListMembersPaginatorOptions struct { + // The maximum number of member accounts to include in the response. The total must + // be less than the overall limit on the number of results to return, which is + // currently 200. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListMembersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/detective.ListMembers +type ListMembersPaginator struct { + options ListMembersPaginatorOptions + client ListMembersAPIClient + params *ListMembersInput + nextToken *string + firstPage bool + done bool +} + +// NewListMembersPaginator returns a new ListMembersPaginator +func NewListMembersPaginator(client ListMembersAPIClient, params *ListMembersInput, optFns ...func(*ListMembersPaginatorOptions)) *ListMembersPaginator { + options := ListMembersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListMembersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMembersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListMembers page. +func (p *ListMembersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMembersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListMembers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListGraphsAPIClient is a client that implements the ListGraphs operation. +type ListGraphsAPIClient interface { + ListGraphs(context.Context, *ListGraphsInput, ...func(*Options)) (*ListGraphsOutput, error) +} + +var _ ListGraphsAPIClient = (*Client)(nil) + +// ListGraphsPaginatorOptions is the paginator options for ListGraphs +type ListGraphsPaginatorOptions struct { + // The maximum number of graphs to return at a time. The total must be less than + // the overall limit on the number of results to return, which is currently 200. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListGraphsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/detective.ListGraphs +type ListGraphsPaginator struct { + options ListGraphsPaginatorOptions + client ListGraphsAPIClient + params *ListGraphsInput + nextToken *string + firstPage bool + done bool +} + +// NewListGraphsPaginator returns a new ListGraphsPaginator +func NewListGraphsPaginator(client ListGraphsAPIClient, params *ListGraphsInput, optFns ...func(*ListGraphsPaginatorOptions)) *ListGraphsPaginator { + options := ListGraphsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListGraphsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListGraphsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListGraphs page. +func (p *ListGraphsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListGraphsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListGraphs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/devicefarm/go.sum b/service/devicefarm/go.sum index c669e324b14..32595049f96 100644 --- a/service/devicefarm/go.sum +++ b/service/devicefarm/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/devicefarm/paginators.go b/service/devicefarm/paginators.go new file mode 100644 index 00000000000..986ea05255e --- /dev/null +++ b/service/devicefarm/paginators.go @@ -0,0 +1,1301 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devicefarm + +import ( + "context" + "fmt" +) + +// ListSuitesAPIClient is a client that implements the ListSuites operation. +type ListSuitesAPIClient interface { + ListSuites(context.Context, *ListSuitesInput, ...func(*Options)) (*ListSuitesOutput, error) +} + +var _ ListSuitesAPIClient = (*Client)(nil) + +// ListSuitesPaginatorOptions is the paginator options for ListSuites +type ListSuitesPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListSuitesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/devicefarm.ListSuites +type ListSuitesPaginator struct { + options ListSuitesPaginatorOptions + client ListSuitesAPIClient + params *ListSuitesInput + nextToken *string + firstPage bool + done bool +} + +// NewListSuitesPaginator returns a new ListSuitesPaginator +func NewListSuitesPaginator(client ListSuitesAPIClient, params *ListSuitesInput, optFns ...func(*ListSuitesPaginatorOptions)) *ListSuitesPaginator { + options := ListSuitesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListSuitesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSuitesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListSuites page. +func (p *ListSuitesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSuitesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListSuites(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDevicesAPIClient is a client that implements the ListDevices operation. +type ListDevicesAPIClient interface { + ListDevices(context.Context, *ListDevicesInput, ...func(*Options)) (*ListDevicesOutput, error) +} + +var _ ListDevicesAPIClient = (*Client)(nil) + +// ListDevicesPaginatorOptions is the paginator options for ListDevices +type ListDevicesPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDevicesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/devicefarm.ListDevices +type ListDevicesPaginator struct { + options ListDevicesPaginatorOptions + client ListDevicesAPIClient + params *ListDevicesInput + nextToken *string + firstPage bool + done bool +} + +// NewListDevicesPaginator returns a new ListDevicesPaginator +func NewListDevicesPaginator(client ListDevicesAPIClient, params *ListDevicesInput, optFns ...func(*ListDevicesPaginatorOptions)) *ListDevicesPaginator { + options := ListDevicesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDevicesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDevicesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDevices page. +func (p *ListDevicesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDevicesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListDevices(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTestGridSessionsAPIClient is a client that implements the +// ListTestGridSessions operation. +type ListTestGridSessionsAPIClient interface { + ListTestGridSessions(context.Context, *ListTestGridSessionsInput, ...func(*Options)) (*ListTestGridSessionsOutput, error) +} + +var _ ListTestGridSessionsAPIClient = (*Client)(nil) + +// ListTestGridSessionsPaginatorOptions is the paginator options for +// ListTestGridSessions +type ListTestGridSessionsPaginatorOptions struct { + // Return only this many results at a time. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTestGridSessionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/devicefarm.ListTestGridSessions +type ListTestGridSessionsPaginator struct { + options ListTestGridSessionsPaginatorOptions + client ListTestGridSessionsAPIClient + params *ListTestGridSessionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListTestGridSessionsPaginator returns a new ListTestGridSessionsPaginator +func NewListTestGridSessionsPaginator(client ListTestGridSessionsAPIClient, params *ListTestGridSessionsInput, optFns ...func(*ListTestGridSessionsPaginatorOptions)) *ListTestGridSessionsPaginator { + options := ListTestGridSessionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTestGridSessionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTestGridSessionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTestGridSessions page. +func (p *ListTestGridSessionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTestGridSessionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResult = p.options.Limit + result, err := p.client.ListTestGridSessions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDevicePoolsAPIClient is a client that implements the ListDevicePools +// operation. +type ListDevicePoolsAPIClient interface { + ListDevicePools(context.Context, *ListDevicePoolsInput, ...func(*Options)) (*ListDevicePoolsOutput, error) +} + +var _ ListDevicePoolsAPIClient = (*Client)(nil) + +// ListDevicePoolsPaginatorOptions is the paginator options for ListDevicePools +type ListDevicePoolsPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDevicePoolsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/devicefarm.ListDevicePools +type ListDevicePoolsPaginator struct { + options ListDevicePoolsPaginatorOptions + client ListDevicePoolsAPIClient + params *ListDevicePoolsInput + nextToken *string + firstPage bool + done bool +} + +// NewListDevicePoolsPaginator returns a new ListDevicePoolsPaginator +func NewListDevicePoolsPaginator(client ListDevicePoolsAPIClient, params *ListDevicePoolsInput, optFns ...func(*ListDevicePoolsPaginatorOptions)) *ListDevicePoolsPaginator { + options := ListDevicePoolsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDevicePoolsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDevicePoolsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDevicePools page. +func (p *ListDevicePoolsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDevicePoolsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListDevicePools(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTestGridSessionActionsAPIClient is a client that implements the +// ListTestGridSessionActions operation. +type ListTestGridSessionActionsAPIClient interface { + ListTestGridSessionActions(context.Context, *ListTestGridSessionActionsInput, ...func(*Options)) (*ListTestGridSessionActionsOutput, error) +} + +var _ ListTestGridSessionActionsAPIClient = (*Client)(nil) + +// ListTestGridSessionActionsPaginatorOptions is the paginator options for +// ListTestGridSessionActions +type ListTestGridSessionActionsPaginatorOptions struct { + // The maximum number of sessions to return per response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTestGridSessionActionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/devicefarm.ListTestGridSessionActions +type ListTestGridSessionActionsPaginator struct { + options ListTestGridSessionActionsPaginatorOptions + client ListTestGridSessionActionsAPIClient + params *ListTestGridSessionActionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListTestGridSessionActionsPaginator returns a new +// ListTestGridSessionActionsPaginator +func NewListTestGridSessionActionsPaginator(client ListTestGridSessionActionsAPIClient, params *ListTestGridSessionActionsInput, optFns ...func(*ListTestGridSessionActionsPaginatorOptions)) *ListTestGridSessionActionsPaginator { + options := ListTestGridSessionActionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTestGridSessionActionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTestGridSessionActionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTestGridSessionActions page. +func (p *ListTestGridSessionActionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTestGridSessionActionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResult = p.options.Limit + result, err := p.client.ListTestGridSessionActions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTestsAPIClient is a client that implements the ListTests operation. +type ListTestsAPIClient interface { + ListTests(context.Context, *ListTestsInput, ...func(*Options)) (*ListTestsOutput, error) +} + +var _ ListTestsAPIClient = (*Client)(nil) + +// ListTestsPaginatorOptions is the paginator options for ListTests +type ListTestsPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTestsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/devicefarm.ListTests +type ListTestsPaginator struct { + options ListTestsPaginatorOptions + client ListTestsAPIClient + params *ListTestsInput + nextToken *string + firstPage bool + done bool +} + +// NewListTestsPaginator returns a new ListTestsPaginator +func NewListTestsPaginator(client ListTestsAPIClient, params *ListTestsInput, optFns ...func(*ListTestsPaginatorOptions)) *ListTestsPaginator { + options := ListTestsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTestsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTestsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTests page. +func (p *ListTestsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTestsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListTests(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListOfferingTransactionsAPIClient is a client that implements the +// ListOfferingTransactions operation. +type ListOfferingTransactionsAPIClient interface { + ListOfferingTransactions(context.Context, *ListOfferingTransactionsInput, ...func(*Options)) (*ListOfferingTransactionsOutput, error) +} + +var _ ListOfferingTransactionsAPIClient = (*Client)(nil) + +// ListOfferingTransactionsPaginatorOptions is the paginator options for +// ListOfferingTransactions +type ListOfferingTransactionsPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListOfferingTransactionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/devicefarm.ListOfferingTransactions +type ListOfferingTransactionsPaginator struct { + options ListOfferingTransactionsPaginatorOptions + client ListOfferingTransactionsAPIClient + params *ListOfferingTransactionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListOfferingTransactionsPaginator returns a new +// ListOfferingTransactionsPaginator +func NewListOfferingTransactionsPaginator(client ListOfferingTransactionsAPIClient, params *ListOfferingTransactionsInput, optFns ...func(*ListOfferingTransactionsPaginatorOptions)) *ListOfferingTransactionsPaginator { + options := ListOfferingTransactionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListOfferingTransactionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListOfferingTransactionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListOfferingTransactions page. +func (p *ListOfferingTransactionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListOfferingTransactionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListOfferingTransactions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListUploadsAPIClient is a client that implements the ListUploads operation. +type ListUploadsAPIClient interface { + ListUploads(context.Context, *ListUploadsInput, ...func(*Options)) (*ListUploadsOutput, error) +} + +var _ ListUploadsAPIClient = (*Client)(nil) + +// ListUploadsPaginatorOptions is the paginator options for ListUploads +type ListUploadsPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListUploadsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/devicefarm.ListUploads +type ListUploadsPaginator struct { + options ListUploadsPaginatorOptions + client ListUploadsAPIClient + params *ListUploadsInput + nextToken *string + firstPage bool + done bool +} + +// NewListUploadsPaginator returns a new ListUploadsPaginator +func NewListUploadsPaginator(client ListUploadsAPIClient, params *ListUploadsInput, optFns ...func(*ListUploadsPaginatorOptions)) *ListUploadsPaginator { + options := ListUploadsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListUploadsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListUploadsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListUploads page. +func (p *ListUploadsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListUploadsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListUploads(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListUniqueProblemsAPIClient is a client that implements the ListUniqueProblems +// operation. +type ListUniqueProblemsAPIClient interface { + ListUniqueProblems(context.Context, *ListUniqueProblemsInput, ...func(*Options)) (*ListUniqueProblemsOutput, error) +} + +var _ ListUniqueProblemsAPIClient = (*Client)(nil) + +// ListUniqueProblemsPaginatorOptions is the paginator options for +// ListUniqueProblems +type ListUniqueProblemsPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListUniqueProblemsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/devicefarm.ListUniqueProblems +type ListUniqueProblemsPaginator struct { + options ListUniqueProblemsPaginatorOptions + client ListUniqueProblemsAPIClient + params *ListUniqueProblemsInput + nextToken *string + firstPage bool + done bool +} + +// NewListUniqueProblemsPaginator returns a new ListUniqueProblemsPaginator +func NewListUniqueProblemsPaginator(client ListUniqueProblemsAPIClient, params *ListUniqueProblemsInput, optFns ...func(*ListUniqueProblemsPaginatorOptions)) *ListUniqueProblemsPaginator { + options := ListUniqueProblemsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListUniqueProblemsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListUniqueProblemsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListUniqueProblems page. +func (p *ListUniqueProblemsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListUniqueProblemsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListUniqueProblems(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListOfferingsAPIClient is a client that implements the ListOfferings operation. +type ListOfferingsAPIClient interface { + ListOfferings(context.Context, *ListOfferingsInput, ...func(*Options)) (*ListOfferingsOutput, error) +} + +var _ ListOfferingsAPIClient = (*Client)(nil) + +// ListOfferingsPaginatorOptions is the paginator options for ListOfferings +type ListOfferingsPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListOfferingsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/devicefarm.ListOfferings +type ListOfferingsPaginator struct { + options ListOfferingsPaginatorOptions + client ListOfferingsAPIClient + params *ListOfferingsInput + nextToken *string + firstPage bool + done bool +} + +// NewListOfferingsPaginator returns a new ListOfferingsPaginator +func NewListOfferingsPaginator(client ListOfferingsAPIClient, params *ListOfferingsInput, optFns ...func(*ListOfferingsPaginatorOptions)) *ListOfferingsPaginator { + options := ListOfferingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListOfferingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListOfferingsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListOfferings page. +func (p *ListOfferingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListOfferingsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListOfferings(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListJobsAPIClient is a client that implements the ListJobs operation. +type ListJobsAPIClient interface { + ListJobs(context.Context, *ListJobsInput, ...func(*Options)) (*ListJobsOutput, error) +} + +var _ ListJobsAPIClient = (*Client)(nil) + +// ListJobsPaginatorOptions is the paginator options for ListJobs +type ListJobsPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/devicefarm.ListJobs +type ListJobsPaginator struct { + options ListJobsPaginatorOptions + client ListJobsAPIClient + params *ListJobsInput + nextToken *string + firstPage bool + done bool +} + +// NewListJobsPaginator returns a new ListJobsPaginator +func NewListJobsPaginator(client ListJobsAPIClient, params *ListJobsInput, optFns ...func(*ListJobsPaginatorOptions)) *ListJobsPaginator { + options := ListJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListJobsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListJobs page. +func (p *ListJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetOfferingStatusAPIClient is a client that implements the GetOfferingStatus +// operation. +type GetOfferingStatusAPIClient interface { + GetOfferingStatus(context.Context, *GetOfferingStatusInput, ...func(*Options)) (*GetOfferingStatusOutput, error) +} + +var _ GetOfferingStatusAPIClient = (*Client)(nil) + +// GetOfferingStatusPaginatorOptions is the paginator options for GetOfferingStatus +type GetOfferingStatusPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetOfferingStatusPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/devicefarm.GetOfferingStatus +type GetOfferingStatusPaginator struct { + options GetOfferingStatusPaginatorOptions + client GetOfferingStatusAPIClient + params *GetOfferingStatusInput + nextToken *string + firstPage bool + done bool +} + +// NewGetOfferingStatusPaginator returns a new GetOfferingStatusPaginator +func NewGetOfferingStatusPaginator(client GetOfferingStatusAPIClient, params *GetOfferingStatusInput, optFns ...func(*GetOfferingStatusPaginatorOptions)) *GetOfferingStatusPaginator { + options := GetOfferingStatusPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetOfferingStatusPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetOfferingStatusPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetOfferingStatus page. +func (p *GetOfferingStatusPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetOfferingStatusOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.GetOfferingStatus(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListSamplesAPIClient is a client that implements the ListSamples operation. +type ListSamplesAPIClient interface { + ListSamples(context.Context, *ListSamplesInput, ...func(*Options)) (*ListSamplesOutput, error) +} + +var _ ListSamplesAPIClient = (*Client)(nil) + +// ListSamplesPaginatorOptions is the paginator options for ListSamples +type ListSamplesPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListSamplesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/devicefarm.ListSamples +type ListSamplesPaginator struct { + options ListSamplesPaginatorOptions + client ListSamplesAPIClient + params *ListSamplesInput + nextToken *string + firstPage bool + done bool +} + +// NewListSamplesPaginator returns a new ListSamplesPaginator +func NewListSamplesPaginator(client ListSamplesAPIClient, params *ListSamplesInput, optFns ...func(*ListSamplesPaginatorOptions)) *ListSamplesPaginator { + options := ListSamplesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListSamplesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSamplesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListSamples page. +func (p *ListSamplesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSamplesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListSamples(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListRunsAPIClient is a client that implements the ListRuns operation. +type ListRunsAPIClient interface { + ListRuns(context.Context, *ListRunsInput, ...func(*Options)) (*ListRunsOutput, error) +} + +var _ ListRunsAPIClient = (*Client)(nil) + +// ListRunsPaginatorOptions is the paginator options for ListRuns +type ListRunsPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListRunsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/devicefarm.ListRuns +type ListRunsPaginator struct { + options ListRunsPaginatorOptions + client ListRunsAPIClient + params *ListRunsInput + nextToken *string + firstPage bool + done bool +} + +// NewListRunsPaginator returns a new ListRunsPaginator +func NewListRunsPaginator(client ListRunsAPIClient, params *ListRunsInput, optFns ...func(*ListRunsPaginatorOptions)) *ListRunsPaginator { + options := ListRunsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListRunsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRunsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListRuns page. +func (p *ListRunsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRunsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListRuns(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListArtifactsAPIClient is a client that implements the ListArtifacts operation. +type ListArtifactsAPIClient interface { + ListArtifacts(context.Context, *ListArtifactsInput, ...func(*Options)) (*ListArtifactsOutput, error) +} + +var _ ListArtifactsAPIClient = (*Client)(nil) + +// ListArtifactsPaginatorOptions is the paginator options for ListArtifacts +type ListArtifactsPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListArtifactsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/devicefarm.ListArtifacts +type ListArtifactsPaginator struct { + options ListArtifactsPaginatorOptions + client ListArtifactsAPIClient + params *ListArtifactsInput + nextToken *string + firstPage bool + done bool +} + +// NewListArtifactsPaginator returns a new ListArtifactsPaginator +func NewListArtifactsPaginator(client ListArtifactsAPIClient, params *ListArtifactsInput, optFns ...func(*ListArtifactsPaginatorOptions)) *ListArtifactsPaginator { + options := ListArtifactsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListArtifactsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListArtifactsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListArtifacts page. +func (p *ListArtifactsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListArtifactsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListArtifacts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTestGridSessionArtifactsAPIClient is a client that implements the +// ListTestGridSessionArtifacts operation. +type ListTestGridSessionArtifactsAPIClient interface { + ListTestGridSessionArtifacts(context.Context, *ListTestGridSessionArtifactsInput, ...func(*Options)) (*ListTestGridSessionArtifactsOutput, error) +} + +var _ ListTestGridSessionArtifactsAPIClient = (*Client)(nil) + +// ListTestGridSessionArtifactsPaginatorOptions is the paginator options for +// ListTestGridSessionArtifacts +type ListTestGridSessionArtifactsPaginatorOptions struct { + // The maximum number of results to be returned by a request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTestGridSessionArtifactsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/devicefarm.ListTestGridSessionArtifacts +type ListTestGridSessionArtifactsPaginator struct { + options ListTestGridSessionArtifactsPaginatorOptions + client ListTestGridSessionArtifactsAPIClient + params *ListTestGridSessionArtifactsInput + nextToken *string + firstPage bool + done bool +} + +// NewListTestGridSessionArtifactsPaginator returns a new +// ListTestGridSessionArtifactsPaginator +func NewListTestGridSessionArtifactsPaginator(client ListTestGridSessionArtifactsAPIClient, params *ListTestGridSessionArtifactsInput, optFns ...func(*ListTestGridSessionArtifactsPaginatorOptions)) *ListTestGridSessionArtifactsPaginator { + options := ListTestGridSessionArtifactsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTestGridSessionArtifactsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTestGridSessionArtifactsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTestGridSessionArtifacts page. +func (p *ListTestGridSessionArtifactsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTestGridSessionArtifactsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResult = p.options.Limit + result, err := p.client.ListTestGridSessionArtifacts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTestGridProjectsAPIClient is a client that implements the +// ListTestGridProjects operation. +type ListTestGridProjectsAPIClient interface { + ListTestGridProjects(context.Context, *ListTestGridProjectsInput, ...func(*Options)) (*ListTestGridProjectsOutput, error) +} + +var _ ListTestGridProjectsAPIClient = (*Client)(nil) + +// ListTestGridProjectsPaginatorOptions is the paginator options for +// ListTestGridProjects +type ListTestGridProjectsPaginatorOptions struct { + // Return no more than this number of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTestGridProjectsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/devicefarm.ListTestGridProjects +type ListTestGridProjectsPaginator struct { + options ListTestGridProjectsPaginatorOptions + client ListTestGridProjectsAPIClient + params *ListTestGridProjectsInput + nextToken *string + firstPage bool + done bool +} + +// NewListTestGridProjectsPaginator returns a new ListTestGridProjectsPaginator +func NewListTestGridProjectsPaginator(client ListTestGridProjectsAPIClient, params *ListTestGridProjectsInput, optFns ...func(*ListTestGridProjectsPaginatorOptions)) *ListTestGridProjectsPaginator { + options := ListTestGridProjectsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTestGridProjectsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTestGridProjectsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTestGridProjects page. +func (p *ListTestGridProjectsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTestGridProjectsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResult = p.options.Limit + result, err := p.client.ListTestGridProjects(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListProjectsAPIClient is a client that implements the ListProjects operation. +type ListProjectsAPIClient interface { + ListProjects(context.Context, *ListProjectsInput, ...func(*Options)) (*ListProjectsOutput, error) +} + +var _ ListProjectsAPIClient = (*Client)(nil) + +// ListProjectsPaginatorOptions is the paginator options for ListProjects +type ListProjectsPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListProjectsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/devicefarm.ListProjects +type ListProjectsPaginator struct { + options ListProjectsPaginatorOptions + client ListProjectsAPIClient + params *ListProjectsInput + nextToken *string + firstPage bool + done bool +} + +// NewListProjectsPaginator returns a new ListProjectsPaginator +func NewListProjectsPaginator(client ListProjectsAPIClient, params *ListProjectsInput, optFns ...func(*ListProjectsPaginatorOptions)) *ListProjectsPaginator { + options := ListProjectsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListProjectsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListProjectsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListProjects page. +func (p *ListProjectsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProjectsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListProjects(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/directconnect/go.sum b/service/directconnect/go.sum index c669e324b14..32595049f96 100644 --- a/service/directconnect/go.sum +++ b/service/directconnect/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/directoryservice/go.sum b/service/directoryservice/go.sum index c669e324b14..32595049f96 100644 --- a/service/directoryservice/go.sum +++ b/service/directoryservice/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/directoryservice/paginators.go b/service/directoryservice/paginators.go new file mode 100644 index 00000000000..a666685fde5 --- /dev/null +++ b/service/directoryservice/paginators.go @@ -0,0 +1,85 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package directoryservice + +import ( + "context" + "fmt" +) + +// DescribeDomainControllersAPIClient is a client that implements the +// DescribeDomainControllers operation. +type DescribeDomainControllersAPIClient interface { + DescribeDomainControllers(context.Context, *DescribeDomainControllersInput, ...func(*Options)) (*DescribeDomainControllersOutput, error) +} + +var _ DescribeDomainControllersAPIClient = (*Client)(nil) + +// DescribeDomainControllersPaginatorOptions is the paginator options for +// DescribeDomainControllers +type DescribeDomainControllersPaginatorOptions struct { + // The maximum number of items to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeDomainControllersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/directoryservice.DescribeDomainControllers +type DescribeDomainControllersPaginator struct { + options DescribeDomainControllersPaginatorOptions + client DescribeDomainControllersAPIClient + params *DescribeDomainControllersInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeDomainControllersPaginator returns a new +// DescribeDomainControllersPaginator +func NewDescribeDomainControllersPaginator(client DescribeDomainControllersAPIClient, params *DescribeDomainControllersInput, optFns ...func(*DescribeDomainControllersPaginatorOptions)) *DescribeDomainControllersPaginator { + options := DescribeDomainControllersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeDomainControllersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDomainControllersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeDomainControllers page. +func (p *DescribeDomainControllersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDomainControllersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.DescribeDomainControllers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/dlm/go.sum b/service/dlm/go.sum index c669e324b14..32595049f96 100644 --- a/service/dlm/go.sum +++ b/service/dlm/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/docdb/go.sum b/service/docdb/go.sum index c669e324b14..32595049f96 100644 --- a/service/docdb/go.sum +++ b/service/docdb/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/docdb/paginators.go b/service/docdb/paginators.go new file mode 100644 index 00000000000..824374ca5bf --- /dev/null +++ b/service/docdb/paginators.go @@ -0,0 +1,886 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package docdb + +import ( + "context" + "fmt" +) + +// DescribeDBClusterParametersAPIClient is a client that implements the +// DescribeDBClusterParameters operation. +type DescribeDBClusterParametersAPIClient interface { + DescribeDBClusterParameters(context.Context, *DescribeDBClusterParametersInput, ...func(*Options)) (*DescribeDBClusterParametersOutput, error) +} + +var _ DescribeDBClusterParametersAPIClient = (*Client)(nil) + +// DescribeDBClusterParametersPaginatorOptions is the paginator options for +// DescribeDBClusterParameters +type DescribeDBClusterParametersPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token (marker) is included in + // the response so that the remaining results can be retrieved. Default: 100 + // Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeDBClusterParametersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/docdb.DescribeDBClusterParameters +type DescribeDBClusterParametersPaginator struct { + options DescribeDBClusterParametersPaginatorOptions + client DescribeDBClusterParametersAPIClient + params *DescribeDBClusterParametersInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeDBClusterParametersPaginator returns a new +// DescribeDBClusterParametersPaginator +func NewDescribeDBClusterParametersPaginator(client DescribeDBClusterParametersAPIClient, params *DescribeDBClusterParametersInput, optFns ...func(*DescribeDBClusterParametersPaginatorOptions)) *DescribeDBClusterParametersPaginator { + options := DescribeDBClusterParametersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeDBClusterParametersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBClusterParametersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeDBClusterParameters page. +func (p *DescribeDBClusterParametersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBClusterParametersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeDBClusterParameters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeDBClustersAPIClient is a client that implements the DescribeDBClusters +// operation. +type DescribeDBClustersAPIClient interface { + DescribeDBClusters(context.Context, *DescribeDBClustersInput, ...func(*Options)) (*DescribeDBClustersOutput, error) +} + +var _ DescribeDBClustersAPIClient = (*Client)(nil) + +// DescribeDBClustersPaginatorOptions is the paginator options for +// DescribeDBClusters +type DescribeDBClustersPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token (marker) is included in + // the response so that the remaining results can be retrieved. Default: 100 + // Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeDBClustersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/docdb.DescribeDBClusters +type DescribeDBClustersPaginator struct { + options DescribeDBClustersPaginatorOptions + client DescribeDBClustersAPIClient + params *DescribeDBClustersInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeDBClustersPaginator returns a new DescribeDBClustersPaginator +func NewDescribeDBClustersPaginator(client DescribeDBClustersAPIClient, params *DescribeDBClustersInput, optFns ...func(*DescribeDBClustersPaginatorOptions)) *DescribeDBClustersPaginator { + options := DescribeDBClustersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeDBClustersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBClustersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeDBClusters page. +func (p *DescribeDBClustersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBClustersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeDBClusters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeCertificatesAPIClient is a client that implements the +// DescribeCertificates operation. +type DescribeCertificatesAPIClient interface { + DescribeCertificates(context.Context, *DescribeCertificatesInput, ...func(*Options)) (*DescribeCertificatesOutput, error) +} + +var _ DescribeCertificatesAPIClient = (*Client)(nil) + +// DescribeCertificatesPaginatorOptions is the paginator options for +// DescribeCertificates +type DescribeCertificatesPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: + // + // * Minimum: 20 + // + // * Maximum: 100 + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeCertificatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/docdb.DescribeCertificates +type DescribeCertificatesPaginator struct { + options DescribeCertificatesPaginatorOptions + client DescribeCertificatesAPIClient + params *DescribeCertificatesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeCertificatesPaginator returns a new DescribeCertificatesPaginator +func NewDescribeCertificatesPaginator(client DescribeCertificatesAPIClient, params *DescribeCertificatesInput, optFns ...func(*DescribeCertificatesPaginatorOptions)) *DescribeCertificatesPaginator { + options := DescribeCertificatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeCertificatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeCertificatesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeCertificates page. +func (p *DescribeCertificatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCertificatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeCertificates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeDBSubnetGroupsAPIClient is a client that implements the +// DescribeDBSubnetGroups operation. +type DescribeDBSubnetGroupsAPIClient interface { + DescribeDBSubnetGroups(context.Context, *DescribeDBSubnetGroupsInput, ...func(*Options)) (*DescribeDBSubnetGroupsOutput, error) +} + +var _ DescribeDBSubnetGroupsAPIClient = (*Client)(nil) + +// DescribeDBSubnetGroupsPaginatorOptions is the paginator options for +// DescribeDBSubnetGroups +type DescribeDBSubnetGroupsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token (marker) is included in + // the response so that the remaining results can be retrieved. Default: 100 + // Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeDBSubnetGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/docdb.DescribeDBSubnetGroups +type DescribeDBSubnetGroupsPaginator struct { + options DescribeDBSubnetGroupsPaginatorOptions + client DescribeDBSubnetGroupsAPIClient + params *DescribeDBSubnetGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeDBSubnetGroupsPaginator returns a new DescribeDBSubnetGroupsPaginator +func NewDescribeDBSubnetGroupsPaginator(client DescribeDBSubnetGroupsAPIClient, params *DescribeDBSubnetGroupsInput, optFns ...func(*DescribeDBSubnetGroupsPaginatorOptions)) *DescribeDBSubnetGroupsPaginator { + options := DescribeDBSubnetGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeDBSubnetGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBSubnetGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeDBSubnetGroups page. +func (p *DescribeDBSubnetGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBSubnetGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeDBSubnetGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeDBEngineVersionsAPIClient is a client that implements the +// DescribeDBEngineVersions operation. +type DescribeDBEngineVersionsAPIClient interface { + DescribeDBEngineVersions(context.Context, *DescribeDBEngineVersionsInput, ...func(*Options)) (*DescribeDBEngineVersionsOutput, error) +} + +var _ DescribeDBEngineVersionsAPIClient = (*Client)(nil) + +// DescribeDBEngineVersionsPaginatorOptions is the paginator options for +// DescribeDBEngineVersions +type DescribeDBEngineVersionsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token (marker) is included in + // the response so that the remaining results can be retrieved. Default: 100 + // Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeDBEngineVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/docdb.DescribeDBEngineVersions +type DescribeDBEngineVersionsPaginator struct { + options DescribeDBEngineVersionsPaginatorOptions + client DescribeDBEngineVersionsAPIClient + params *DescribeDBEngineVersionsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeDBEngineVersionsPaginator returns a new +// DescribeDBEngineVersionsPaginator +func NewDescribeDBEngineVersionsPaginator(client DescribeDBEngineVersionsAPIClient, params *DescribeDBEngineVersionsInput, optFns ...func(*DescribeDBEngineVersionsPaginatorOptions)) *DescribeDBEngineVersionsPaginator { + options := DescribeDBEngineVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeDBEngineVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBEngineVersionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeDBEngineVersions page. +func (p *DescribeDBEngineVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBEngineVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeDBEngineVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribePendingMaintenanceActionsAPIClient is a client that implements the +// DescribePendingMaintenanceActions operation. +type DescribePendingMaintenanceActionsAPIClient interface { + DescribePendingMaintenanceActions(context.Context, *DescribePendingMaintenanceActionsInput, ...func(*Options)) (*DescribePendingMaintenanceActionsOutput, error) +} + +var _ DescribePendingMaintenanceActionsAPIClient = (*Client)(nil) + +// DescribePendingMaintenanceActionsPaginatorOptions is the paginator options for +// DescribePendingMaintenanceActions +type DescribePendingMaintenanceActionsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token (marker) is included in + // the response so that the remaining results can be retrieved. Default: 100 + // Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribePendingMaintenanceActionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/docdb.DescribePendingMaintenanceActions +type DescribePendingMaintenanceActionsPaginator struct { + options DescribePendingMaintenanceActionsPaginatorOptions + client DescribePendingMaintenanceActionsAPIClient + params *DescribePendingMaintenanceActionsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribePendingMaintenanceActionsPaginator returns a new +// DescribePendingMaintenanceActionsPaginator +func NewDescribePendingMaintenanceActionsPaginator(client DescribePendingMaintenanceActionsAPIClient, params *DescribePendingMaintenanceActionsInput, optFns ...func(*DescribePendingMaintenanceActionsPaginatorOptions)) *DescribePendingMaintenanceActionsPaginator { + options := DescribePendingMaintenanceActionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribePendingMaintenanceActionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribePendingMaintenanceActionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribePendingMaintenanceActions page. +func (p *DescribePendingMaintenanceActionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribePendingMaintenanceActionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribePendingMaintenanceActions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeDBClusterParameterGroupsAPIClient is a client that implements the +// DescribeDBClusterParameterGroups operation. +type DescribeDBClusterParameterGroupsAPIClient interface { + DescribeDBClusterParameterGroups(context.Context, *DescribeDBClusterParameterGroupsInput, ...func(*Options)) (*DescribeDBClusterParameterGroupsOutput, error) +} + +var _ DescribeDBClusterParameterGroupsAPIClient = (*Client)(nil) + +// DescribeDBClusterParameterGroupsPaginatorOptions is the paginator options for +// DescribeDBClusterParameterGroups +type DescribeDBClusterParameterGroupsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token (marker) is included in + // the response so that the remaining results can be retrieved. Default: 100 + // Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeDBClusterParameterGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/docdb.DescribeDBClusterParameterGroups +type DescribeDBClusterParameterGroupsPaginator struct { + options DescribeDBClusterParameterGroupsPaginatorOptions + client DescribeDBClusterParameterGroupsAPIClient + params *DescribeDBClusterParameterGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeDBClusterParameterGroupsPaginator returns a new +// DescribeDBClusterParameterGroupsPaginator +func NewDescribeDBClusterParameterGroupsPaginator(client DescribeDBClusterParameterGroupsAPIClient, params *DescribeDBClusterParameterGroupsInput, optFns ...func(*DescribeDBClusterParameterGroupsPaginatorOptions)) *DescribeDBClusterParameterGroupsPaginator { + options := DescribeDBClusterParameterGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeDBClusterParameterGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBClusterParameterGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeDBClusterParameterGroups page. +func (p *DescribeDBClusterParameterGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBClusterParameterGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeDBClusterParameterGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeDBInstancesAPIClient is a client that implements the DescribeDBInstances +// operation. +type DescribeDBInstancesAPIClient interface { + DescribeDBInstances(context.Context, *DescribeDBInstancesInput, ...func(*Options)) (*DescribeDBInstancesOutput, error) +} + +var _ DescribeDBInstancesAPIClient = (*Client)(nil) + +// DescribeDBInstancesPaginatorOptions is the paginator options for +// DescribeDBInstances +type DescribeDBInstancesPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token (marker) is included in + // the response so that the remaining results can be retrieved. Default: 100 + // Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeDBInstancesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/docdb.DescribeDBInstances +type DescribeDBInstancesPaginator struct { + options DescribeDBInstancesPaginatorOptions + client DescribeDBInstancesAPIClient + params *DescribeDBInstancesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeDBInstancesPaginator returns a new DescribeDBInstancesPaginator +func NewDescribeDBInstancesPaginator(client DescribeDBInstancesAPIClient, params *DescribeDBInstancesInput, optFns ...func(*DescribeDBInstancesPaginatorOptions)) *DescribeDBInstancesPaginator { + options := DescribeDBInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeDBInstancesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBInstancesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeDBInstances page. +func (p *DescribeDBInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBInstancesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeDBInstances(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeOrderableDBInstanceOptionsAPIClient is a client that implements the +// DescribeOrderableDBInstanceOptions operation. +type DescribeOrderableDBInstanceOptionsAPIClient interface { + DescribeOrderableDBInstanceOptions(context.Context, *DescribeOrderableDBInstanceOptionsInput, ...func(*Options)) (*DescribeOrderableDBInstanceOptionsOutput, error) +} + +var _ DescribeOrderableDBInstanceOptionsAPIClient = (*Client)(nil) + +// DescribeOrderableDBInstanceOptionsPaginatorOptions is the paginator options for +// DescribeOrderableDBInstanceOptions +type DescribeOrderableDBInstanceOptionsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token (marker) is included in + // the response so that the remaining results can be retrieved. Default: 100 + // Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeOrderableDBInstanceOptionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/docdb.DescribeOrderableDBInstanceOptions +type DescribeOrderableDBInstanceOptionsPaginator struct { + options DescribeOrderableDBInstanceOptionsPaginatorOptions + client DescribeOrderableDBInstanceOptionsAPIClient + params *DescribeOrderableDBInstanceOptionsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeOrderableDBInstanceOptionsPaginator returns a new +// DescribeOrderableDBInstanceOptionsPaginator +func NewDescribeOrderableDBInstanceOptionsPaginator(client DescribeOrderableDBInstanceOptionsAPIClient, params *DescribeOrderableDBInstanceOptionsInput, optFns ...func(*DescribeOrderableDBInstanceOptionsPaginatorOptions)) *DescribeOrderableDBInstanceOptionsPaginator { + options := DescribeOrderableDBInstanceOptionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeOrderableDBInstanceOptionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeOrderableDBInstanceOptionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeOrderableDBInstanceOptions page. +func (p *DescribeOrderableDBInstanceOptionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeOrderableDBInstanceOptionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeOrderableDBInstanceOptions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeDBClusterSnapshotsAPIClient is a client that implements the +// DescribeDBClusterSnapshots operation. +type DescribeDBClusterSnapshotsAPIClient interface { + DescribeDBClusterSnapshots(context.Context, *DescribeDBClusterSnapshotsInput, ...func(*Options)) (*DescribeDBClusterSnapshotsOutput, error) +} + +var _ DescribeDBClusterSnapshotsAPIClient = (*Client)(nil) + +// DescribeDBClusterSnapshotsPaginatorOptions is the paginator options for +// DescribeDBClusterSnapshots +type DescribeDBClusterSnapshotsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token (marker) is included in + // the response so that the remaining results can be retrieved. Default: 100 + // Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeDBClusterSnapshotsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/docdb.DescribeDBClusterSnapshots +type DescribeDBClusterSnapshotsPaginator struct { + options DescribeDBClusterSnapshotsPaginatorOptions + client DescribeDBClusterSnapshotsAPIClient + params *DescribeDBClusterSnapshotsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeDBClusterSnapshotsPaginator returns a new +// DescribeDBClusterSnapshotsPaginator +func NewDescribeDBClusterSnapshotsPaginator(client DescribeDBClusterSnapshotsAPIClient, params *DescribeDBClusterSnapshotsInput, optFns ...func(*DescribeDBClusterSnapshotsPaginatorOptions)) *DescribeDBClusterSnapshotsPaginator { + options := DescribeDBClusterSnapshotsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeDBClusterSnapshotsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBClusterSnapshotsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeDBClusterSnapshots page. +func (p *DescribeDBClusterSnapshotsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBClusterSnapshotsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeDBClusterSnapshots(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeEventsAPIClient is a client that implements the DescribeEvents +// operation. +type DescribeEventsAPIClient interface { + DescribeEvents(context.Context, *DescribeEventsInput, ...func(*Options)) (*DescribeEventsOutput, error) +} + +var _ DescribeEventsAPIClient = (*Client)(nil) + +// DescribeEventsPaginatorOptions is the paginator options for DescribeEvents +type DescribeEventsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token (marker) is included in + // the response so that the remaining results can be retrieved. Default: 100 + // Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeEventsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/docdb.DescribeEvents +type DescribeEventsPaginator struct { + options DescribeEventsPaginatorOptions + client DescribeEventsAPIClient + params *DescribeEventsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeEventsPaginator returns a new DescribeEventsPaginator +func NewDescribeEventsPaginator(client DescribeEventsAPIClient, params *DescribeEventsInput, optFns ...func(*DescribeEventsPaginatorOptions)) *DescribeEventsPaginator { + options := DescribeEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeEventsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEventsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeEvents page. +func (p *DescribeEventsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEventsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeEvents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/dynamodb/go.sum b/service/dynamodb/go.sum index f37194ca529..c507b1ad6b5 100644 --- a/service/dynamodb/go.sum +++ b/service/dynamodb/go.sum @@ -1,3 +1,6 @@ +github.com/awslabs/smithy-go v0.3.0/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= diff --git a/service/dynamodb/paginators.go b/service/dynamodb/paginators.go new file mode 100644 index 00000000000..8a1f421f495 --- /dev/null +++ b/service/dynamodb/paginators.go @@ -0,0 +1,160 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package dynamodb + +import ( + "context" + "fmt" +) + +// ListTablesAPIClient is a client that implements the ListTables operation. +type ListTablesAPIClient interface { + ListTables(context.Context, *ListTablesInput, ...func(*Options)) (*ListTablesOutput, error) +} + +var _ ListTablesAPIClient = (*Client)(nil) + +// ListTablesPaginatorOptions is the paginator options for ListTables +type ListTablesPaginatorOptions struct { + // A maximum number of table names to return. If this parameter is not specified, + // the limit is 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTablesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/dynamodb.ListTables +type ListTablesPaginator struct { + options ListTablesPaginatorOptions + client ListTablesAPIClient + params *ListTablesInput + nextToken *string + firstPage bool + done bool +} + +// NewListTablesPaginator returns a new ListTablesPaginator +func NewListTablesPaginator(client ListTablesAPIClient, params *ListTablesInput, optFns ...func(*ListTablesPaginatorOptions)) *ListTablesPaginator { + options := ListTablesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTablesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTablesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTables page. +func (p *ListTablesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTablesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.ExclusiveStartTableName = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.ListTables(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.LastEvaluatedTableName + if p.options.StopOnDuplicateToken && params.ExclusiveStartTableName != nil && p.nextToken != nil && *params.ExclusiveStartTableName == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListContributorInsightsAPIClient is a client that implements the +// ListContributorInsights operation. +type ListContributorInsightsAPIClient interface { + ListContributorInsights(context.Context, *ListContributorInsightsInput, ...func(*Options)) (*ListContributorInsightsOutput, error) +} + +var _ ListContributorInsightsAPIClient = (*Client)(nil) + +// ListContributorInsightsPaginatorOptions is the paginator options for +// ListContributorInsights +type ListContributorInsightsPaginatorOptions struct { + // Maximum number of results to return per page. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListContributorInsightsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/dynamodb.ListContributorInsights +type ListContributorInsightsPaginator struct { + options ListContributorInsightsPaginatorOptions + client ListContributorInsightsAPIClient + params *ListContributorInsightsInput + nextToken *string + firstPage bool + done bool +} + +// NewListContributorInsightsPaginator returns a new +// ListContributorInsightsPaginator +func NewListContributorInsightsPaginator(client ListContributorInsightsAPIClient, params *ListContributorInsightsInput, optFns ...func(*ListContributorInsightsPaginatorOptions)) *ListContributorInsightsPaginator { + options := ListContributorInsightsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListContributorInsightsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListContributorInsightsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListContributorInsights page. +func (p *ListContributorInsightsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListContributorInsightsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListContributorInsights(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/dynamodbstreams/go.sum b/service/dynamodbstreams/go.sum index c669e324b14..32595049f96 100644 --- a/service/dynamodbstreams/go.sum +++ b/service/dynamodbstreams/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/ebs/go.sum b/service/ebs/go.sum index c669e324b14..32595049f96 100644 --- a/service/ebs/go.sum +++ b/service/ebs/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/ebs/paginators.go b/service/ebs/paginators.go new file mode 100644 index 00000000000..06ec240fd92 --- /dev/null +++ b/service/ebs/paginators.go @@ -0,0 +1,159 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ebs + +import ( + "context" + "fmt" +) + +// ListChangedBlocksAPIClient is a client that implements the ListChangedBlocks +// operation. +type ListChangedBlocksAPIClient interface { + ListChangedBlocks(context.Context, *ListChangedBlocksInput, ...func(*Options)) (*ListChangedBlocksOutput, error) +} + +var _ ListChangedBlocksAPIClient = (*Client)(nil) + +// ListChangedBlocksPaginatorOptions is the paginator options for ListChangedBlocks +type ListChangedBlocksPaginatorOptions struct { + // The number of results to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListChangedBlocksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ebs.ListChangedBlocks +type ListChangedBlocksPaginator struct { + options ListChangedBlocksPaginatorOptions + client ListChangedBlocksAPIClient + params *ListChangedBlocksInput + nextToken *string + firstPage bool + done bool +} + +// NewListChangedBlocksPaginator returns a new ListChangedBlocksPaginator +func NewListChangedBlocksPaginator(client ListChangedBlocksAPIClient, params *ListChangedBlocksInput, optFns ...func(*ListChangedBlocksPaginatorOptions)) *ListChangedBlocksPaginator { + options := ListChangedBlocksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListChangedBlocksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListChangedBlocksPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListChangedBlocks page. +func (p *ListChangedBlocksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListChangedBlocksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListChangedBlocks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListSnapshotBlocksAPIClient is a client that implements the ListSnapshotBlocks +// operation. +type ListSnapshotBlocksAPIClient interface { + ListSnapshotBlocks(context.Context, *ListSnapshotBlocksInput, ...func(*Options)) (*ListSnapshotBlocksOutput, error) +} + +var _ ListSnapshotBlocksAPIClient = (*Client)(nil) + +// ListSnapshotBlocksPaginatorOptions is the paginator options for +// ListSnapshotBlocks +type ListSnapshotBlocksPaginatorOptions struct { + // The number of results to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListSnapshotBlocksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ebs.ListSnapshotBlocks +type ListSnapshotBlocksPaginator struct { + options ListSnapshotBlocksPaginatorOptions + client ListSnapshotBlocksAPIClient + params *ListSnapshotBlocksInput + nextToken *string + firstPage bool + done bool +} + +// NewListSnapshotBlocksPaginator returns a new ListSnapshotBlocksPaginator +func NewListSnapshotBlocksPaginator(client ListSnapshotBlocksAPIClient, params *ListSnapshotBlocksInput, optFns ...func(*ListSnapshotBlocksPaginatorOptions)) *ListSnapshotBlocksPaginator { + options := ListSnapshotBlocksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListSnapshotBlocksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSnapshotBlocksPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListSnapshotBlocks page. +func (p *ListSnapshotBlocksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSnapshotBlocksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListSnapshotBlocks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/ec2/go.sum b/service/ec2/go.sum index 8a4986a5fc4..875bf37048a 100644 --- a/service/ec2/go.sum +++ b/service/ec2/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/ec2/paginators.go b/service/ec2/paginators.go new file mode 100644 index 00000000000..1cf4196f31a --- /dev/null +++ b/service/ec2/paginators.go @@ -0,0 +1,7057 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ec2 + +import ( + "context" + "fmt" +) + +// DescribeTransitGatewaysAPIClient is a client that implements the +// DescribeTransitGateways operation. +type DescribeTransitGatewaysAPIClient interface { + DescribeTransitGateways(context.Context, *DescribeTransitGatewaysInput, ...func(*Options)) (*DescribeTransitGatewaysOutput, error) +} + +var _ DescribeTransitGatewaysAPIClient = (*Client)(nil) + +// DescribeTransitGatewaysPaginatorOptions is the paginator options for +// DescribeTransitGateways +type DescribeTransitGatewaysPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeTransitGatewaysPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeTransitGateways +type DescribeTransitGatewaysPaginator struct { + options DescribeTransitGatewaysPaginatorOptions + client DescribeTransitGatewaysAPIClient + params *DescribeTransitGatewaysInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeTransitGatewaysPaginator returns a new +// DescribeTransitGatewaysPaginator +func NewDescribeTransitGatewaysPaginator(client DescribeTransitGatewaysAPIClient, params *DescribeTransitGatewaysInput, optFns ...func(*DescribeTransitGatewaysPaginatorOptions)) *DescribeTransitGatewaysPaginator { + options := DescribeTransitGatewaysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeTransitGatewaysPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeTransitGatewaysPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeTransitGateways page. +func (p *DescribeTransitGatewaysPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTransitGatewaysOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeTransitGateways(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeDhcpOptionsAPIClient is a client that implements the DescribeDhcpOptions +// operation. +type DescribeDhcpOptionsAPIClient interface { + DescribeDhcpOptions(context.Context, *DescribeDhcpOptionsInput, ...func(*Options)) (*DescribeDhcpOptionsOutput, error) +} + +var _ DescribeDhcpOptionsAPIClient = (*Client)(nil) + +// DescribeDhcpOptionsPaginatorOptions is the paginator options for +// DescribeDhcpOptions +type DescribeDhcpOptionsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeDhcpOptionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeDhcpOptions +type DescribeDhcpOptionsPaginator struct { + options DescribeDhcpOptionsPaginatorOptions + client DescribeDhcpOptionsAPIClient + params *DescribeDhcpOptionsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeDhcpOptionsPaginator returns a new DescribeDhcpOptionsPaginator +func NewDescribeDhcpOptionsPaginator(client DescribeDhcpOptionsAPIClient, params *DescribeDhcpOptionsInput, optFns ...func(*DescribeDhcpOptionsPaginatorOptions)) *DescribeDhcpOptionsPaginator { + options := DescribeDhcpOptionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeDhcpOptionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDhcpOptionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeDhcpOptions page. +func (p *DescribeDhcpOptionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDhcpOptionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeDhcpOptions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeFleetsAPIClient is a client that implements the DescribeFleets +// operation. +type DescribeFleetsAPIClient interface { + DescribeFleets(context.Context, *DescribeFleetsInput, ...func(*Options)) (*DescribeFleetsOutput, error) +} + +var _ DescribeFleetsAPIClient = (*Client)(nil) + +// DescribeFleetsPaginatorOptions is the paginator options for DescribeFleets +type DescribeFleetsPaginatorOptions struct { + // The maximum number of results to return in a single call. Specify a value + // between 1 and 1000. The default value is 1000. To retrieve the remaining + // results, make another call with the returned NextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeFleetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeFleets +type DescribeFleetsPaginator struct { + options DescribeFleetsPaginatorOptions + client DescribeFleetsAPIClient + params *DescribeFleetsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeFleetsPaginator returns a new DescribeFleetsPaginator +func NewDescribeFleetsPaginator(client DescribeFleetsAPIClient, params *DescribeFleetsInput, optFns ...func(*DescribeFleetsPaginatorOptions)) *DescribeFleetsPaginator { + options := DescribeFleetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeFleetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeFleetsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeFleets page. +func (p *DescribeFleetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeFleetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeFleets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeVpcPeeringConnectionsAPIClient is a client that implements the +// DescribeVpcPeeringConnections operation. +type DescribeVpcPeeringConnectionsAPIClient interface { + DescribeVpcPeeringConnections(context.Context, *DescribeVpcPeeringConnectionsInput, ...func(*Options)) (*DescribeVpcPeeringConnectionsOutput, error) +} + +var _ DescribeVpcPeeringConnectionsAPIClient = (*Client)(nil) + +// DescribeVpcPeeringConnectionsPaginatorOptions is the paginator options for +// DescribeVpcPeeringConnections +type DescribeVpcPeeringConnectionsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeVpcPeeringConnectionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeVpcPeeringConnections +type DescribeVpcPeeringConnectionsPaginator struct { + options DescribeVpcPeeringConnectionsPaginatorOptions + client DescribeVpcPeeringConnectionsAPIClient + params *DescribeVpcPeeringConnectionsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeVpcPeeringConnectionsPaginator returns a new +// DescribeVpcPeeringConnectionsPaginator +func NewDescribeVpcPeeringConnectionsPaginator(client DescribeVpcPeeringConnectionsAPIClient, params *DescribeVpcPeeringConnectionsInput, optFns ...func(*DescribeVpcPeeringConnectionsPaginatorOptions)) *DescribeVpcPeeringConnectionsPaginator { + options := DescribeVpcPeeringConnectionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeVpcPeeringConnectionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeVpcPeeringConnectionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeVpcPeeringConnections page. +func (p *DescribeVpcPeeringConnectionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeVpcPeeringConnectionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeVpcPeeringConnections(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeInstanceTypesAPIClient is a client that implements the +// DescribeInstanceTypes operation. +type DescribeInstanceTypesAPIClient interface { + DescribeInstanceTypes(context.Context, *DescribeInstanceTypesInput, ...func(*Options)) (*DescribeInstanceTypesOutput, error) +} + +var _ DescribeInstanceTypesAPIClient = (*Client)(nil) + +// DescribeInstanceTypesPaginatorOptions is the paginator options for +// DescribeInstanceTypes +type DescribeInstanceTypesPaginatorOptions struct { + // The maximum number of results to return for the request in a single page. The + // remaining results can be seen by sending another request with the next token + // value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeInstanceTypesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeInstanceTypes +type DescribeInstanceTypesPaginator struct { + options DescribeInstanceTypesPaginatorOptions + client DescribeInstanceTypesAPIClient + params *DescribeInstanceTypesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeInstanceTypesPaginator returns a new DescribeInstanceTypesPaginator +func NewDescribeInstanceTypesPaginator(client DescribeInstanceTypesAPIClient, params *DescribeInstanceTypesInput, optFns ...func(*DescribeInstanceTypesPaginatorOptions)) *DescribeInstanceTypesPaginator { + options := DescribeInstanceTypesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeInstanceTypesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeInstanceTypesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeInstanceTypes page. +func (p *DescribeInstanceTypesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInstanceTypesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeInstanceTypes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeScheduledInstancesAPIClient is a client that implements the +// DescribeScheduledInstances operation. +type DescribeScheduledInstancesAPIClient interface { + DescribeScheduledInstances(context.Context, *DescribeScheduledInstancesInput, ...func(*Options)) (*DescribeScheduledInstancesOutput, error) +} + +var _ DescribeScheduledInstancesAPIClient = (*Client)(nil) + +// DescribeScheduledInstancesPaginatorOptions is the paginator options for +// DescribeScheduledInstances +type DescribeScheduledInstancesPaginatorOptions struct { + // The maximum number of results to return in a single call. This value can be + // between 5 and 300. The default value is 100. To retrieve the remaining results, + // make another call with the returned NextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeScheduledInstancesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeScheduledInstances +type DescribeScheduledInstancesPaginator struct { + options DescribeScheduledInstancesPaginatorOptions + client DescribeScheduledInstancesAPIClient + params *DescribeScheduledInstancesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeScheduledInstancesPaginator returns a new +// DescribeScheduledInstancesPaginator +func NewDescribeScheduledInstancesPaginator(client DescribeScheduledInstancesAPIClient, params *DescribeScheduledInstancesInput, optFns ...func(*DescribeScheduledInstancesPaginatorOptions)) *DescribeScheduledInstancesPaginator { + options := DescribeScheduledInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeScheduledInstancesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeScheduledInstancesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeScheduledInstances page. +func (p *DescribeScheduledInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeScheduledInstancesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeScheduledInstances(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeIpv6PoolsAPIClient is a client that implements the DescribeIpv6Pools +// operation. +type DescribeIpv6PoolsAPIClient interface { + DescribeIpv6Pools(context.Context, *DescribeIpv6PoolsInput, ...func(*Options)) (*DescribeIpv6PoolsOutput, error) +} + +var _ DescribeIpv6PoolsAPIClient = (*Client)(nil) + +// DescribeIpv6PoolsPaginatorOptions is the paginator options for DescribeIpv6Pools +type DescribeIpv6PoolsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeIpv6PoolsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeIpv6Pools +type DescribeIpv6PoolsPaginator struct { + options DescribeIpv6PoolsPaginatorOptions + client DescribeIpv6PoolsAPIClient + params *DescribeIpv6PoolsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeIpv6PoolsPaginator returns a new DescribeIpv6PoolsPaginator +func NewDescribeIpv6PoolsPaginator(client DescribeIpv6PoolsAPIClient, params *DescribeIpv6PoolsInput, optFns ...func(*DescribeIpv6PoolsPaginatorOptions)) *DescribeIpv6PoolsPaginator { + options := DescribeIpv6PoolsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeIpv6PoolsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeIpv6PoolsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeIpv6Pools page. +func (p *DescribeIpv6PoolsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeIpv6PoolsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeIpv6Pools(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetTransitGatewayMulticastDomainAssociationsAPIClient is a client that +// implements the GetTransitGatewayMulticastDomainAssociations operation. +type GetTransitGatewayMulticastDomainAssociationsAPIClient interface { + GetTransitGatewayMulticastDomainAssociations(context.Context, *GetTransitGatewayMulticastDomainAssociationsInput, ...func(*Options)) (*GetTransitGatewayMulticastDomainAssociationsOutput, error) +} + +var _ GetTransitGatewayMulticastDomainAssociationsAPIClient = (*Client)(nil) + +// GetTransitGatewayMulticastDomainAssociationsPaginatorOptions is the paginator +// options for GetTransitGatewayMulticastDomainAssociations +type GetTransitGatewayMulticastDomainAssociationsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetTransitGatewayMulticastDomainAssociationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.GetTransitGatewayMulticastDomainAssociations +type GetTransitGatewayMulticastDomainAssociationsPaginator struct { + options GetTransitGatewayMulticastDomainAssociationsPaginatorOptions + client GetTransitGatewayMulticastDomainAssociationsAPIClient + params *GetTransitGatewayMulticastDomainAssociationsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetTransitGatewayMulticastDomainAssociationsPaginator returns a new +// GetTransitGatewayMulticastDomainAssociationsPaginator +func NewGetTransitGatewayMulticastDomainAssociationsPaginator(client GetTransitGatewayMulticastDomainAssociationsAPIClient, params *GetTransitGatewayMulticastDomainAssociationsInput, optFns ...func(*GetTransitGatewayMulticastDomainAssociationsPaginatorOptions)) *GetTransitGatewayMulticastDomainAssociationsPaginator { + options := GetTransitGatewayMulticastDomainAssociationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetTransitGatewayMulticastDomainAssociationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetTransitGatewayMulticastDomainAssociationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetTransitGatewayMulticastDomainAssociations page. +func (p *GetTransitGatewayMulticastDomainAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetTransitGatewayMulticastDomainAssociationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetTransitGatewayMulticastDomainAssociations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeLocalGatewayVirtualInterfacesAPIClient is a client that implements the +// DescribeLocalGatewayVirtualInterfaces operation. +type DescribeLocalGatewayVirtualInterfacesAPIClient interface { + DescribeLocalGatewayVirtualInterfaces(context.Context, *DescribeLocalGatewayVirtualInterfacesInput, ...func(*Options)) (*DescribeLocalGatewayVirtualInterfacesOutput, error) +} + +var _ DescribeLocalGatewayVirtualInterfacesAPIClient = (*Client)(nil) + +// DescribeLocalGatewayVirtualInterfacesPaginatorOptions is the paginator options +// for DescribeLocalGatewayVirtualInterfaces +type DescribeLocalGatewayVirtualInterfacesPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeLocalGatewayVirtualInterfacesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeLocalGatewayVirtualInterfaces +type DescribeLocalGatewayVirtualInterfacesPaginator struct { + options DescribeLocalGatewayVirtualInterfacesPaginatorOptions + client DescribeLocalGatewayVirtualInterfacesAPIClient + params *DescribeLocalGatewayVirtualInterfacesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeLocalGatewayVirtualInterfacesPaginator returns a new +// DescribeLocalGatewayVirtualInterfacesPaginator +func NewDescribeLocalGatewayVirtualInterfacesPaginator(client DescribeLocalGatewayVirtualInterfacesAPIClient, params *DescribeLocalGatewayVirtualInterfacesInput, optFns ...func(*DescribeLocalGatewayVirtualInterfacesPaginatorOptions)) *DescribeLocalGatewayVirtualInterfacesPaginator { + options := DescribeLocalGatewayVirtualInterfacesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeLocalGatewayVirtualInterfacesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeLocalGatewayVirtualInterfacesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeLocalGatewayVirtualInterfaces page. +func (p *DescribeLocalGatewayVirtualInterfacesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeLocalGatewayVirtualInterfacesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeLocalGatewayVirtualInterfaces(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeTransitGatewayPeeringAttachmentsAPIClient is a client that implements +// the DescribeTransitGatewayPeeringAttachments operation. +type DescribeTransitGatewayPeeringAttachmentsAPIClient interface { + DescribeTransitGatewayPeeringAttachments(context.Context, *DescribeTransitGatewayPeeringAttachmentsInput, ...func(*Options)) (*DescribeTransitGatewayPeeringAttachmentsOutput, error) +} + +var _ DescribeTransitGatewayPeeringAttachmentsAPIClient = (*Client)(nil) + +// DescribeTransitGatewayPeeringAttachmentsPaginatorOptions is the paginator +// options for DescribeTransitGatewayPeeringAttachments +type DescribeTransitGatewayPeeringAttachmentsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeTransitGatewayPeeringAttachmentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeTransitGatewayPeeringAttachments +type DescribeTransitGatewayPeeringAttachmentsPaginator struct { + options DescribeTransitGatewayPeeringAttachmentsPaginatorOptions + client DescribeTransitGatewayPeeringAttachmentsAPIClient + params *DescribeTransitGatewayPeeringAttachmentsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeTransitGatewayPeeringAttachmentsPaginator returns a new +// DescribeTransitGatewayPeeringAttachmentsPaginator +func NewDescribeTransitGatewayPeeringAttachmentsPaginator(client DescribeTransitGatewayPeeringAttachmentsAPIClient, params *DescribeTransitGatewayPeeringAttachmentsInput, optFns ...func(*DescribeTransitGatewayPeeringAttachmentsPaginatorOptions)) *DescribeTransitGatewayPeeringAttachmentsPaginator { + options := DescribeTransitGatewayPeeringAttachmentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeTransitGatewayPeeringAttachmentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeTransitGatewayPeeringAttachmentsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeTransitGatewayPeeringAttachments page. +func (p *DescribeTransitGatewayPeeringAttachmentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTransitGatewayPeeringAttachmentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeTransitGatewayPeeringAttachments(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeHostReservationOfferingsAPIClient is a client that implements the +// DescribeHostReservationOfferings operation. +type DescribeHostReservationOfferingsAPIClient interface { + DescribeHostReservationOfferings(context.Context, *DescribeHostReservationOfferingsInput, ...func(*Options)) (*DescribeHostReservationOfferingsOutput, error) +} + +var _ DescribeHostReservationOfferingsAPIClient = (*Client)(nil) + +// DescribeHostReservationOfferingsPaginatorOptions is the paginator options for +// DescribeHostReservationOfferings +type DescribeHostReservationOfferingsPaginatorOptions struct { + // The maximum number of results to return for the request in a single page. The + // remaining results can be seen by sending another request with the returned + // nextToken value. This value can be between 5 and 500. If maxResults is given a + // larger value than 500, you receive an error. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeHostReservationOfferingsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeHostReservationOfferings +type DescribeHostReservationOfferingsPaginator struct { + options DescribeHostReservationOfferingsPaginatorOptions + client DescribeHostReservationOfferingsAPIClient + params *DescribeHostReservationOfferingsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeHostReservationOfferingsPaginator returns a new +// DescribeHostReservationOfferingsPaginator +func NewDescribeHostReservationOfferingsPaginator(client DescribeHostReservationOfferingsAPIClient, params *DescribeHostReservationOfferingsInput, optFns ...func(*DescribeHostReservationOfferingsPaginatorOptions)) *DescribeHostReservationOfferingsPaginator { + options := DescribeHostReservationOfferingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeHostReservationOfferingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeHostReservationOfferingsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeHostReservationOfferings page. +func (p *DescribeHostReservationOfferingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeHostReservationOfferingsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeHostReservationOfferings(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeLaunchTemplateVersionsAPIClient is a client that implements the +// DescribeLaunchTemplateVersions operation. +type DescribeLaunchTemplateVersionsAPIClient interface { + DescribeLaunchTemplateVersions(context.Context, *DescribeLaunchTemplateVersionsInput, ...func(*Options)) (*DescribeLaunchTemplateVersionsOutput, error) +} + +var _ DescribeLaunchTemplateVersionsAPIClient = (*Client)(nil) + +// DescribeLaunchTemplateVersionsPaginatorOptions is the paginator options for +// DescribeLaunchTemplateVersions +type DescribeLaunchTemplateVersionsPaginatorOptions struct { + // The maximum number of results to return in a single call. To retrieve the + // remaining results, make another call with the returned NextToken value. This + // value can be between 1 and 200. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeLaunchTemplateVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeLaunchTemplateVersions +type DescribeLaunchTemplateVersionsPaginator struct { + options DescribeLaunchTemplateVersionsPaginatorOptions + client DescribeLaunchTemplateVersionsAPIClient + params *DescribeLaunchTemplateVersionsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeLaunchTemplateVersionsPaginator returns a new +// DescribeLaunchTemplateVersionsPaginator +func NewDescribeLaunchTemplateVersionsPaginator(client DescribeLaunchTemplateVersionsAPIClient, params *DescribeLaunchTemplateVersionsInput, optFns ...func(*DescribeLaunchTemplateVersionsPaginatorOptions)) *DescribeLaunchTemplateVersionsPaginator { + options := DescribeLaunchTemplateVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeLaunchTemplateVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeLaunchTemplateVersionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeLaunchTemplateVersions page. +func (p *DescribeLaunchTemplateVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeLaunchTemplateVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeLaunchTemplateVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetManagedPrefixListEntriesAPIClient is a client that implements the +// GetManagedPrefixListEntries operation. +type GetManagedPrefixListEntriesAPIClient interface { + GetManagedPrefixListEntries(context.Context, *GetManagedPrefixListEntriesInput, ...func(*Options)) (*GetManagedPrefixListEntriesOutput, error) +} + +var _ GetManagedPrefixListEntriesAPIClient = (*Client)(nil) + +// GetManagedPrefixListEntriesPaginatorOptions is the paginator options for +// GetManagedPrefixListEntries +type GetManagedPrefixListEntriesPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetManagedPrefixListEntriesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.GetManagedPrefixListEntries +type GetManagedPrefixListEntriesPaginator struct { + options GetManagedPrefixListEntriesPaginatorOptions + client GetManagedPrefixListEntriesAPIClient + params *GetManagedPrefixListEntriesInput + nextToken *string + firstPage bool + done bool +} + +// NewGetManagedPrefixListEntriesPaginator returns a new +// GetManagedPrefixListEntriesPaginator +func NewGetManagedPrefixListEntriesPaginator(client GetManagedPrefixListEntriesAPIClient, params *GetManagedPrefixListEntriesInput, optFns ...func(*GetManagedPrefixListEntriesPaginatorOptions)) *GetManagedPrefixListEntriesPaginator { + options := GetManagedPrefixListEntriesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetManagedPrefixListEntriesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetManagedPrefixListEntriesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetManagedPrefixListEntries page. +func (p *GetManagedPrefixListEntriesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetManagedPrefixListEntriesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetManagedPrefixListEntries(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribePublicIpv4PoolsAPIClient is a client that implements the +// DescribePublicIpv4Pools operation. +type DescribePublicIpv4PoolsAPIClient interface { + DescribePublicIpv4Pools(context.Context, *DescribePublicIpv4PoolsInput, ...func(*Options)) (*DescribePublicIpv4PoolsOutput, error) +} + +var _ DescribePublicIpv4PoolsAPIClient = (*Client)(nil) + +// DescribePublicIpv4PoolsPaginatorOptions is the paginator options for +// DescribePublicIpv4Pools +type DescribePublicIpv4PoolsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribePublicIpv4PoolsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribePublicIpv4Pools +type DescribePublicIpv4PoolsPaginator struct { + options DescribePublicIpv4PoolsPaginatorOptions + client DescribePublicIpv4PoolsAPIClient + params *DescribePublicIpv4PoolsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribePublicIpv4PoolsPaginator returns a new +// DescribePublicIpv4PoolsPaginator +func NewDescribePublicIpv4PoolsPaginator(client DescribePublicIpv4PoolsAPIClient, params *DescribePublicIpv4PoolsInput, optFns ...func(*DescribePublicIpv4PoolsPaginatorOptions)) *DescribePublicIpv4PoolsPaginator { + options := DescribePublicIpv4PoolsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribePublicIpv4PoolsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribePublicIpv4PoolsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribePublicIpv4Pools page. +func (p *DescribePublicIpv4PoolsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribePublicIpv4PoolsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribePublicIpv4Pools(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeVolumeStatusAPIClient is a client that implements the +// DescribeVolumeStatus operation. +type DescribeVolumeStatusAPIClient interface { + DescribeVolumeStatus(context.Context, *DescribeVolumeStatusInput, ...func(*Options)) (*DescribeVolumeStatusOutput, error) +} + +var _ DescribeVolumeStatusAPIClient = (*Client)(nil) + +// DescribeVolumeStatusPaginatorOptions is the paginator options for +// DescribeVolumeStatus +type DescribeVolumeStatusPaginatorOptions struct { + // The maximum number of volume results returned by DescribeVolumeStatus in + // paginated output. When this parameter is used, the request only returns + // MaxResults results in a single page along with a NextToken response element. The + // remaining results of the initial request can be seen by sending another request + // with the returned NextToken value. This value can be between 5 and 1000; if + // MaxResults is given a value larger than 1000, only 1000 results are returned. If + // this parameter is not used, then DescribeVolumeStatus returns all results. You + // cannot specify this parameter and the volume IDs parameter in the same request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeVolumeStatusPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeVolumeStatus +type DescribeVolumeStatusPaginator struct { + options DescribeVolumeStatusPaginatorOptions + client DescribeVolumeStatusAPIClient + params *DescribeVolumeStatusInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeVolumeStatusPaginator returns a new DescribeVolumeStatusPaginator +func NewDescribeVolumeStatusPaginator(client DescribeVolumeStatusAPIClient, params *DescribeVolumeStatusInput, optFns ...func(*DescribeVolumeStatusPaginatorOptions)) *DescribeVolumeStatusPaginator { + options := DescribeVolumeStatusPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeVolumeStatusPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeVolumeStatusPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeVolumeStatus page. +func (p *DescribeVolumeStatusPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeVolumeStatusOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeVolumeStatus(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeVolumesModificationsAPIClient is a client that implements the +// DescribeVolumesModifications operation. +type DescribeVolumesModificationsAPIClient interface { + DescribeVolumesModifications(context.Context, *DescribeVolumesModificationsInput, ...func(*Options)) (*DescribeVolumesModificationsOutput, error) +} + +var _ DescribeVolumesModificationsAPIClient = (*Client)(nil) + +// DescribeVolumesModificationsPaginatorOptions is the paginator options for +// DescribeVolumesModifications +type DescribeVolumesModificationsPaginatorOptions struct { + // The maximum number of results (up to a limit of 500) to be returned in a + // paginated request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeVolumesModificationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeVolumesModifications +type DescribeVolumesModificationsPaginator struct { + options DescribeVolumesModificationsPaginatorOptions + client DescribeVolumesModificationsAPIClient + params *DescribeVolumesModificationsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeVolumesModificationsPaginator returns a new +// DescribeVolumesModificationsPaginator +func NewDescribeVolumesModificationsPaginator(client DescribeVolumesModificationsAPIClient, params *DescribeVolumesModificationsInput, optFns ...func(*DescribeVolumesModificationsPaginatorOptions)) *DescribeVolumesModificationsPaginator { + options := DescribeVolumesModificationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeVolumesModificationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeVolumesModificationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeVolumesModifications page. +func (p *DescribeVolumesModificationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeVolumesModificationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeVolumesModifications(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeHostsAPIClient is a client that implements the DescribeHosts operation. +type DescribeHostsAPIClient interface { + DescribeHosts(context.Context, *DescribeHostsInput, ...func(*Options)) (*DescribeHostsOutput, error) +} + +var _ DescribeHostsAPIClient = (*Client)(nil) + +// DescribeHostsPaginatorOptions is the paginator options for DescribeHosts +type DescribeHostsPaginatorOptions struct { + // The maximum number of results to return for the request in a single page. The + // remaining results can be seen by sending another request with the returned + // nextToken value. This value can be between 5 and 500. If maxResults is given a + // larger value than 500, you receive an error. You cannot specify this parameter + // and the host IDs parameter in the same request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeHostsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeHosts +type DescribeHostsPaginator struct { + options DescribeHostsPaginatorOptions + client DescribeHostsAPIClient + params *DescribeHostsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeHostsPaginator returns a new DescribeHostsPaginator +func NewDescribeHostsPaginator(client DescribeHostsAPIClient, params *DescribeHostsInput, optFns ...func(*DescribeHostsPaginatorOptions)) *DescribeHostsPaginator { + options := DescribeHostsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeHostsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeHostsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeHosts page. +func (p *DescribeHostsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeHostsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeHosts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeImportSnapshotTasksAPIClient is a client that implements the +// DescribeImportSnapshotTasks operation. +type DescribeImportSnapshotTasksAPIClient interface { + DescribeImportSnapshotTasks(context.Context, *DescribeImportSnapshotTasksInput, ...func(*Options)) (*DescribeImportSnapshotTasksOutput, error) +} + +var _ DescribeImportSnapshotTasksAPIClient = (*Client)(nil) + +// DescribeImportSnapshotTasksPaginatorOptions is the paginator options for +// DescribeImportSnapshotTasks +type DescribeImportSnapshotTasksPaginatorOptions struct { + // The maximum number of results to return in a single call. To retrieve the + // remaining results, make another call with the returned NextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeImportSnapshotTasksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeImportSnapshotTasks +type DescribeImportSnapshotTasksPaginator struct { + options DescribeImportSnapshotTasksPaginatorOptions + client DescribeImportSnapshotTasksAPIClient + params *DescribeImportSnapshotTasksInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeImportSnapshotTasksPaginator returns a new +// DescribeImportSnapshotTasksPaginator +func NewDescribeImportSnapshotTasksPaginator(client DescribeImportSnapshotTasksAPIClient, params *DescribeImportSnapshotTasksInput, optFns ...func(*DescribeImportSnapshotTasksPaginatorOptions)) *DescribeImportSnapshotTasksPaginator { + options := DescribeImportSnapshotTasksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeImportSnapshotTasksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeImportSnapshotTasksPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeImportSnapshotTasks page. +func (p *DescribeImportSnapshotTasksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeImportSnapshotTasksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeImportSnapshotTasks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeSpotPriceHistoryAPIClient is a client that implements the +// DescribeSpotPriceHistory operation. +type DescribeSpotPriceHistoryAPIClient interface { + DescribeSpotPriceHistory(context.Context, *DescribeSpotPriceHistoryInput, ...func(*Options)) (*DescribeSpotPriceHistoryOutput, error) +} + +var _ DescribeSpotPriceHistoryAPIClient = (*Client)(nil) + +// DescribeSpotPriceHistoryPaginatorOptions is the paginator options for +// DescribeSpotPriceHistory +type DescribeSpotPriceHistoryPaginatorOptions struct { + // The maximum number of results to return in a single call. Specify a value + // between 1 and 1000. The default value is 1000. To retrieve the remaining + // results, make another call with the returned NextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeSpotPriceHistoryPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeSpotPriceHistory +type DescribeSpotPriceHistoryPaginator struct { + options DescribeSpotPriceHistoryPaginatorOptions + client DescribeSpotPriceHistoryAPIClient + params *DescribeSpotPriceHistoryInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeSpotPriceHistoryPaginator returns a new +// DescribeSpotPriceHistoryPaginator +func NewDescribeSpotPriceHistoryPaginator(client DescribeSpotPriceHistoryAPIClient, params *DescribeSpotPriceHistoryInput, optFns ...func(*DescribeSpotPriceHistoryPaginatorOptions)) *DescribeSpotPriceHistoryPaginator { + options := DescribeSpotPriceHistoryPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeSpotPriceHistoryPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeSpotPriceHistoryPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeSpotPriceHistory page. +func (p *DescribeSpotPriceHistoryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeSpotPriceHistoryOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeSpotPriceHistory(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeInternetGatewaysAPIClient is a client that implements the +// DescribeInternetGateways operation. +type DescribeInternetGatewaysAPIClient interface { + DescribeInternetGateways(context.Context, *DescribeInternetGatewaysInput, ...func(*Options)) (*DescribeInternetGatewaysOutput, error) +} + +var _ DescribeInternetGatewaysAPIClient = (*Client)(nil) + +// DescribeInternetGatewaysPaginatorOptions is the paginator options for +// DescribeInternetGateways +type DescribeInternetGatewaysPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeInternetGatewaysPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeInternetGateways +type DescribeInternetGatewaysPaginator struct { + options DescribeInternetGatewaysPaginatorOptions + client DescribeInternetGatewaysAPIClient + params *DescribeInternetGatewaysInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeInternetGatewaysPaginator returns a new +// DescribeInternetGatewaysPaginator +func NewDescribeInternetGatewaysPaginator(client DescribeInternetGatewaysAPIClient, params *DescribeInternetGatewaysInput, optFns ...func(*DescribeInternetGatewaysPaginatorOptions)) *DescribeInternetGatewaysPaginator { + options := DescribeInternetGatewaysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeInternetGatewaysPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeInternetGatewaysPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeInternetGateways page. +func (p *DescribeInternetGatewaysPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInternetGatewaysOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeInternetGateways(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeImportImageTasksAPIClient is a client that implements the +// DescribeImportImageTasks operation. +type DescribeImportImageTasksAPIClient interface { + DescribeImportImageTasks(context.Context, *DescribeImportImageTasksInput, ...func(*Options)) (*DescribeImportImageTasksOutput, error) +} + +var _ DescribeImportImageTasksAPIClient = (*Client)(nil) + +// DescribeImportImageTasksPaginatorOptions is the paginator options for +// DescribeImportImageTasks +type DescribeImportImageTasksPaginatorOptions struct { + // The maximum number of results to return in a single call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeImportImageTasksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeImportImageTasks +type DescribeImportImageTasksPaginator struct { + options DescribeImportImageTasksPaginatorOptions + client DescribeImportImageTasksAPIClient + params *DescribeImportImageTasksInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeImportImageTasksPaginator returns a new +// DescribeImportImageTasksPaginator +func NewDescribeImportImageTasksPaginator(client DescribeImportImageTasksAPIClient, params *DescribeImportImageTasksInput, optFns ...func(*DescribeImportImageTasksPaginatorOptions)) *DescribeImportImageTasksPaginator { + options := DescribeImportImageTasksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeImportImageTasksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeImportImageTasksPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeImportImageTasks page. +func (p *DescribeImportImageTasksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeImportImageTasksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeImportImageTasks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetTransitGatewayPrefixListReferencesAPIClient is a client that implements the +// GetTransitGatewayPrefixListReferences operation. +type GetTransitGatewayPrefixListReferencesAPIClient interface { + GetTransitGatewayPrefixListReferences(context.Context, *GetTransitGatewayPrefixListReferencesInput, ...func(*Options)) (*GetTransitGatewayPrefixListReferencesOutput, error) +} + +var _ GetTransitGatewayPrefixListReferencesAPIClient = (*Client)(nil) + +// GetTransitGatewayPrefixListReferencesPaginatorOptions is the paginator options +// for GetTransitGatewayPrefixListReferences +type GetTransitGatewayPrefixListReferencesPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetTransitGatewayPrefixListReferencesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.GetTransitGatewayPrefixListReferences +type GetTransitGatewayPrefixListReferencesPaginator struct { + options GetTransitGatewayPrefixListReferencesPaginatorOptions + client GetTransitGatewayPrefixListReferencesAPIClient + params *GetTransitGatewayPrefixListReferencesInput + nextToken *string + firstPage bool + done bool +} + +// NewGetTransitGatewayPrefixListReferencesPaginator returns a new +// GetTransitGatewayPrefixListReferencesPaginator +func NewGetTransitGatewayPrefixListReferencesPaginator(client GetTransitGatewayPrefixListReferencesAPIClient, params *GetTransitGatewayPrefixListReferencesInput, optFns ...func(*GetTransitGatewayPrefixListReferencesPaginatorOptions)) *GetTransitGatewayPrefixListReferencesPaginator { + options := GetTransitGatewayPrefixListReferencesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetTransitGatewayPrefixListReferencesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetTransitGatewayPrefixListReferencesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetTransitGatewayPrefixListReferences page. +func (p *GetTransitGatewayPrefixListReferencesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetTransitGatewayPrefixListReferencesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetTransitGatewayPrefixListReferences(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeVpcEndpointServicePermissionsAPIClient is a client that implements the +// DescribeVpcEndpointServicePermissions operation. +type DescribeVpcEndpointServicePermissionsAPIClient interface { + DescribeVpcEndpointServicePermissions(context.Context, *DescribeVpcEndpointServicePermissionsInput, ...func(*Options)) (*DescribeVpcEndpointServicePermissionsOutput, error) +} + +var _ DescribeVpcEndpointServicePermissionsAPIClient = (*Client)(nil) + +// DescribeVpcEndpointServicePermissionsPaginatorOptions is the paginator options +// for DescribeVpcEndpointServicePermissions +type DescribeVpcEndpointServicePermissionsPaginatorOptions struct { + // The maximum number of results to return for the request in a single page. The + // remaining results of the initial request can be seen by sending another request + // with the returned NextToken value. This value can be between 5 and 1,000; if + // MaxResults is given a value larger than 1,000, only 1,000 results are returned. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeVpcEndpointServicePermissionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeVpcEndpointServicePermissions +type DescribeVpcEndpointServicePermissionsPaginator struct { + options DescribeVpcEndpointServicePermissionsPaginatorOptions + client DescribeVpcEndpointServicePermissionsAPIClient + params *DescribeVpcEndpointServicePermissionsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeVpcEndpointServicePermissionsPaginator returns a new +// DescribeVpcEndpointServicePermissionsPaginator +func NewDescribeVpcEndpointServicePermissionsPaginator(client DescribeVpcEndpointServicePermissionsAPIClient, params *DescribeVpcEndpointServicePermissionsInput, optFns ...func(*DescribeVpcEndpointServicePermissionsPaginatorOptions)) *DescribeVpcEndpointServicePermissionsPaginator { + options := DescribeVpcEndpointServicePermissionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeVpcEndpointServicePermissionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeVpcEndpointServicePermissionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeVpcEndpointServicePermissions page. +func (p *DescribeVpcEndpointServicePermissionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeVpcEndpointServicePermissionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeVpcEndpointServicePermissions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsAPIClient is a +// client that implements the +// DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations operation. +type DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsAPIClient interface { + DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations(context.Context, *DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsInput, ...func(*Options)) (*DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsOutput, error) +} + +var _ DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsAPIClient = (*Client)(nil) + +// DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginatorOptions +// is the paginator options for +// DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations +type DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginator is a +// paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations +type DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginator struct { + options DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginatorOptions + client DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsAPIClient + params *DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginator +// returns a new +// DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginator +func NewDescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginator(client DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsAPIClient, params *DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsInput, optFns ...func(*DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginatorOptions)) *DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginator { + options := DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next +// DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations page. +func (p *DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeVpcEndpointsAPIClient is a client that implements the +// DescribeVpcEndpoints operation. +type DescribeVpcEndpointsAPIClient interface { + DescribeVpcEndpoints(context.Context, *DescribeVpcEndpointsInput, ...func(*Options)) (*DescribeVpcEndpointsOutput, error) +} + +var _ DescribeVpcEndpointsAPIClient = (*Client)(nil) + +// DescribeVpcEndpointsPaginatorOptions is the paginator options for +// DescribeVpcEndpoints +type DescribeVpcEndpointsPaginatorOptions struct { + // The maximum number of items to return for this request. The request returns a + // token that you can specify in a subsequent call to get the next set of results. + // Constraint: If the value is greater than 1,000, we return only 1,000 items. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeVpcEndpointsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeVpcEndpoints +type DescribeVpcEndpointsPaginator struct { + options DescribeVpcEndpointsPaginatorOptions + client DescribeVpcEndpointsAPIClient + params *DescribeVpcEndpointsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeVpcEndpointsPaginator returns a new DescribeVpcEndpointsPaginator +func NewDescribeVpcEndpointsPaginator(client DescribeVpcEndpointsAPIClient, params *DescribeVpcEndpointsInput, optFns ...func(*DescribeVpcEndpointsPaginatorOptions)) *DescribeVpcEndpointsPaginator { + options := DescribeVpcEndpointsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeVpcEndpointsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeVpcEndpointsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeVpcEndpoints page. +func (p *DescribeVpcEndpointsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeVpcEndpointsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeVpcEndpoints(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribePrincipalIdFormatAPIClient is a client that implements the +// DescribePrincipalIdFormat operation. +type DescribePrincipalIdFormatAPIClient interface { + DescribePrincipalIdFormat(context.Context, *DescribePrincipalIdFormatInput, ...func(*Options)) (*DescribePrincipalIdFormatOutput, error) +} + +var _ DescribePrincipalIdFormatAPIClient = (*Client)(nil) + +// DescribePrincipalIdFormatPaginatorOptions is the paginator options for +// DescribePrincipalIdFormat +type DescribePrincipalIdFormatPaginatorOptions struct { + // The maximum number of results to return in a single call. To retrieve the + // remaining results, make another call with the returned NextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribePrincipalIdFormatPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribePrincipalIdFormat +type DescribePrincipalIdFormatPaginator struct { + options DescribePrincipalIdFormatPaginatorOptions + client DescribePrincipalIdFormatAPIClient + params *DescribePrincipalIdFormatInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribePrincipalIdFormatPaginator returns a new +// DescribePrincipalIdFormatPaginator +func NewDescribePrincipalIdFormatPaginator(client DescribePrincipalIdFormatAPIClient, params *DescribePrincipalIdFormatInput, optFns ...func(*DescribePrincipalIdFormatPaginatorOptions)) *DescribePrincipalIdFormatPaginator { + options := DescribePrincipalIdFormatPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribePrincipalIdFormatPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribePrincipalIdFormatPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribePrincipalIdFormat page. +func (p *DescribePrincipalIdFormatPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribePrincipalIdFormatOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribePrincipalIdFormat(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeInstancesAPIClient is a client that implements the DescribeInstances +// operation. +type DescribeInstancesAPIClient interface { + DescribeInstances(context.Context, *DescribeInstancesInput, ...func(*Options)) (*DescribeInstancesOutput, error) +} + +var _ DescribeInstancesAPIClient = (*Client)(nil) + +// DescribeInstancesPaginatorOptions is the paginator options for DescribeInstances +type DescribeInstancesPaginatorOptions struct { + // The maximum number of results to return in a single call. To retrieve the + // remaining results, make another call with the returned NextToken value. This + // value can be between 5 and 1000. You cannot specify this parameter and the + // instance IDs parameter in the same call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeInstancesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeInstances +type DescribeInstancesPaginator struct { + options DescribeInstancesPaginatorOptions + client DescribeInstancesAPIClient + params *DescribeInstancesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeInstancesPaginator returns a new DescribeInstancesPaginator +func NewDescribeInstancesPaginator(client DescribeInstancesAPIClient, params *DescribeInstancesInput, optFns ...func(*DescribeInstancesPaginatorOptions)) *DescribeInstancesPaginator { + options := DescribeInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeInstancesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeInstancesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeInstances page. +func (p *DescribeInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInstancesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeInstances(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeClientVpnEndpointsAPIClient is a client that implements the +// DescribeClientVpnEndpoints operation. +type DescribeClientVpnEndpointsAPIClient interface { + DescribeClientVpnEndpoints(context.Context, *DescribeClientVpnEndpointsInput, ...func(*Options)) (*DescribeClientVpnEndpointsOutput, error) +} + +var _ DescribeClientVpnEndpointsAPIClient = (*Client)(nil) + +// DescribeClientVpnEndpointsPaginatorOptions is the paginator options for +// DescribeClientVpnEndpoints +type DescribeClientVpnEndpointsPaginatorOptions struct { + // The maximum number of results to return for the request in a single page. The + // remaining results can be seen by sending another request with the nextToken + // value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeClientVpnEndpointsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeClientVpnEndpoints +type DescribeClientVpnEndpointsPaginator struct { + options DescribeClientVpnEndpointsPaginatorOptions + client DescribeClientVpnEndpointsAPIClient + params *DescribeClientVpnEndpointsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeClientVpnEndpointsPaginator returns a new +// DescribeClientVpnEndpointsPaginator +func NewDescribeClientVpnEndpointsPaginator(client DescribeClientVpnEndpointsAPIClient, params *DescribeClientVpnEndpointsInput, optFns ...func(*DescribeClientVpnEndpointsPaginatorOptions)) *DescribeClientVpnEndpointsPaginator { + options := DescribeClientVpnEndpointsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeClientVpnEndpointsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeClientVpnEndpointsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeClientVpnEndpoints page. +func (p *DescribeClientVpnEndpointsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeClientVpnEndpointsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeClientVpnEndpoints(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeMovingAddressesAPIClient is a client that implements the +// DescribeMovingAddresses operation. +type DescribeMovingAddressesAPIClient interface { + DescribeMovingAddresses(context.Context, *DescribeMovingAddressesInput, ...func(*Options)) (*DescribeMovingAddressesOutput, error) +} + +var _ DescribeMovingAddressesAPIClient = (*Client)(nil) + +// DescribeMovingAddressesPaginatorOptions is the paginator options for +// DescribeMovingAddresses +type DescribeMovingAddressesPaginatorOptions struct { + // The maximum number of results to return for the request in a single page. The + // remaining results of the initial request can be seen by sending another request + // with the returned NextToken value. This value can be between 5 and 1000; if + // MaxResults is given a value outside of this range, an error is returned. + // Default: If no value is provided, the default is 1000. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeMovingAddressesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeMovingAddresses +type DescribeMovingAddressesPaginator struct { + options DescribeMovingAddressesPaginatorOptions + client DescribeMovingAddressesAPIClient + params *DescribeMovingAddressesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeMovingAddressesPaginator returns a new +// DescribeMovingAddressesPaginator +func NewDescribeMovingAddressesPaginator(client DescribeMovingAddressesAPIClient, params *DescribeMovingAddressesInput, optFns ...func(*DescribeMovingAddressesPaginatorOptions)) *DescribeMovingAddressesPaginator { + options := DescribeMovingAddressesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeMovingAddressesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeMovingAddressesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeMovingAddresses page. +func (p *DescribeMovingAddressesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeMovingAddressesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeMovingAddresses(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeVpcEndpointConnectionsAPIClient is a client that implements the +// DescribeVpcEndpointConnections operation. +type DescribeVpcEndpointConnectionsAPIClient interface { + DescribeVpcEndpointConnections(context.Context, *DescribeVpcEndpointConnectionsInput, ...func(*Options)) (*DescribeVpcEndpointConnectionsOutput, error) +} + +var _ DescribeVpcEndpointConnectionsAPIClient = (*Client)(nil) + +// DescribeVpcEndpointConnectionsPaginatorOptions is the paginator options for +// DescribeVpcEndpointConnections +type DescribeVpcEndpointConnectionsPaginatorOptions struct { + // The maximum number of results to return for the request in a single page. The + // remaining results of the initial request can be seen by sending another request + // with the returned NextToken value. This value can be between 5 and 1,000; if + // MaxResults is given a value larger than 1,000, only 1,000 results are returned. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeVpcEndpointConnectionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeVpcEndpointConnections +type DescribeVpcEndpointConnectionsPaginator struct { + options DescribeVpcEndpointConnectionsPaginatorOptions + client DescribeVpcEndpointConnectionsAPIClient + params *DescribeVpcEndpointConnectionsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeVpcEndpointConnectionsPaginator returns a new +// DescribeVpcEndpointConnectionsPaginator +func NewDescribeVpcEndpointConnectionsPaginator(client DescribeVpcEndpointConnectionsAPIClient, params *DescribeVpcEndpointConnectionsInput, optFns ...func(*DescribeVpcEndpointConnectionsPaginatorOptions)) *DescribeVpcEndpointConnectionsPaginator { + options := DescribeVpcEndpointConnectionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeVpcEndpointConnectionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeVpcEndpointConnectionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeVpcEndpointConnections page. +func (p *DescribeVpcEndpointConnectionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeVpcEndpointConnectionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeVpcEndpointConnections(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeNatGatewaysAPIClient is a client that implements the DescribeNatGateways +// operation. +type DescribeNatGatewaysAPIClient interface { + DescribeNatGateways(context.Context, *DescribeNatGatewaysInput, ...func(*Options)) (*DescribeNatGatewaysOutput, error) +} + +var _ DescribeNatGatewaysAPIClient = (*Client)(nil) + +// DescribeNatGatewaysPaginatorOptions is the paginator options for +// DescribeNatGateways +type DescribeNatGatewaysPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeNatGatewaysPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeNatGateways +type DescribeNatGatewaysPaginator struct { + options DescribeNatGatewaysPaginatorOptions + client DescribeNatGatewaysAPIClient + params *DescribeNatGatewaysInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeNatGatewaysPaginator returns a new DescribeNatGatewaysPaginator +func NewDescribeNatGatewaysPaginator(client DescribeNatGatewaysAPIClient, params *DescribeNatGatewaysInput, optFns ...func(*DescribeNatGatewaysPaginatorOptions)) *DescribeNatGatewaysPaginator { + options := DescribeNatGatewaysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeNatGatewaysPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeNatGatewaysPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeNatGateways page. +func (p *DescribeNatGatewaysPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeNatGatewaysOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeNatGateways(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeSubnetsAPIClient is a client that implements the DescribeSubnets +// operation. +type DescribeSubnetsAPIClient interface { + DescribeSubnets(context.Context, *DescribeSubnetsInput, ...func(*Options)) (*DescribeSubnetsOutput, error) +} + +var _ DescribeSubnetsAPIClient = (*Client)(nil) + +// DescribeSubnetsPaginatorOptions is the paginator options for DescribeSubnets +type DescribeSubnetsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeSubnetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeSubnets +type DescribeSubnetsPaginator struct { + options DescribeSubnetsPaginatorOptions + client DescribeSubnetsAPIClient + params *DescribeSubnetsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeSubnetsPaginator returns a new DescribeSubnetsPaginator +func NewDescribeSubnetsPaginator(client DescribeSubnetsAPIClient, params *DescribeSubnetsInput, optFns ...func(*DescribeSubnetsPaginatorOptions)) *DescribeSubnetsPaginator { + options := DescribeSubnetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeSubnetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeSubnetsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeSubnets page. +func (p *DescribeSubnetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeSubnetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeSubnets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeTrafficMirrorSessionsAPIClient is a client that implements the +// DescribeTrafficMirrorSessions operation. +type DescribeTrafficMirrorSessionsAPIClient interface { + DescribeTrafficMirrorSessions(context.Context, *DescribeTrafficMirrorSessionsInput, ...func(*Options)) (*DescribeTrafficMirrorSessionsOutput, error) +} + +var _ DescribeTrafficMirrorSessionsAPIClient = (*Client)(nil) + +// DescribeTrafficMirrorSessionsPaginatorOptions is the paginator options for +// DescribeTrafficMirrorSessions +type DescribeTrafficMirrorSessionsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeTrafficMirrorSessionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeTrafficMirrorSessions +type DescribeTrafficMirrorSessionsPaginator struct { + options DescribeTrafficMirrorSessionsPaginatorOptions + client DescribeTrafficMirrorSessionsAPIClient + params *DescribeTrafficMirrorSessionsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeTrafficMirrorSessionsPaginator returns a new +// DescribeTrafficMirrorSessionsPaginator +func NewDescribeTrafficMirrorSessionsPaginator(client DescribeTrafficMirrorSessionsAPIClient, params *DescribeTrafficMirrorSessionsInput, optFns ...func(*DescribeTrafficMirrorSessionsPaginatorOptions)) *DescribeTrafficMirrorSessionsPaginator { + options := DescribeTrafficMirrorSessionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeTrafficMirrorSessionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeTrafficMirrorSessionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeTrafficMirrorSessions page. +func (p *DescribeTrafficMirrorSessionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTrafficMirrorSessionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeTrafficMirrorSessions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeManagedPrefixListsAPIClient is a client that implements the +// DescribeManagedPrefixLists operation. +type DescribeManagedPrefixListsAPIClient interface { + DescribeManagedPrefixLists(context.Context, *DescribeManagedPrefixListsInput, ...func(*Options)) (*DescribeManagedPrefixListsOutput, error) +} + +var _ DescribeManagedPrefixListsAPIClient = (*Client)(nil) + +// DescribeManagedPrefixListsPaginatorOptions is the paginator options for +// DescribeManagedPrefixLists +type DescribeManagedPrefixListsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeManagedPrefixListsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeManagedPrefixLists +type DescribeManagedPrefixListsPaginator struct { + options DescribeManagedPrefixListsPaginatorOptions + client DescribeManagedPrefixListsAPIClient + params *DescribeManagedPrefixListsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeManagedPrefixListsPaginator returns a new +// DescribeManagedPrefixListsPaginator +func NewDescribeManagedPrefixListsPaginator(client DescribeManagedPrefixListsAPIClient, params *DescribeManagedPrefixListsInput, optFns ...func(*DescribeManagedPrefixListsPaginatorOptions)) *DescribeManagedPrefixListsPaginator { + options := DescribeManagedPrefixListsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeManagedPrefixListsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeManagedPrefixListsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeManagedPrefixLists page. +func (p *DescribeManagedPrefixListsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeManagedPrefixListsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeManagedPrefixLists(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeSecurityGroupsAPIClient is a client that implements the +// DescribeSecurityGroups operation. +type DescribeSecurityGroupsAPIClient interface { + DescribeSecurityGroups(context.Context, *DescribeSecurityGroupsInput, ...func(*Options)) (*DescribeSecurityGroupsOutput, error) +} + +var _ DescribeSecurityGroupsAPIClient = (*Client)(nil) + +// DescribeSecurityGroupsPaginatorOptions is the paginator options for +// DescribeSecurityGroups +type DescribeSecurityGroupsPaginatorOptions struct { + // The maximum number of results to return in a single call. To retrieve the + // remaining results, make another request with the returned NextToken value. This + // value can be between 5 and 1000. If this parameter is not specified, then all + // results are returned. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeSecurityGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeSecurityGroups +type DescribeSecurityGroupsPaginator struct { + options DescribeSecurityGroupsPaginatorOptions + client DescribeSecurityGroupsAPIClient + params *DescribeSecurityGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeSecurityGroupsPaginator returns a new DescribeSecurityGroupsPaginator +func NewDescribeSecurityGroupsPaginator(client DescribeSecurityGroupsAPIClient, params *DescribeSecurityGroupsInput, optFns ...func(*DescribeSecurityGroupsPaginatorOptions)) *DescribeSecurityGroupsPaginator { + options := DescribeSecurityGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeSecurityGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeSecurityGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeSecurityGroups page. +func (p *DescribeSecurityGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeSecurityGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeSecurityGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribePrefixListsAPIClient is a client that implements the DescribePrefixLists +// operation. +type DescribePrefixListsAPIClient interface { + DescribePrefixLists(context.Context, *DescribePrefixListsInput, ...func(*Options)) (*DescribePrefixListsOutput, error) +} + +var _ DescribePrefixListsAPIClient = (*Client)(nil) + +// DescribePrefixListsPaginatorOptions is the paginator options for +// DescribePrefixLists +type DescribePrefixListsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribePrefixListsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribePrefixLists +type DescribePrefixListsPaginator struct { + options DescribePrefixListsPaginatorOptions + client DescribePrefixListsAPIClient + params *DescribePrefixListsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribePrefixListsPaginator returns a new DescribePrefixListsPaginator +func NewDescribePrefixListsPaginator(client DescribePrefixListsAPIClient, params *DescribePrefixListsInput, optFns ...func(*DescribePrefixListsPaginatorOptions)) *DescribePrefixListsPaginator { + options := DescribePrefixListsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribePrefixListsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribePrefixListsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribePrefixLists page. +func (p *DescribePrefixListsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribePrefixListsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribePrefixLists(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeTransitGatewayMulticastDomainsAPIClient is a client that implements the +// DescribeTransitGatewayMulticastDomains operation. +type DescribeTransitGatewayMulticastDomainsAPIClient interface { + DescribeTransitGatewayMulticastDomains(context.Context, *DescribeTransitGatewayMulticastDomainsInput, ...func(*Options)) (*DescribeTransitGatewayMulticastDomainsOutput, error) +} + +var _ DescribeTransitGatewayMulticastDomainsAPIClient = (*Client)(nil) + +// DescribeTransitGatewayMulticastDomainsPaginatorOptions is the paginator options +// for DescribeTransitGatewayMulticastDomains +type DescribeTransitGatewayMulticastDomainsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeTransitGatewayMulticastDomainsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeTransitGatewayMulticastDomains +type DescribeTransitGatewayMulticastDomainsPaginator struct { + options DescribeTransitGatewayMulticastDomainsPaginatorOptions + client DescribeTransitGatewayMulticastDomainsAPIClient + params *DescribeTransitGatewayMulticastDomainsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeTransitGatewayMulticastDomainsPaginator returns a new +// DescribeTransitGatewayMulticastDomainsPaginator +func NewDescribeTransitGatewayMulticastDomainsPaginator(client DescribeTransitGatewayMulticastDomainsAPIClient, params *DescribeTransitGatewayMulticastDomainsInput, optFns ...func(*DescribeTransitGatewayMulticastDomainsPaginatorOptions)) *DescribeTransitGatewayMulticastDomainsPaginator { + options := DescribeTransitGatewayMulticastDomainsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeTransitGatewayMulticastDomainsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeTransitGatewayMulticastDomainsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeTransitGatewayMulticastDomains page. +func (p *DescribeTransitGatewayMulticastDomainsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTransitGatewayMulticastDomainsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeTransitGatewayMulticastDomains(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeFpgaImagesAPIClient is a client that implements the DescribeFpgaImages +// operation. +type DescribeFpgaImagesAPIClient interface { + DescribeFpgaImages(context.Context, *DescribeFpgaImagesInput, ...func(*Options)) (*DescribeFpgaImagesOutput, error) +} + +var _ DescribeFpgaImagesAPIClient = (*Client)(nil) + +// DescribeFpgaImagesPaginatorOptions is the paginator options for +// DescribeFpgaImages +type DescribeFpgaImagesPaginatorOptions struct { + // The maximum number of results to return in a single call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeFpgaImagesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeFpgaImages +type DescribeFpgaImagesPaginator struct { + options DescribeFpgaImagesPaginatorOptions + client DescribeFpgaImagesAPIClient + params *DescribeFpgaImagesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeFpgaImagesPaginator returns a new DescribeFpgaImagesPaginator +func NewDescribeFpgaImagesPaginator(client DescribeFpgaImagesAPIClient, params *DescribeFpgaImagesInput, optFns ...func(*DescribeFpgaImagesPaginatorOptions)) *DescribeFpgaImagesPaginator { + options := DescribeFpgaImagesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeFpgaImagesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeFpgaImagesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeFpgaImages page. +func (p *DescribeFpgaImagesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeFpgaImagesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeFpgaImages(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeTagsAPIClient is a client that implements the DescribeTags operation. +type DescribeTagsAPIClient interface { + DescribeTags(context.Context, *DescribeTagsInput, ...func(*Options)) (*DescribeTagsOutput, error) +} + +var _ DescribeTagsAPIClient = (*Client)(nil) + +// DescribeTagsPaginatorOptions is the paginator options for DescribeTags +type DescribeTagsPaginatorOptions struct { + // The maximum number of results to return in a single call. This value can be + // between 5 and 1000. To retrieve the remaining results, make another call with + // the returned NextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeTagsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeTags +type DescribeTagsPaginator struct { + options DescribeTagsPaginatorOptions + client DescribeTagsAPIClient + params *DescribeTagsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeTagsPaginator returns a new DescribeTagsPaginator +func NewDescribeTagsPaginator(client DescribeTagsAPIClient, params *DescribeTagsInput, optFns ...func(*DescribeTagsPaginatorOptions)) *DescribeTagsPaginator { + options := DescribeTagsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeTagsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeTagsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeTags page. +func (p *DescribeTagsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTagsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeTags(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeSpotFleetRequestsAPIClient is a client that implements the +// DescribeSpotFleetRequests operation. +type DescribeSpotFleetRequestsAPIClient interface { + DescribeSpotFleetRequests(context.Context, *DescribeSpotFleetRequestsInput, ...func(*Options)) (*DescribeSpotFleetRequestsOutput, error) +} + +var _ DescribeSpotFleetRequestsAPIClient = (*Client)(nil) + +// DescribeSpotFleetRequestsPaginatorOptions is the paginator options for +// DescribeSpotFleetRequests +type DescribeSpotFleetRequestsPaginatorOptions struct { + // The maximum number of results to return in a single call. Specify a value + // between 1 and 1000. The default value is 1000. To retrieve the remaining + // results, make another call with the returned NextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeSpotFleetRequestsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeSpotFleetRequests +type DescribeSpotFleetRequestsPaginator struct { + options DescribeSpotFleetRequestsPaginatorOptions + client DescribeSpotFleetRequestsAPIClient + params *DescribeSpotFleetRequestsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeSpotFleetRequestsPaginator returns a new +// DescribeSpotFleetRequestsPaginator +func NewDescribeSpotFleetRequestsPaginator(client DescribeSpotFleetRequestsAPIClient, params *DescribeSpotFleetRequestsInput, optFns ...func(*DescribeSpotFleetRequestsPaginatorOptions)) *DescribeSpotFleetRequestsPaginator { + options := DescribeSpotFleetRequestsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeSpotFleetRequestsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeSpotFleetRequestsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeSpotFleetRequests page. +func (p *DescribeSpotFleetRequestsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeSpotFleetRequestsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeSpotFleetRequests(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeInstanceCreditSpecificationsAPIClient is a client that implements the +// DescribeInstanceCreditSpecifications operation. +type DescribeInstanceCreditSpecificationsAPIClient interface { + DescribeInstanceCreditSpecifications(context.Context, *DescribeInstanceCreditSpecificationsInput, ...func(*Options)) (*DescribeInstanceCreditSpecificationsOutput, error) +} + +var _ DescribeInstanceCreditSpecificationsAPIClient = (*Client)(nil) + +// DescribeInstanceCreditSpecificationsPaginatorOptions is the paginator options +// for DescribeInstanceCreditSpecifications +type DescribeInstanceCreditSpecificationsPaginatorOptions struct { + // The maximum number of results to return in a single call. To retrieve the + // remaining results, make another call with the returned NextToken value. This + // value can be between 5 and 1000. You cannot specify this parameter and the + // instance IDs parameter in the same call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeInstanceCreditSpecificationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeInstanceCreditSpecifications +type DescribeInstanceCreditSpecificationsPaginator struct { + options DescribeInstanceCreditSpecificationsPaginatorOptions + client DescribeInstanceCreditSpecificationsAPIClient + params *DescribeInstanceCreditSpecificationsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeInstanceCreditSpecificationsPaginator returns a new +// DescribeInstanceCreditSpecificationsPaginator +func NewDescribeInstanceCreditSpecificationsPaginator(client DescribeInstanceCreditSpecificationsAPIClient, params *DescribeInstanceCreditSpecificationsInput, optFns ...func(*DescribeInstanceCreditSpecificationsPaginatorOptions)) *DescribeInstanceCreditSpecificationsPaginator { + options := DescribeInstanceCreditSpecificationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeInstanceCreditSpecificationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeInstanceCreditSpecificationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeInstanceCreditSpecifications page. +func (p *DescribeInstanceCreditSpecificationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInstanceCreditSpecificationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeInstanceCreditSpecifications(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetTransitGatewayRouteTableAssociationsAPIClient is a client that implements the +// GetTransitGatewayRouteTableAssociations operation. +type GetTransitGatewayRouteTableAssociationsAPIClient interface { + GetTransitGatewayRouteTableAssociations(context.Context, *GetTransitGatewayRouteTableAssociationsInput, ...func(*Options)) (*GetTransitGatewayRouteTableAssociationsOutput, error) +} + +var _ GetTransitGatewayRouteTableAssociationsAPIClient = (*Client)(nil) + +// GetTransitGatewayRouteTableAssociationsPaginatorOptions is the paginator options +// for GetTransitGatewayRouteTableAssociations +type GetTransitGatewayRouteTableAssociationsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetTransitGatewayRouteTableAssociationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.GetTransitGatewayRouteTableAssociations +type GetTransitGatewayRouteTableAssociationsPaginator struct { + options GetTransitGatewayRouteTableAssociationsPaginatorOptions + client GetTransitGatewayRouteTableAssociationsAPIClient + params *GetTransitGatewayRouteTableAssociationsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetTransitGatewayRouteTableAssociationsPaginator returns a new +// GetTransitGatewayRouteTableAssociationsPaginator +func NewGetTransitGatewayRouteTableAssociationsPaginator(client GetTransitGatewayRouteTableAssociationsAPIClient, params *GetTransitGatewayRouteTableAssociationsInput, optFns ...func(*GetTransitGatewayRouteTableAssociationsPaginatorOptions)) *GetTransitGatewayRouteTableAssociationsPaginator { + options := GetTransitGatewayRouteTableAssociationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetTransitGatewayRouteTableAssociationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetTransitGatewayRouteTableAssociationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetTransitGatewayRouteTableAssociations page. +func (p *GetTransitGatewayRouteTableAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetTransitGatewayRouteTableAssociationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetTransitGatewayRouteTableAssociations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeCoipPoolsAPIClient is a client that implements the DescribeCoipPools +// operation. +type DescribeCoipPoolsAPIClient interface { + DescribeCoipPools(context.Context, *DescribeCoipPoolsInput, ...func(*Options)) (*DescribeCoipPoolsOutput, error) +} + +var _ DescribeCoipPoolsAPIClient = (*Client)(nil) + +// DescribeCoipPoolsPaginatorOptions is the paginator options for DescribeCoipPools +type DescribeCoipPoolsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeCoipPoolsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeCoipPools +type DescribeCoipPoolsPaginator struct { + options DescribeCoipPoolsPaginatorOptions + client DescribeCoipPoolsAPIClient + params *DescribeCoipPoolsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeCoipPoolsPaginator returns a new DescribeCoipPoolsPaginator +func NewDescribeCoipPoolsPaginator(client DescribeCoipPoolsAPIClient, params *DescribeCoipPoolsInput, optFns ...func(*DescribeCoipPoolsPaginatorOptions)) *DescribeCoipPoolsPaginator { + options := DescribeCoipPoolsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeCoipPoolsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeCoipPoolsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeCoipPools page. +func (p *DescribeCoipPoolsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCoipPoolsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeCoipPools(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeNetworkAclsAPIClient is a client that implements the DescribeNetworkAcls +// operation. +type DescribeNetworkAclsAPIClient interface { + DescribeNetworkAcls(context.Context, *DescribeNetworkAclsInput, ...func(*Options)) (*DescribeNetworkAclsOutput, error) +} + +var _ DescribeNetworkAclsAPIClient = (*Client)(nil) + +// DescribeNetworkAclsPaginatorOptions is the paginator options for +// DescribeNetworkAcls +type DescribeNetworkAclsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeNetworkAclsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeNetworkAcls +type DescribeNetworkAclsPaginator struct { + options DescribeNetworkAclsPaginatorOptions + client DescribeNetworkAclsAPIClient + params *DescribeNetworkAclsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeNetworkAclsPaginator returns a new DescribeNetworkAclsPaginator +func NewDescribeNetworkAclsPaginator(client DescribeNetworkAclsAPIClient, params *DescribeNetworkAclsInput, optFns ...func(*DescribeNetworkAclsPaginatorOptions)) *DescribeNetworkAclsPaginator { + options := DescribeNetworkAclsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeNetworkAclsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeNetworkAclsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeNetworkAcls page. +func (p *DescribeNetworkAclsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeNetworkAclsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeNetworkAcls(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeVolumesAPIClient is a client that implements the DescribeVolumes +// operation. +type DescribeVolumesAPIClient interface { + DescribeVolumes(context.Context, *DescribeVolumesInput, ...func(*Options)) (*DescribeVolumesOutput, error) +} + +var _ DescribeVolumesAPIClient = (*Client)(nil) + +// DescribeVolumesPaginatorOptions is the paginator options for DescribeVolumes +type DescribeVolumesPaginatorOptions struct { + // The maximum number of volume results returned by DescribeVolumes in paginated + // output. When this parameter is used, DescribeVolumes only returns MaxResults + // results in a single page along with a NextToken response element. The remaining + // results of the initial request can be seen by sending another DescribeVolumes + // request with the returned NextToken value. This value can be between 5 and 500; + // if MaxResults is given a value larger than 500, only 500 results are returned. + // If this parameter is not used, then DescribeVolumes returns all results. You + // cannot specify this parameter and the volume IDs parameter in the same request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeVolumesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeVolumes +type DescribeVolumesPaginator struct { + options DescribeVolumesPaginatorOptions + client DescribeVolumesAPIClient + params *DescribeVolumesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeVolumesPaginator returns a new DescribeVolumesPaginator +func NewDescribeVolumesPaginator(client DescribeVolumesAPIClient, params *DescribeVolumesInput, optFns ...func(*DescribeVolumesPaginatorOptions)) *DescribeVolumesPaginator { + options := DescribeVolumesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeVolumesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeVolumesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeVolumes page. +func (p *DescribeVolumesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeVolumesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeVolumes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeNetworkInterfacePermissionsAPIClient is a client that implements the +// DescribeNetworkInterfacePermissions operation. +type DescribeNetworkInterfacePermissionsAPIClient interface { + DescribeNetworkInterfacePermissions(context.Context, *DescribeNetworkInterfacePermissionsInput, ...func(*Options)) (*DescribeNetworkInterfacePermissionsOutput, error) +} + +var _ DescribeNetworkInterfacePermissionsAPIClient = (*Client)(nil) + +// DescribeNetworkInterfacePermissionsPaginatorOptions is the paginator options for +// DescribeNetworkInterfacePermissions +type DescribeNetworkInterfacePermissionsPaginatorOptions struct { + // The maximum number of results to return in a single call. To retrieve the + // remaining results, make another call with the returned NextToken value. If this + // parameter is not specified, up to 50 results are returned by default. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeNetworkInterfacePermissionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeNetworkInterfacePermissions +type DescribeNetworkInterfacePermissionsPaginator struct { + options DescribeNetworkInterfacePermissionsPaginatorOptions + client DescribeNetworkInterfacePermissionsAPIClient + params *DescribeNetworkInterfacePermissionsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeNetworkInterfacePermissionsPaginator returns a new +// DescribeNetworkInterfacePermissionsPaginator +func NewDescribeNetworkInterfacePermissionsPaginator(client DescribeNetworkInterfacePermissionsAPIClient, params *DescribeNetworkInterfacePermissionsInput, optFns ...func(*DescribeNetworkInterfacePermissionsPaginatorOptions)) *DescribeNetworkInterfacePermissionsPaginator { + options := DescribeNetworkInterfacePermissionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeNetworkInterfacePermissionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeNetworkInterfacePermissionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeNetworkInterfacePermissions page. +func (p *DescribeNetworkInterfacePermissionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeNetworkInterfacePermissionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeNetworkInterfacePermissions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeExportImageTasksAPIClient is a client that implements the +// DescribeExportImageTasks operation. +type DescribeExportImageTasksAPIClient interface { + DescribeExportImageTasks(context.Context, *DescribeExportImageTasksInput, ...func(*Options)) (*DescribeExportImageTasksOutput, error) +} + +var _ DescribeExportImageTasksAPIClient = (*Client)(nil) + +// DescribeExportImageTasksPaginatorOptions is the paginator options for +// DescribeExportImageTasks +type DescribeExportImageTasksPaginatorOptions struct { + // The maximum number of results to return in a single call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeExportImageTasksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeExportImageTasks +type DescribeExportImageTasksPaginator struct { + options DescribeExportImageTasksPaginatorOptions + client DescribeExportImageTasksAPIClient + params *DescribeExportImageTasksInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeExportImageTasksPaginator returns a new +// DescribeExportImageTasksPaginator +func NewDescribeExportImageTasksPaginator(client DescribeExportImageTasksAPIClient, params *DescribeExportImageTasksInput, optFns ...func(*DescribeExportImageTasksPaginatorOptions)) *DescribeExportImageTasksPaginator { + options := DescribeExportImageTasksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeExportImageTasksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeExportImageTasksPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeExportImageTasks page. +func (p *DescribeExportImageTasksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeExportImageTasksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeExportImageTasks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeClientVpnTargetNetworksAPIClient is a client that implements the +// DescribeClientVpnTargetNetworks operation. +type DescribeClientVpnTargetNetworksAPIClient interface { + DescribeClientVpnTargetNetworks(context.Context, *DescribeClientVpnTargetNetworksInput, ...func(*Options)) (*DescribeClientVpnTargetNetworksOutput, error) +} + +var _ DescribeClientVpnTargetNetworksAPIClient = (*Client)(nil) + +// DescribeClientVpnTargetNetworksPaginatorOptions is the paginator options for +// DescribeClientVpnTargetNetworks +type DescribeClientVpnTargetNetworksPaginatorOptions struct { + // The maximum number of results to return for the request in a single page. The + // remaining results can be seen by sending another request with the nextToken + // value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeClientVpnTargetNetworksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeClientVpnTargetNetworks +type DescribeClientVpnTargetNetworksPaginator struct { + options DescribeClientVpnTargetNetworksPaginatorOptions + client DescribeClientVpnTargetNetworksAPIClient + params *DescribeClientVpnTargetNetworksInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeClientVpnTargetNetworksPaginator returns a new +// DescribeClientVpnTargetNetworksPaginator +func NewDescribeClientVpnTargetNetworksPaginator(client DescribeClientVpnTargetNetworksAPIClient, params *DescribeClientVpnTargetNetworksInput, optFns ...func(*DescribeClientVpnTargetNetworksPaginatorOptions)) *DescribeClientVpnTargetNetworksPaginator { + options := DescribeClientVpnTargetNetworksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeClientVpnTargetNetworksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeClientVpnTargetNetworksPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeClientVpnTargetNetworks page. +func (p *DescribeClientVpnTargetNetworksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeClientVpnTargetNetworksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeClientVpnTargetNetworks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeCarrierGatewaysAPIClient is a client that implements the +// DescribeCarrierGateways operation. +type DescribeCarrierGatewaysAPIClient interface { + DescribeCarrierGateways(context.Context, *DescribeCarrierGatewaysInput, ...func(*Options)) (*DescribeCarrierGatewaysOutput, error) +} + +var _ DescribeCarrierGatewaysAPIClient = (*Client)(nil) + +// DescribeCarrierGatewaysPaginatorOptions is the paginator options for +// DescribeCarrierGateways +type DescribeCarrierGatewaysPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeCarrierGatewaysPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeCarrierGateways +type DescribeCarrierGatewaysPaginator struct { + options DescribeCarrierGatewaysPaginatorOptions + client DescribeCarrierGatewaysAPIClient + params *DescribeCarrierGatewaysInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeCarrierGatewaysPaginator returns a new +// DescribeCarrierGatewaysPaginator +func NewDescribeCarrierGatewaysPaginator(client DescribeCarrierGatewaysAPIClient, params *DescribeCarrierGatewaysInput, optFns ...func(*DescribeCarrierGatewaysPaginatorOptions)) *DescribeCarrierGatewaysPaginator { + options := DescribeCarrierGatewaysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeCarrierGatewaysPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeCarrierGatewaysPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeCarrierGateways page. +func (p *DescribeCarrierGatewaysPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCarrierGatewaysOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeCarrierGateways(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeVpcClassicLinkDnsSupportAPIClient is a client that implements the +// DescribeVpcClassicLinkDnsSupport operation. +type DescribeVpcClassicLinkDnsSupportAPIClient interface { + DescribeVpcClassicLinkDnsSupport(context.Context, *DescribeVpcClassicLinkDnsSupportInput, ...func(*Options)) (*DescribeVpcClassicLinkDnsSupportOutput, error) +} + +var _ DescribeVpcClassicLinkDnsSupportAPIClient = (*Client)(nil) + +// DescribeVpcClassicLinkDnsSupportPaginatorOptions is the paginator options for +// DescribeVpcClassicLinkDnsSupport +type DescribeVpcClassicLinkDnsSupportPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeVpcClassicLinkDnsSupportPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeVpcClassicLinkDnsSupport +type DescribeVpcClassicLinkDnsSupportPaginator struct { + options DescribeVpcClassicLinkDnsSupportPaginatorOptions + client DescribeVpcClassicLinkDnsSupportAPIClient + params *DescribeVpcClassicLinkDnsSupportInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeVpcClassicLinkDnsSupportPaginator returns a new +// DescribeVpcClassicLinkDnsSupportPaginator +func NewDescribeVpcClassicLinkDnsSupportPaginator(client DescribeVpcClassicLinkDnsSupportAPIClient, params *DescribeVpcClassicLinkDnsSupportInput, optFns ...func(*DescribeVpcClassicLinkDnsSupportPaginatorOptions)) *DescribeVpcClassicLinkDnsSupportPaginator { + options := DescribeVpcClassicLinkDnsSupportPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeVpcClassicLinkDnsSupportPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeVpcClassicLinkDnsSupportPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeVpcClassicLinkDnsSupport page. +func (p *DescribeVpcClassicLinkDnsSupportPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeVpcClassicLinkDnsSupportOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeVpcClassicLinkDnsSupport(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeScheduledInstanceAvailabilityAPIClient is a client that implements the +// DescribeScheduledInstanceAvailability operation. +type DescribeScheduledInstanceAvailabilityAPIClient interface { + DescribeScheduledInstanceAvailability(context.Context, *DescribeScheduledInstanceAvailabilityInput, ...func(*Options)) (*DescribeScheduledInstanceAvailabilityOutput, error) +} + +var _ DescribeScheduledInstanceAvailabilityAPIClient = (*Client)(nil) + +// DescribeScheduledInstanceAvailabilityPaginatorOptions is the paginator options +// for DescribeScheduledInstanceAvailability +type DescribeScheduledInstanceAvailabilityPaginatorOptions struct { + // The maximum number of results to return in a single call. This value can be + // between 5 and 300. The default value is 300. To retrieve the remaining results, + // make another call with the returned NextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeScheduledInstanceAvailabilityPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeScheduledInstanceAvailability +type DescribeScheduledInstanceAvailabilityPaginator struct { + options DescribeScheduledInstanceAvailabilityPaginatorOptions + client DescribeScheduledInstanceAvailabilityAPIClient + params *DescribeScheduledInstanceAvailabilityInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeScheduledInstanceAvailabilityPaginator returns a new +// DescribeScheduledInstanceAvailabilityPaginator +func NewDescribeScheduledInstanceAvailabilityPaginator(client DescribeScheduledInstanceAvailabilityAPIClient, params *DescribeScheduledInstanceAvailabilityInput, optFns ...func(*DescribeScheduledInstanceAvailabilityPaginatorOptions)) *DescribeScheduledInstanceAvailabilityPaginator { + options := DescribeScheduledInstanceAvailabilityPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeScheduledInstanceAvailabilityPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeScheduledInstanceAvailabilityPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeScheduledInstanceAvailability page. +func (p *DescribeScheduledInstanceAvailabilityPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeScheduledInstanceAvailabilityOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeScheduledInstanceAvailability(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// SearchTransitGatewayMulticastGroupsAPIClient is a client that implements the +// SearchTransitGatewayMulticastGroups operation. +type SearchTransitGatewayMulticastGroupsAPIClient interface { + SearchTransitGatewayMulticastGroups(context.Context, *SearchTransitGatewayMulticastGroupsInput, ...func(*Options)) (*SearchTransitGatewayMulticastGroupsOutput, error) +} + +var _ SearchTransitGatewayMulticastGroupsAPIClient = (*Client)(nil) + +// SearchTransitGatewayMulticastGroupsPaginatorOptions is the paginator options for +// SearchTransitGatewayMulticastGroups +type SearchTransitGatewayMulticastGroupsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// SearchTransitGatewayMulticastGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.SearchTransitGatewayMulticastGroups +type SearchTransitGatewayMulticastGroupsPaginator struct { + options SearchTransitGatewayMulticastGroupsPaginatorOptions + client SearchTransitGatewayMulticastGroupsAPIClient + params *SearchTransitGatewayMulticastGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewSearchTransitGatewayMulticastGroupsPaginator returns a new +// SearchTransitGatewayMulticastGroupsPaginator +func NewSearchTransitGatewayMulticastGroupsPaginator(client SearchTransitGatewayMulticastGroupsAPIClient, params *SearchTransitGatewayMulticastGroupsInput, optFns ...func(*SearchTransitGatewayMulticastGroupsPaginatorOptions)) *SearchTransitGatewayMulticastGroupsPaginator { + options := SearchTransitGatewayMulticastGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &SearchTransitGatewayMulticastGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchTransitGatewayMulticastGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next SearchTransitGatewayMulticastGroups page. +func (p *SearchTransitGatewayMulticastGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchTransitGatewayMulticastGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.SearchTransitGatewayMulticastGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeVpcEndpointServiceConfigurationsAPIClient is a client that implements +// the DescribeVpcEndpointServiceConfigurations operation. +type DescribeVpcEndpointServiceConfigurationsAPIClient interface { + DescribeVpcEndpointServiceConfigurations(context.Context, *DescribeVpcEndpointServiceConfigurationsInput, ...func(*Options)) (*DescribeVpcEndpointServiceConfigurationsOutput, error) +} + +var _ DescribeVpcEndpointServiceConfigurationsAPIClient = (*Client)(nil) + +// DescribeVpcEndpointServiceConfigurationsPaginatorOptions is the paginator +// options for DescribeVpcEndpointServiceConfigurations +type DescribeVpcEndpointServiceConfigurationsPaginatorOptions struct { + // The maximum number of results to return for the request in a single page. The + // remaining results of the initial request can be seen by sending another request + // with the returned NextToken value. This value can be between 5 and 1,000; if + // MaxResults is given a value larger than 1,000, only 1,000 results are returned. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeVpcEndpointServiceConfigurationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeVpcEndpointServiceConfigurations +type DescribeVpcEndpointServiceConfigurationsPaginator struct { + options DescribeVpcEndpointServiceConfigurationsPaginatorOptions + client DescribeVpcEndpointServiceConfigurationsAPIClient + params *DescribeVpcEndpointServiceConfigurationsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeVpcEndpointServiceConfigurationsPaginator returns a new +// DescribeVpcEndpointServiceConfigurationsPaginator +func NewDescribeVpcEndpointServiceConfigurationsPaginator(client DescribeVpcEndpointServiceConfigurationsAPIClient, params *DescribeVpcEndpointServiceConfigurationsInput, optFns ...func(*DescribeVpcEndpointServiceConfigurationsPaginatorOptions)) *DescribeVpcEndpointServiceConfigurationsPaginator { + options := DescribeVpcEndpointServiceConfigurationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeVpcEndpointServiceConfigurationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeVpcEndpointServiceConfigurationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeVpcEndpointServiceConfigurations page. +func (p *DescribeVpcEndpointServiceConfigurationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeVpcEndpointServiceConfigurationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeVpcEndpointServiceConfigurations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetManagedPrefixListAssociationsAPIClient is a client that implements the +// GetManagedPrefixListAssociations operation. +type GetManagedPrefixListAssociationsAPIClient interface { + GetManagedPrefixListAssociations(context.Context, *GetManagedPrefixListAssociationsInput, ...func(*Options)) (*GetManagedPrefixListAssociationsOutput, error) +} + +var _ GetManagedPrefixListAssociationsAPIClient = (*Client)(nil) + +// GetManagedPrefixListAssociationsPaginatorOptions is the paginator options for +// GetManagedPrefixListAssociations +type GetManagedPrefixListAssociationsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetManagedPrefixListAssociationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.GetManagedPrefixListAssociations +type GetManagedPrefixListAssociationsPaginator struct { + options GetManagedPrefixListAssociationsPaginatorOptions + client GetManagedPrefixListAssociationsAPIClient + params *GetManagedPrefixListAssociationsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetManagedPrefixListAssociationsPaginator returns a new +// GetManagedPrefixListAssociationsPaginator +func NewGetManagedPrefixListAssociationsPaginator(client GetManagedPrefixListAssociationsAPIClient, params *GetManagedPrefixListAssociationsInput, optFns ...func(*GetManagedPrefixListAssociationsPaginatorOptions)) *GetManagedPrefixListAssociationsPaginator { + options := GetManagedPrefixListAssociationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetManagedPrefixListAssociationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetManagedPrefixListAssociationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetManagedPrefixListAssociations page. +func (p *GetManagedPrefixListAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetManagedPrefixListAssociationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetManagedPrefixListAssociations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeTransitGatewayVpcAttachmentsAPIClient is a client that implements the +// DescribeTransitGatewayVpcAttachments operation. +type DescribeTransitGatewayVpcAttachmentsAPIClient interface { + DescribeTransitGatewayVpcAttachments(context.Context, *DescribeTransitGatewayVpcAttachmentsInput, ...func(*Options)) (*DescribeTransitGatewayVpcAttachmentsOutput, error) +} + +var _ DescribeTransitGatewayVpcAttachmentsAPIClient = (*Client)(nil) + +// DescribeTransitGatewayVpcAttachmentsPaginatorOptions is the paginator options +// for DescribeTransitGatewayVpcAttachments +type DescribeTransitGatewayVpcAttachmentsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeTransitGatewayVpcAttachmentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeTransitGatewayVpcAttachments +type DescribeTransitGatewayVpcAttachmentsPaginator struct { + options DescribeTransitGatewayVpcAttachmentsPaginatorOptions + client DescribeTransitGatewayVpcAttachmentsAPIClient + params *DescribeTransitGatewayVpcAttachmentsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeTransitGatewayVpcAttachmentsPaginator returns a new +// DescribeTransitGatewayVpcAttachmentsPaginator +func NewDescribeTransitGatewayVpcAttachmentsPaginator(client DescribeTransitGatewayVpcAttachmentsAPIClient, params *DescribeTransitGatewayVpcAttachmentsInput, optFns ...func(*DescribeTransitGatewayVpcAttachmentsPaginatorOptions)) *DescribeTransitGatewayVpcAttachmentsPaginator { + options := DescribeTransitGatewayVpcAttachmentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeTransitGatewayVpcAttachmentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeTransitGatewayVpcAttachmentsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeTransitGatewayVpcAttachments page. +func (p *DescribeTransitGatewayVpcAttachmentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTransitGatewayVpcAttachmentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeTransitGatewayVpcAttachments(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeClientVpnAuthorizationRulesAPIClient is a client that implements the +// DescribeClientVpnAuthorizationRules operation. +type DescribeClientVpnAuthorizationRulesAPIClient interface { + DescribeClientVpnAuthorizationRules(context.Context, *DescribeClientVpnAuthorizationRulesInput, ...func(*Options)) (*DescribeClientVpnAuthorizationRulesOutput, error) +} + +var _ DescribeClientVpnAuthorizationRulesAPIClient = (*Client)(nil) + +// DescribeClientVpnAuthorizationRulesPaginatorOptions is the paginator options for +// DescribeClientVpnAuthorizationRules +type DescribeClientVpnAuthorizationRulesPaginatorOptions struct { + // The maximum number of results to return for the request in a single page. The + // remaining results can be seen by sending another request with the nextToken + // value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeClientVpnAuthorizationRulesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeClientVpnAuthorizationRules +type DescribeClientVpnAuthorizationRulesPaginator struct { + options DescribeClientVpnAuthorizationRulesPaginatorOptions + client DescribeClientVpnAuthorizationRulesAPIClient + params *DescribeClientVpnAuthorizationRulesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeClientVpnAuthorizationRulesPaginator returns a new +// DescribeClientVpnAuthorizationRulesPaginator +func NewDescribeClientVpnAuthorizationRulesPaginator(client DescribeClientVpnAuthorizationRulesAPIClient, params *DescribeClientVpnAuthorizationRulesInput, optFns ...func(*DescribeClientVpnAuthorizationRulesPaginatorOptions)) *DescribeClientVpnAuthorizationRulesPaginator { + options := DescribeClientVpnAuthorizationRulesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeClientVpnAuthorizationRulesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeClientVpnAuthorizationRulesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeClientVpnAuthorizationRules page. +func (p *DescribeClientVpnAuthorizationRulesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeClientVpnAuthorizationRulesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeClientVpnAuthorizationRules(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetTransitGatewayAttachmentPropagationsAPIClient is a client that implements the +// GetTransitGatewayAttachmentPropagations operation. +type GetTransitGatewayAttachmentPropagationsAPIClient interface { + GetTransitGatewayAttachmentPropagations(context.Context, *GetTransitGatewayAttachmentPropagationsInput, ...func(*Options)) (*GetTransitGatewayAttachmentPropagationsOutput, error) +} + +var _ GetTransitGatewayAttachmentPropagationsAPIClient = (*Client)(nil) + +// GetTransitGatewayAttachmentPropagationsPaginatorOptions is the paginator options +// for GetTransitGatewayAttachmentPropagations +type GetTransitGatewayAttachmentPropagationsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetTransitGatewayAttachmentPropagationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.GetTransitGatewayAttachmentPropagations +type GetTransitGatewayAttachmentPropagationsPaginator struct { + options GetTransitGatewayAttachmentPropagationsPaginatorOptions + client GetTransitGatewayAttachmentPropagationsAPIClient + params *GetTransitGatewayAttachmentPropagationsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetTransitGatewayAttachmentPropagationsPaginator returns a new +// GetTransitGatewayAttachmentPropagationsPaginator +func NewGetTransitGatewayAttachmentPropagationsPaginator(client GetTransitGatewayAttachmentPropagationsAPIClient, params *GetTransitGatewayAttachmentPropagationsInput, optFns ...func(*GetTransitGatewayAttachmentPropagationsPaginatorOptions)) *GetTransitGatewayAttachmentPropagationsPaginator { + options := GetTransitGatewayAttachmentPropagationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetTransitGatewayAttachmentPropagationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetTransitGatewayAttachmentPropagationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetTransitGatewayAttachmentPropagations page. +func (p *GetTransitGatewayAttachmentPropagationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetTransitGatewayAttachmentPropagationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetTransitGatewayAttachmentPropagations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeTransitGatewayRouteTablesAPIClient is a client that implements the +// DescribeTransitGatewayRouteTables operation. +type DescribeTransitGatewayRouteTablesAPIClient interface { + DescribeTransitGatewayRouteTables(context.Context, *DescribeTransitGatewayRouteTablesInput, ...func(*Options)) (*DescribeTransitGatewayRouteTablesOutput, error) +} + +var _ DescribeTransitGatewayRouteTablesAPIClient = (*Client)(nil) + +// DescribeTransitGatewayRouteTablesPaginatorOptions is the paginator options for +// DescribeTransitGatewayRouteTables +type DescribeTransitGatewayRouteTablesPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeTransitGatewayRouteTablesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeTransitGatewayRouteTables +type DescribeTransitGatewayRouteTablesPaginator struct { + options DescribeTransitGatewayRouteTablesPaginatorOptions + client DescribeTransitGatewayRouteTablesAPIClient + params *DescribeTransitGatewayRouteTablesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeTransitGatewayRouteTablesPaginator returns a new +// DescribeTransitGatewayRouteTablesPaginator +func NewDescribeTransitGatewayRouteTablesPaginator(client DescribeTransitGatewayRouteTablesAPIClient, params *DescribeTransitGatewayRouteTablesInput, optFns ...func(*DescribeTransitGatewayRouteTablesPaginatorOptions)) *DescribeTransitGatewayRouteTablesPaginator { + options := DescribeTransitGatewayRouteTablesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeTransitGatewayRouteTablesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeTransitGatewayRouteTablesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeTransitGatewayRouteTables page. +func (p *DescribeTransitGatewayRouteTablesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTransitGatewayRouteTablesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeTransitGatewayRouteTables(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeLocalGatewayRouteTableVpcAssociationsAPIClient is a client that +// implements the DescribeLocalGatewayRouteTableVpcAssociations operation. +type DescribeLocalGatewayRouteTableVpcAssociationsAPIClient interface { + DescribeLocalGatewayRouteTableVpcAssociations(context.Context, *DescribeLocalGatewayRouteTableVpcAssociationsInput, ...func(*Options)) (*DescribeLocalGatewayRouteTableVpcAssociationsOutput, error) +} + +var _ DescribeLocalGatewayRouteTableVpcAssociationsAPIClient = (*Client)(nil) + +// DescribeLocalGatewayRouteTableVpcAssociationsPaginatorOptions is the paginator +// options for DescribeLocalGatewayRouteTableVpcAssociations +type DescribeLocalGatewayRouteTableVpcAssociationsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeLocalGatewayRouteTableVpcAssociationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeLocalGatewayRouteTableVpcAssociations +type DescribeLocalGatewayRouteTableVpcAssociationsPaginator struct { + options DescribeLocalGatewayRouteTableVpcAssociationsPaginatorOptions + client DescribeLocalGatewayRouteTableVpcAssociationsAPIClient + params *DescribeLocalGatewayRouteTableVpcAssociationsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeLocalGatewayRouteTableVpcAssociationsPaginator returns a new +// DescribeLocalGatewayRouteTableVpcAssociationsPaginator +func NewDescribeLocalGatewayRouteTableVpcAssociationsPaginator(client DescribeLocalGatewayRouteTableVpcAssociationsAPIClient, params *DescribeLocalGatewayRouteTableVpcAssociationsInput, optFns ...func(*DescribeLocalGatewayRouteTableVpcAssociationsPaginatorOptions)) *DescribeLocalGatewayRouteTableVpcAssociationsPaginator { + options := DescribeLocalGatewayRouteTableVpcAssociationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeLocalGatewayRouteTableVpcAssociationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeLocalGatewayRouteTableVpcAssociationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeLocalGatewayRouteTableVpcAssociations page. +func (p *DescribeLocalGatewayRouteTableVpcAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeLocalGatewayRouteTableVpcAssociationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeLocalGatewayRouteTableVpcAssociations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeTrafficMirrorTargetsAPIClient is a client that implements the +// DescribeTrafficMirrorTargets operation. +type DescribeTrafficMirrorTargetsAPIClient interface { + DescribeTrafficMirrorTargets(context.Context, *DescribeTrafficMirrorTargetsInput, ...func(*Options)) (*DescribeTrafficMirrorTargetsOutput, error) +} + +var _ DescribeTrafficMirrorTargetsAPIClient = (*Client)(nil) + +// DescribeTrafficMirrorTargetsPaginatorOptions is the paginator options for +// DescribeTrafficMirrorTargets +type DescribeTrafficMirrorTargetsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeTrafficMirrorTargetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeTrafficMirrorTargets +type DescribeTrafficMirrorTargetsPaginator struct { + options DescribeTrafficMirrorTargetsPaginatorOptions + client DescribeTrafficMirrorTargetsAPIClient + params *DescribeTrafficMirrorTargetsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeTrafficMirrorTargetsPaginator returns a new +// DescribeTrafficMirrorTargetsPaginator +func NewDescribeTrafficMirrorTargetsPaginator(client DescribeTrafficMirrorTargetsAPIClient, params *DescribeTrafficMirrorTargetsInput, optFns ...func(*DescribeTrafficMirrorTargetsPaginatorOptions)) *DescribeTrafficMirrorTargetsPaginator { + options := DescribeTrafficMirrorTargetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeTrafficMirrorTargetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeTrafficMirrorTargetsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeTrafficMirrorTargets page. +func (p *DescribeTrafficMirrorTargetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTrafficMirrorTargetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeTrafficMirrorTargets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeNetworkInterfacesAPIClient is a client that implements the +// DescribeNetworkInterfaces operation. +type DescribeNetworkInterfacesAPIClient interface { + DescribeNetworkInterfaces(context.Context, *DescribeNetworkInterfacesInput, ...func(*Options)) (*DescribeNetworkInterfacesOutput, error) +} + +var _ DescribeNetworkInterfacesAPIClient = (*Client)(nil) + +// DescribeNetworkInterfacesPaginatorOptions is the paginator options for +// DescribeNetworkInterfaces +type DescribeNetworkInterfacesPaginatorOptions struct { + // The maximum number of items to return for this request. The request returns a + // token that you can specify in a subsequent call to get the next set of results. + // You cannot specify this parameter and the network interface IDs parameter in the + // same request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeNetworkInterfacesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeNetworkInterfaces +type DescribeNetworkInterfacesPaginator struct { + options DescribeNetworkInterfacesPaginatorOptions + client DescribeNetworkInterfacesAPIClient + params *DescribeNetworkInterfacesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeNetworkInterfacesPaginator returns a new +// DescribeNetworkInterfacesPaginator +func NewDescribeNetworkInterfacesPaginator(client DescribeNetworkInterfacesAPIClient, params *DescribeNetworkInterfacesInput, optFns ...func(*DescribeNetworkInterfacesPaginatorOptions)) *DescribeNetworkInterfacesPaginator { + options := DescribeNetworkInterfacesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeNetworkInterfacesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeNetworkInterfacesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeNetworkInterfaces page. +func (p *DescribeNetworkInterfacesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeNetworkInterfacesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeNetworkInterfaces(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeClientVpnConnectionsAPIClient is a client that implements the +// DescribeClientVpnConnections operation. +type DescribeClientVpnConnectionsAPIClient interface { + DescribeClientVpnConnections(context.Context, *DescribeClientVpnConnectionsInput, ...func(*Options)) (*DescribeClientVpnConnectionsOutput, error) +} + +var _ DescribeClientVpnConnectionsAPIClient = (*Client)(nil) + +// DescribeClientVpnConnectionsPaginatorOptions is the paginator options for +// DescribeClientVpnConnections +type DescribeClientVpnConnectionsPaginatorOptions struct { + // The maximum number of results to return for the request in a single page. The + // remaining results can be seen by sending another request with the nextToken + // value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeClientVpnConnectionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeClientVpnConnections +type DescribeClientVpnConnectionsPaginator struct { + options DescribeClientVpnConnectionsPaginatorOptions + client DescribeClientVpnConnectionsAPIClient + params *DescribeClientVpnConnectionsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeClientVpnConnectionsPaginator returns a new +// DescribeClientVpnConnectionsPaginator +func NewDescribeClientVpnConnectionsPaginator(client DescribeClientVpnConnectionsAPIClient, params *DescribeClientVpnConnectionsInput, optFns ...func(*DescribeClientVpnConnectionsPaginatorOptions)) *DescribeClientVpnConnectionsPaginator { + options := DescribeClientVpnConnectionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeClientVpnConnectionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeClientVpnConnectionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeClientVpnConnections page. +func (p *DescribeClientVpnConnectionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeClientVpnConnectionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeClientVpnConnections(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeClientVpnRoutesAPIClient is a client that implements the +// DescribeClientVpnRoutes operation. +type DescribeClientVpnRoutesAPIClient interface { + DescribeClientVpnRoutes(context.Context, *DescribeClientVpnRoutesInput, ...func(*Options)) (*DescribeClientVpnRoutesOutput, error) +} + +var _ DescribeClientVpnRoutesAPIClient = (*Client)(nil) + +// DescribeClientVpnRoutesPaginatorOptions is the paginator options for +// DescribeClientVpnRoutes +type DescribeClientVpnRoutesPaginatorOptions struct { + // The maximum number of results to return for the request in a single page. The + // remaining results can be seen by sending another request with the nextToken + // value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeClientVpnRoutesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeClientVpnRoutes +type DescribeClientVpnRoutesPaginator struct { + options DescribeClientVpnRoutesPaginatorOptions + client DescribeClientVpnRoutesAPIClient + params *DescribeClientVpnRoutesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeClientVpnRoutesPaginator returns a new +// DescribeClientVpnRoutesPaginator +func NewDescribeClientVpnRoutesPaginator(client DescribeClientVpnRoutesAPIClient, params *DescribeClientVpnRoutesInput, optFns ...func(*DescribeClientVpnRoutesPaginatorOptions)) *DescribeClientVpnRoutesPaginator { + options := DescribeClientVpnRoutesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeClientVpnRoutesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeClientVpnRoutesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeClientVpnRoutes page. +func (p *DescribeClientVpnRoutesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeClientVpnRoutesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeClientVpnRoutes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeHostReservationsAPIClient is a client that implements the +// DescribeHostReservations operation. +type DescribeHostReservationsAPIClient interface { + DescribeHostReservations(context.Context, *DescribeHostReservationsInput, ...func(*Options)) (*DescribeHostReservationsOutput, error) +} + +var _ DescribeHostReservationsAPIClient = (*Client)(nil) + +// DescribeHostReservationsPaginatorOptions is the paginator options for +// DescribeHostReservations +type DescribeHostReservationsPaginatorOptions struct { + // The maximum number of results to return for the request in a single page. The + // remaining results can be seen by sending another request with the returned + // nextToken value. This value can be between 5 and 500. If maxResults is given a + // larger value than 500, you receive an error. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeHostReservationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeHostReservations +type DescribeHostReservationsPaginator struct { + options DescribeHostReservationsPaginatorOptions + client DescribeHostReservationsAPIClient + params *DescribeHostReservationsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeHostReservationsPaginator returns a new +// DescribeHostReservationsPaginator +func NewDescribeHostReservationsPaginator(client DescribeHostReservationsAPIClient, params *DescribeHostReservationsInput, optFns ...func(*DescribeHostReservationsPaginatorOptions)) *DescribeHostReservationsPaginator { + options := DescribeHostReservationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeHostReservationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeHostReservationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeHostReservations page. +func (p *DescribeHostReservationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeHostReservationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeHostReservations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeCapacityReservationsAPIClient is a client that implements the +// DescribeCapacityReservations operation. +type DescribeCapacityReservationsAPIClient interface { + DescribeCapacityReservations(context.Context, *DescribeCapacityReservationsInput, ...func(*Options)) (*DescribeCapacityReservationsOutput, error) +} + +var _ DescribeCapacityReservationsAPIClient = (*Client)(nil) + +// DescribeCapacityReservationsPaginatorOptions is the paginator options for +// DescribeCapacityReservations +type DescribeCapacityReservationsPaginatorOptions struct { + // The maximum number of results to return for the request in a single page. The + // remaining results can be seen by sending another request with the returned + // nextToken value. This value can be between 5 and 500. If maxResults is given a + // larger value than 500, you receive an error. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeCapacityReservationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeCapacityReservations +type DescribeCapacityReservationsPaginator struct { + options DescribeCapacityReservationsPaginatorOptions + client DescribeCapacityReservationsAPIClient + params *DescribeCapacityReservationsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeCapacityReservationsPaginator returns a new +// DescribeCapacityReservationsPaginator +func NewDescribeCapacityReservationsPaginator(client DescribeCapacityReservationsAPIClient, params *DescribeCapacityReservationsInput, optFns ...func(*DescribeCapacityReservationsPaginatorOptions)) *DescribeCapacityReservationsPaginator { + options := DescribeCapacityReservationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeCapacityReservationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeCapacityReservationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeCapacityReservations page. +func (p *DescribeCapacityReservationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCapacityReservationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeCapacityReservations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeReservedInstancesOfferingsAPIClient is a client that implements the +// DescribeReservedInstancesOfferings operation. +type DescribeReservedInstancesOfferingsAPIClient interface { + DescribeReservedInstancesOfferings(context.Context, *DescribeReservedInstancesOfferingsInput, ...func(*Options)) (*DescribeReservedInstancesOfferingsOutput, error) +} + +var _ DescribeReservedInstancesOfferingsAPIClient = (*Client)(nil) + +// DescribeReservedInstancesOfferingsPaginatorOptions is the paginator options for +// DescribeReservedInstancesOfferings +type DescribeReservedInstancesOfferingsPaginatorOptions struct { + // The maximum number of results to return for the request in a single page. The + // remaining results of the initial request can be seen by sending another request + // with the returned NextToken value. The maximum is 100. Default: 100 + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeReservedInstancesOfferingsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeReservedInstancesOfferings +type DescribeReservedInstancesOfferingsPaginator struct { + options DescribeReservedInstancesOfferingsPaginatorOptions + client DescribeReservedInstancesOfferingsAPIClient + params *DescribeReservedInstancesOfferingsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeReservedInstancesOfferingsPaginator returns a new +// DescribeReservedInstancesOfferingsPaginator +func NewDescribeReservedInstancesOfferingsPaginator(client DescribeReservedInstancesOfferingsAPIClient, params *DescribeReservedInstancesOfferingsInput, optFns ...func(*DescribeReservedInstancesOfferingsPaginatorOptions)) *DescribeReservedInstancesOfferingsPaginator { + options := DescribeReservedInstancesOfferingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeReservedInstancesOfferingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeReservedInstancesOfferingsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeReservedInstancesOfferings page. +func (p *DescribeReservedInstancesOfferingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeReservedInstancesOfferingsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeReservedInstancesOfferings(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeLocalGatewayVirtualInterfaceGroupsAPIClient is a client that implements +// the DescribeLocalGatewayVirtualInterfaceGroups operation. +type DescribeLocalGatewayVirtualInterfaceGroupsAPIClient interface { + DescribeLocalGatewayVirtualInterfaceGroups(context.Context, *DescribeLocalGatewayVirtualInterfaceGroupsInput, ...func(*Options)) (*DescribeLocalGatewayVirtualInterfaceGroupsOutput, error) +} + +var _ DescribeLocalGatewayVirtualInterfaceGroupsAPIClient = (*Client)(nil) + +// DescribeLocalGatewayVirtualInterfaceGroupsPaginatorOptions is the paginator +// options for DescribeLocalGatewayVirtualInterfaceGroups +type DescribeLocalGatewayVirtualInterfaceGroupsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeLocalGatewayVirtualInterfaceGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeLocalGatewayVirtualInterfaceGroups +type DescribeLocalGatewayVirtualInterfaceGroupsPaginator struct { + options DescribeLocalGatewayVirtualInterfaceGroupsPaginatorOptions + client DescribeLocalGatewayVirtualInterfaceGroupsAPIClient + params *DescribeLocalGatewayVirtualInterfaceGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeLocalGatewayVirtualInterfaceGroupsPaginator returns a new +// DescribeLocalGatewayVirtualInterfaceGroupsPaginator +func NewDescribeLocalGatewayVirtualInterfaceGroupsPaginator(client DescribeLocalGatewayVirtualInterfaceGroupsAPIClient, params *DescribeLocalGatewayVirtualInterfaceGroupsInput, optFns ...func(*DescribeLocalGatewayVirtualInterfaceGroupsPaginatorOptions)) *DescribeLocalGatewayVirtualInterfaceGroupsPaginator { + options := DescribeLocalGatewayVirtualInterfaceGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeLocalGatewayVirtualInterfaceGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeLocalGatewayVirtualInterfaceGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeLocalGatewayVirtualInterfaceGroups page. +func (p *DescribeLocalGatewayVirtualInterfaceGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeLocalGatewayVirtualInterfaceGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeLocalGatewayVirtualInterfaceGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeVpcEndpointConnectionNotificationsAPIClient is a client that implements +// the DescribeVpcEndpointConnectionNotifications operation. +type DescribeVpcEndpointConnectionNotificationsAPIClient interface { + DescribeVpcEndpointConnectionNotifications(context.Context, *DescribeVpcEndpointConnectionNotificationsInput, ...func(*Options)) (*DescribeVpcEndpointConnectionNotificationsOutput, error) +} + +var _ DescribeVpcEndpointConnectionNotificationsAPIClient = (*Client)(nil) + +// DescribeVpcEndpointConnectionNotificationsPaginatorOptions is the paginator +// options for DescribeVpcEndpointConnectionNotifications +type DescribeVpcEndpointConnectionNotificationsPaginatorOptions struct { + // The maximum number of results to return in a single call. To retrieve the + // remaining results, make another request with the returned NextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeVpcEndpointConnectionNotificationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeVpcEndpointConnectionNotifications +type DescribeVpcEndpointConnectionNotificationsPaginator struct { + options DescribeVpcEndpointConnectionNotificationsPaginatorOptions + client DescribeVpcEndpointConnectionNotificationsAPIClient + params *DescribeVpcEndpointConnectionNotificationsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeVpcEndpointConnectionNotificationsPaginator returns a new +// DescribeVpcEndpointConnectionNotificationsPaginator +func NewDescribeVpcEndpointConnectionNotificationsPaginator(client DescribeVpcEndpointConnectionNotificationsAPIClient, params *DescribeVpcEndpointConnectionNotificationsInput, optFns ...func(*DescribeVpcEndpointConnectionNotificationsPaginatorOptions)) *DescribeVpcEndpointConnectionNotificationsPaginator { + options := DescribeVpcEndpointConnectionNotificationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeVpcEndpointConnectionNotificationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeVpcEndpointConnectionNotificationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeVpcEndpointConnectionNotifications page. +func (p *DescribeVpcEndpointConnectionNotificationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeVpcEndpointConnectionNotificationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeVpcEndpointConnectionNotifications(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeVpcsAPIClient is a client that implements the DescribeVpcs operation. +type DescribeVpcsAPIClient interface { + DescribeVpcs(context.Context, *DescribeVpcsInput, ...func(*Options)) (*DescribeVpcsOutput, error) +} + +var _ DescribeVpcsAPIClient = (*Client)(nil) + +// DescribeVpcsPaginatorOptions is the paginator options for DescribeVpcs +type DescribeVpcsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeVpcsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeVpcs +type DescribeVpcsPaginator struct { + options DescribeVpcsPaginatorOptions + client DescribeVpcsAPIClient + params *DescribeVpcsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeVpcsPaginator returns a new DescribeVpcsPaginator +func NewDescribeVpcsPaginator(client DescribeVpcsAPIClient, params *DescribeVpcsInput, optFns ...func(*DescribeVpcsPaginatorOptions)) *DescribeVpcsPaginator { + options := DescribeVpcsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeVpcsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeVpcsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeVpcs page. +func (p *DescribeVpcsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeVpcsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeVpcs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeStaleSecurityGroupsAPIClient is a client that implements the +// DescribeStaleSecurityGroups operation. +type DescribeStaleSecurityGroupsAPIClient interface { + DescribeStaleSecurityGroups(context.Context, *DescribeStaleSecurityGroupsInput, ...func(*Options)) (*DescribeStaleSecurityGroupsOutput, error) +} + +var _ DescribeStaleSecurityGroupsAPIClient = (*Client)(nil) + +// DescribeStaleSecurityGroupsPaginatorOptions is the paginator options for +// DescribeStaleSecurityGroups +type DescribeStaleSecurityGroupsPaginatorOptions struct { + // The maximum number of items to return for this request. The request returns a + // token that you can specify in a subsequent call to get the next set of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeStaleSecurityGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeStaleSecurityGroups +type DescribeStaleSecurityGroupsPaginator struct { + options DescribeStaleSecurityGroupsPaginatorOptions + client DescribeStaleSecurityGroupsAPIClient + params *DescribeStaleSecurityGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeStaleSecurityGroupsPaginator returns a new +// DescribeStaleSecurityGroupsPaginator +func NewDescribeStaleSecurityGroupsPaginator(client DescribeStaleSecurityGroupsAPIClient, params *DescribeStaleSecurityGroupsInput, optFns ...func(*DescribeStaleSecurityGroupsPaginatorOptions)) *DescribeStaleSecurityGroupsPaginator { + options := DescribeStaleSecurityGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeStaleSecurityGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeStaleSecurityGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeStaleSecurityGroups page. +func (p *DescribeStaleSecurityGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeStaleSecurityGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeStaleSecurityGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeLocalGatewayRouteTablesAPIClient is a client that implements the +// DescribeLocalGatewayRouteTables operation. +type DescribeLocalGatewayRouteTablesAPIClient interface { + DescribeLocalGatewayRouteTables(context.Context, *DescribeLocalGatewayRouteTablesInput, ...func(*Options)) (*DescribeLocalGatewayRouteTablesOutput, error) +} + +var _ DescribeLocalGatewayRouteTablesAPIClient = (*Client)(nil) + +// DescribeLocalGatewayRouteTablesPaginatorOptions is the paginator options for +// DescribeLocalGatewayRouteTables +type DescribeLocalGatewayRouteTablesPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeLocalGatewayRouteTablesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeLocalGatewayRouteTables +type DescribeLocalGatewayRouteTablesPaginator struct { + options DescribeLocalGatewayRouteTablesPaginatorOptions + client DescribeLocalGatewayRouteTablesAPIClient + params *DescribeLocalGatewayRouteTablesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeLocalGatewayRouteTablesPaginator returns a new +// DescribeLocalGatewayRouteTablesPaginator +func NewDescribeLocalGatewayRouteTablesPaginator(client DescribeLocalGatewayRouteTablesAPIClient, params *DescribeLocalGatewayRouteTablesInput, optFns ...func(*DescribeLocalGatewayRouteTablesPaginatorOptions)) *DescribeLocalGatewayRouteTablesPaginator { + options := DescribeLocalGatewayRouteTablesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeLocalGatewayRouteTablesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeLocalGatewayRouteTablesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeLocalGatewayRouteTables page. +func (p *DescribeLocalGatewayRouteTablesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeLocalGatewayRouteTablesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeLocalGatewayRouteTables(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeIamInstanceProfileAssociationsAPIClient is a client that implements the +// DescribeIamInstanceProfileAssociations operation. +type DescribeIamInstanceProfileAssociationsAPIClient interface { + DescribeIamInstanceProfileAssociations(context.Context, *DescribeIamInstanceProfileAssociationsInput, ...func(*Options)) (*DescribeIamInstanceProfileAssociationsOutput, error) +} + +var _ DescribeIamInstanceProfileAssociationsAPIClient = (*Client)(nil) + +// DescribeIamInstanceProfileAssociationsPaginatorOptions is the paginator options +// for DescribeIamInstanceProfileAssociations +type DescribeIamInstanceProfileAssociationsPaginatorOptions struct { + // The maximum number of results to return in a single call. To retrieve the + // remaining results, make another call with the returned NextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeIamInstanceProfileAssociationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeIamInstanceProfileAssociations +type DescribeIamInstanceProfileAssociationsPaginator struct { + options DescribeIamInstanceProfileAssociationsPaginatorOptions + client DescribeIamInstanceProfileAssociationsAPIClient + params *DescribeIamInstanceProfileAssociationsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeIamInstanceProfileAssociationsPaginator returns a new +// DescribeIamInstanceProfileAssociationsPaginator +func NewDescribeIamInstanceProfileAssociationsPaginator(client DescribeIamInstanceProfileAssociationsAPIClient, params *DescribeIamInstanceProfileAssociationsInput, optFns ...func(*DescribeIamInstanceProfileAssociationsPaginatorOptions)) *DescribeIamInstanceProfileAssociationsPaginator { + options := DescribeIamInstanceProfileAssociationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeIamInstanceProfileAssociationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeIamInstanceProfileAssociationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeIamInstanceProfileAssociations page. +func (p *DescribeIamInstanceProfileAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeIamInstanceProfileAssociationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeIamInstanceProfileAssociations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetTransitGatewayRouteTablePropagationsAPIClient is a client that implements the +// GetTransitGatewayRouteTablePropagations operation. +type GetTransitGatewayRouteTablePropagationsAPIClient interface { + GetTransitGatewayRouteTablePropagations(context.Context, *GetTransitGatewayRouteTablePropagationsInput, ...func(*Options)) (*GetTransitGatewayRouteTablePropagationsOutput, error) +} + +var _ GetTransitGatewayRouteTablePropagationsAPIClient = (*Client)(nil) + +// GetTransitGatewayRouteTablePropagationsPaginatorOptions is the paginator options +// for GetTransitGatewayRouteTablePropagations +type GetTransitGatewayRouteTablePropagationsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetTransitGatewayRouteTablePropagationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.GetTransitGatewayRouteTablePropagations +type GetTransitGatewayRouteTablePropagationsPaginator struct { + options GetTransitGatewayRouteTablePropagationsPaginatorOptions + client GetTransitGatewayRouteTablePropagationsAPIClient + params *GetTransitGatewayRouteTablePropagationsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetTransitGatewayRouteTablePropagationsPaginator returns a new +// GetTransitGatewayRouteTablePropagationsPaginator +func NewGetTransitGatewayRouteTablePropagationsPaginator(client GetTransitGatewayRouteTablePropagationsAPIClient, params *GetTransitGatewayRouteTablePropagationsInput, optFns ...func(*GetTransitGatewayRouteTablePropagationsPaginatorOptions)) *GetTransitGatewayRouteTablePropagationsPaginator { + options := GetTransitGatewayRouteTablePropagationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetTransitGatewayRouteTablePropagationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetTransitGatewayRouteTablePropagationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetTransitGatewayRouteTablePropagations page. +func (p *GetTransitGatewayRouteTablePropagationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetTransitGatewayRouteTablePropagationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetTransitGatewayRouteTablePropagations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeSpotInstanceRequestsAPIClient is a client that implements the +// DescribeSpotInstanceRequests operation. +type DescribeSpotInstanceRequestsAPIClient interface { + DescribeSpotInstanceRequests(context.Context, *DescribeSpotInstanceRequestsInput, ...func(*Options)) (*DescribeSpotInstanceRequestsOutput, error) +} + +var _ DescribeSpotInstanceRequestsAPIClient = (*Client)(nil) + +// DescribeSpotInstanceRequestsPaginatorOptions is the paginator options for +// DescribeSpotInstanceRequests +type DescribeSpotInstanceRequestsPaginatorOptions struct { + // The maximum number of results to return in a single call. Specify a value + // between 5 and 1000. To retrieve the remaining results, make another call with + // the returned NextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeSpotInstanceRequestsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeSpotInstanceRequests +type DescribeSpotInstanceRequestsPaginator struct { + options DescribeSpotInstanceRequestsPaginatorOptions + client DescribeSpotInstanceRequestsAPIClient + params *DescribeSpotInstanceRequestsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeSpotInstanceRequestsPaginator returns a new +// DescribeSpotInstanceRequestsPaginator +func NewDescribeSpotInstanceRequestsPaginator(client DescribeSpotInstanceRequestsAPIClient, params *DescribeSpotInstanceRequestsInput, optFns ...func(*DescribeSpotInstanceRequestsPaginatorOptions)) *DescribeSpotInstanceRequestsPaginator { + options := DescribeSpotInstanceRequestsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeSpotInstanceRequestsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeSpotInstanceRequestsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeSpotInstanceRequests page. +func (p *DescribeSpotInstanceRequestsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeSpotInstanceRequestsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeSpotInstanceRequests(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeLaunchTemplatesAPIClient is a client that implements the +// DescribeLaunchTemplates operation. +type DescribeLaunchTemplatesAPIClient interface { + DescribeLaunchTemplates(context.Context, *DescribeLaunchTemplatesInput, ...func(*Options)) (*DescribeLaunchTemplatesOutput, error) +} + +var _ DescribeLaunchTemplatesAPIClient = (*Client)(nil) + +// DescribeLaunchTemplatesPaginatorOptions is the paginator options for +// DescribeLaunchTemplates +type DescribeLaunchTemplatesPaginatorOptions struct { + // The maximum number of results to return in a single call. To retrieve the + // remaining results, make another call with the returned NextToken value. This + // value can be between 1 and 200. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeLaunchTemplatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeLaunchTemplates +type DescribeLaunchTemplatesPaginator struct { + options DescribeLaunchTemplatesPaginatorOptions + client DescribeLaunchTemplatesAPIClient + params *DescribeLaunchTemplatesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeLaunchTemplatesPaginator returns a new +// DescribeLaunchTemplatesPaginator +func NewDescribeLaunchTemplatesPaginator(client DescribeLaunchTemplatesAPIClient, params *DescribeLaunchTemplatesInput, optFns ...func(*DescribeLaunchTemplatesPaginatorOptions)) *DescribeLaunchTemplatesPaginator { + options := DescribeLaunchTemplatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeLaunchTemplatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeLaunchTemplatesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeLaunchTemplates page. +func (p *DescribeLaunchTemplatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeLaunchTemplatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeLaunchTemplates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeInstanceStatusAPIClient is a client that implements the +// DescribeInstanceStatus operation. +type DescribeInstanceStatusAPIClient interface { + DescribeInstanceStatus(context.Context, *DescribeInstanceStatusInput, ...func(*Options)) (*DescribeInstanceStatusOutput, error) +} + +var _ DescribeInstanceStatusAPIClient = (*Client)(nil) + +// DescribeInstanceStatusPaginatorOptions is the paginator options for +// DescribeInstanceStatus +type DescribeInstanceStatusPaginatorOptions struct { + // The maximum number of results to return in a single call. To retrieve the + // remaining results, make another call with the returned NextToken value. This + // value can be between 5 and 1000. You cannot specify this parameter and the + // instance IDs parameter in the same call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeInstanceStatusPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeInstanceStatus +type DescribeInstanceStatusPaginator struct { + options DescribeInstanceStatusPaginatorOptions + client DescribeInstanceStatusAPIClient + params *DescribeInstanceStatusInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeInstanceStatusPaginator returns a new DescribeInstanceStatusPaginator +func NewDescribeInstanceStatusPaginator(client DescribeInstanceStatusAPIClient, params *DescribeInstanceStatusInput, optFns ...func(*DescribeInstanceStatusPaginatorOptions)) *DescribeInstanceStatusPaginator { + options := DescribeInstanceStatusPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeInstanceStatusPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeInstanceStatusPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeInstanceStatus page. +func (p *DescribeInstanceStatusPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInstanceStatusOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeInstanceStatus(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeTransitGatewayAttachmentsAPIClient is a client that implements the +// DescribeTransitGatewayAttachments operation. +type DescribeTransitGatewayAttachmentsAPIClient interface { + DescribeTransitGatewayAttachments(context.Context, *DescribeTransitGatewayAttachmentsInput, ...func(*Options)) (*DescribeTransitGatewayAttachmentsOutput, error) +} + +var _ DescribeTransitGatewayAttachmentsAPIClient = (*Client)(nil) + +// DescribeTransitGatewayAttachmentsPaginatorOptions is the paginator options for +// DescribeTransitGatewayAttachments +type DescribeTransitGatewayAttachmentsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeTransitGatewayAttachmentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeTransitGatewayAttachments +type DescribeTransitGatewayAttachmentsPaginator struct { + options DescribeTransitGatewayAttachmentsPaginatorOptions + client DescribeTransitGatewayAttachmentsAPIClient + params *DescribeTransitGatewayAttachmentsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeTransitGatewayAttachmentsPaginator returns a new +// DescribeTransitGatewayAttachmentsPaginator +func NewDescribeTransitGatewayAttachmentsPaginator(client DescribeTransitGatewayAttachmentsAPIClient, params *DescribeTransitGatewayAttachmentsInput, optFns ...func(*DescribeTransitGatewayAttachmentsPaginatorOptions)) *DescribeTransitGatewayAttachmentsPaginator { + options := DescribeTransitGatewayAttachmentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeTransitGatewayAttachmentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeTransitGatewayAttachmentsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeTransitGatewayAttachments page. +func (p *DescribeTransitGatewayAttachmentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTransitGatewayAttachmentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeTransitGatewayAttachments(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// SearchLocalGatewayRoutesAPIClient is a client that implements the +// SearchLocalGatewayRoutes operation. +type SearchLocalGatewayRoutesAPIClient interface { + SearchLocalGatewayRoutes(context.Context, *SearchLocalGatewayRoutesInput, ...func(*Options)) (*SearchLocalGatewayRoutesOutput, error) +} + +var _ SearchLocalGatewayRoutesAPIClient = (*Client)(nil) + +// SearchLocalGatewayRoutesPaginatorOptions is the paginator options for +// SearchLocalGatewayRoutes +type SearchLocalGatewayRoutesPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// SearchLocalGatewayRoutesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.SearchLocalGatewayRoutes +type SearchLocalGatewayRoutesPaginator struct { + options SearchLocalGatewayRoutesPaginatorOptions + client SearchLocalGatewayRoutesAPIClient + params *SearchLocalGatewayRoutesInput + nextToken *string + firstPage bool + done bool +} + +// NewSearchLocalGatewayRoutesPaginator returns a new +// SearchLocalGatewayRoutesPaginator +func NewSearchLocalGatewayRoutesPaginator(client SearchLocalGatewayRoutesAPIClient, params *SearchLocalGatewayRoutesInput, optFns ...func(*SearchLocalGatewayRoutesPaginatorOptions)) *SearchLocalGatewayRoutesPaginator { + options := SearchLocalGatewayRoutesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &SearchLocalGatewayRoutesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchLocalGatewayRoutesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next SearchLocalGatewayRoutes page. +func (p *SearchLocalGatewayRoutesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchLocalGatewayRoutesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.SearchLocalGatewayRoutes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetAssociatedIpv6PoolCidrsAPIClient is a client that implements the +// GetAssociatedIpv6PoolCidrs operation. +type GetAssociatedIpv6PoolCidrsAPIClient interface { + GetAssociatedIpv6PoolCidrs(context.Context, *GetAssociatedIpv6PoolCidrsInput, ...func(*Options)) (*GetAssociatedIpv6PoolCidrsOutput, error) +} + +var _ GetAssociatedIpv6PoolCidrsAPIClient = (*Client)(nil) + +// GetAssociatedIpv6PoolCidrsPaginatorOptions is the paginator options for +// GetAssociatedIpv6PoolCidrs +type GetAssociatedIpv6PoolCidrsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetAssociatedIpv6PoolCidrsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.GetAssociatedIpv6PoolCidrs +type GetAssociatedIpv6PoolCidrsPaginator struct { + options GetAssociatedIpv6PoolCidrsPaginatorOptions + client GetAssociatedIpv6PoolCidrsAPIClient + params *GetAssociatedIpv6PoolCidrsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetAssociatedIpv6PoolCidrsPaginator returns a new +// GetAssociatedIpv6PoolCidrsPaginator +func NewGetAssociatedIpv6PoolCidrsPaginator(client GetAssociatedIpv6PoolCidrsAPIClient, params *GetAssociatedIpv6PoolCidrsInput, optFns ...func(*GetAssociatedIpv6PoolCidrsPaginatorOptions)) *GetAssociatedIpv6PoolCidrsPaginator { + options := GetAssociatedIpv6PoolCidrsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetAssociatedIpv6PoolCidrsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetAssociatedIpv6PoolCidrsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetAssociatedIpv6PoolCidrs page. +func (p *GetAssociatedIpv6PoolCidrsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetAssociatedIpv6PoolCidrsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetAssociatedIpv6PoolCidrs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeLocalGatewaysAPIClient is a client that implements the +// DescribeLocalGateways operation. +type DescribeLocalGatewaysAPIClient interface { + DescribeLocalGateways(context.Context, *DescribeLocalGatewaysInput, ...func(*Options)) (*DescribeLocalGatewaysOutput, error) +} + +var _ DescribeLocalGatewaysAPIClient = (*Client)(nil) + +// DescribeLocalGatewaysPaginatorOptions is the paginator options for +// DescribeLocalGateways +type DescribeLocalGatewaysPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeLocalGatewaysPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeLocalGateways +type DescribeLocalGatewaysPaginator struct { + options DescribeLocalGatewaysPaginatorOptions + client DescribeLocalGatewaysAPIClient + params *DescribeLocalGatewaysInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeLocalGatewaysPaginator returns a new DescribeLocalGatewaysPaginator +func NewDescribeLocalGatewaysPaginator(client DescribeLocalGatewaysAPIClient, params *DescribeLocalGatewaysInput, optFns ...func(*DescribeLocalGatewaysPaginatorOptions)) *DescribeLocalGatewaysPaginator { + options := DescribeLocalGatewaysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeLocalGatewaysPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeLocalGatewaysPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeLocalGateways page. +func (p *DescribeLocalGatewaysPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeLocalGatewaysOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeLocalGateways(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeInstanceTypeOfferingsAPIClient is a client that implements the +// DescribeInstanceTypeOfferings operation. +type DescribeInstanceTypeOfferingsAPIClient interface { + DescribeInstanceTypeOfferings(context.Context, *DescribeInstanceTypeOfferingsInput, ...func(*Options)) (*DescribeInstanceTypeOfferingsOutput, error) +} + +var _ DescribeInstanceTypeOfferingsAPIClient = (*Client)(nil) + +// DescribeInstanceTypeOfferingsPaginatorOptions is the paginator options for +// DescribeInstanceTypeOfferings +type DescribeInstanceTypeOfferingsPaginatorOptions struct { + // The maximum number of results to return for the request in a single page. The + // remaining results can be seen by sending another request with the next token + // value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeInstanceTypeOfferingsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeInstanceTypeOfferings +type DescribeInstanceTypeOfferingsPaginator struct { + options DescribeInstanceTypeOfferingsPaginatorOptions + client DescribeInstanceTypeOfferingsAPIClient + params *DescribeInstanceTypeOfferingsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeInstanceTypeOfferingsPaginator returns a new +// DescribeInstanceTypeOfferingsPaginator +func NewDescribeInstanceTypeOfferingsPaginator(client DescribeInstanceTypeOfferingsAPIClient, params *DescribeInstanceTypeOfferingsInput, optFns ...func(*DescribeInstanceTypeOfferingsPaginatorOptions)) *DescribeInstanceTypeOfferingsPaginator { + options := DescribeInstanceTypeOfferingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeInstanceTypeOfferingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeInstanceTypeOfferingsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeInstanceTypeOfferings page. +func (p *DescribeInstanceTypeOfferingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInstanceTypeOfferingsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeInstanceTypeOfferings(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeFlowLogsAPIClient is a client that implements the DescribeFlowLogs +// operation. +type DescribeFlowLogsAPIClient interface { + DescribeFlowLogs(context.Context, *DescribeFlowLogsInput, ...func(*Options)) (*DescribeFlowLogsOutput, error) +} + +var _ DescribeFlowLogsAPIClient = (*Client)(nil) + +// DescribeFlowLogsPaginatorOptions is the paginator options for DescribeFlowLogs +type DescribeFlowLogsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeFlowLogsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeFlowLogs +type DescribeFlowLogsPaginator struct { + options DescribeFlowLogsPaginatorOptions + client DescribeFlowLogsAPIClient + params *DescribeFlowLogsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeFlowLogsPaginator returns a new DescribeFlowLogsPaginator +func NewDescribeFlowLogsPaginator(client DescribeFlowLogsAPIClient, params *DescribeFlowLogsInput, optFns ...func(*DescribeFlowLogsPaginatorOptions)) *DescribeFlowLogsPaginator { + options := DescribeFlowLogsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeFlowLogsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeFlowLogsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeFlowLogs page. +func (p *DescribeFlowLogsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeFlowLogsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeFlowLogs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeTrafficMirrorFiltersAPIClient is a client that implements the +// DescribeTrafficMirrorFilters operation. +type DescribeTrafficMirrorFiltersAPIClient interface { + DescribeTrafficMirrorFilters(context.Context, *DescribeTrafficMirrorFiltersInput, ...func(*Options)) (*DescribeTrafficMirrorFiltersOutput, error) +} + +var _ DescribeTrafficMirrorFiltersAPIClient = (*Client)(nil) + +// DescribeTrafficMirrorFiltersPaginatorOptions is the paginator options for +// DescribeTrafficMirrorFilters +type DescribeTrafficMirrorFiltersPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeTrafficMirrorFiltersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeTrafficMirrorFilters +type DescribeTrafficMirrorFiltersPaginator struct { + options DescribeTrafficMirrorFiltersPaginatorOptions + client DescribeTrafficMirrorFiltersAPIClient + params *DescribeTrafficMirrorFiltersInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeTrafficMirrorFiltersPaginator returns a new +// DescribeTrafficMirrorFiltersPaginator +func NewDescribeTrafficMirrorFiltersPaginator(client DescribeTrafficMirrorFiltersAPIClient, params *DescribeTrafficMirrorFiltersInput, optFns ...func(*DescribeTrafficMirrorFiltersPaginatorOptions)) *DescribeTrafficMirrorFiltersPaginator { + options := DescribeTrafficMirrorFiltersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeTrafficMirrorFiltersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeTrafficMirrorFiltersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeTrafficMirrorFilters page. +func (p *DescribeTrafficMirrorFiltersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTrafficMirrorFiltersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeTrafficMirrorFilters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeRouteTablesAPIClient is a client that implements the DescribeRouteTables +// operation. +type DescribeRouteTablesAPIClient interface { + DescribeRouteTables(context.Context, *DescribeRouteTablesInput, ...func(*Options)) (*DescribeRouteTablesOutput, error) +} + +var _ DescribeRouteTablesAPIClient = (*Client)(nil) + +// DescribeRouteTablesPaginatorOptions is the paginator options for +// DescribeRouteTables +type DescribeRouteTablesPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeRouteTablesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeRouteTables +type DescribeRouteTablesPaginator struct { + options DescribeRouteTablesPaginatorOptions + client DescribeRouteTablesAPIClient + params *DescribeRouteTablesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeRouteTablesPaginator returns a new DescribeRouteTablesPaginator +func NewDescribeRouteTablesPaginator(client DescribeRouteTablesAPIClient, params *DescribeRouteTablesInput, optFns ...func(*DescribeRouteTablesPaginatorOptions)) *DescribeRouteTablesPaginator { + options := DescribeRouteTablesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeRouteTablesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeRouteTablesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeRouteTables page. +func (p *DescribeRouteTablesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeRouteTablesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeRouteTables(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeReservedInstancesModificationsAPIClient is a client that implements the +// DescribeReservedInstancesModifications operation. +type DescribeReservedInstancesModificationsAPIClient interface { + DescribeReservedInstancesModifications(context.Context, *DescribeReservedInstancesModificationsInput, ...func(*Options)) (*DescribeReservedInstancesModificationsOutput, error) +} + +var _ DescribeReservedInstancesModificationsAPIClient = (*Client)(nil) + +// DescribeReservedInstancesModificationsPaginatorOptions is the paginator options +// for DescribeReservedInstancesModifications +type DescribeReservedInstancesModificationsPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeReservedInstancesModificationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeReservedInstancesModifications +type DescribeReservedInstancesModificationsPaginator struct { + options DescribeReservedInstancesModificationsPaginatorOptions + client DescribeReservedInstancesModificationsAPIClient + params *DescribeReservedInstancesModificationsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeReservedInstancesModificationsPaginator returns a new +// DescribeReservedInstancesModificationsPaginator +func NewDescribeReservedInstancesModificationsPaginator(client DescribeReservedInstancesModificationsAPIClient, params *DescribeReservedInstancesModificationsInput, optFns ...func(*DescribeReservedInstancesModificationsPaginatorOptions)) *DescribeReservedInstancesModificationsPaginator { + options := DescribeReservedInstancesModificationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeReservedInstancesModificationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeReservedInstancesModificationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeReservedInstancesModifications page. +func (p *DescribeReservedInstancesModificationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeReservedInstancesModificationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.DescribeReservedInstancesModifications(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeSnapshotsAPIClient is a client that implements the DescribeSnapshots +// operation. +type DescribeSnapshotsAPIClient interface { + DescribeSnapshots(context.Context, *DescribeSnapshotsInput, ...func(*Options)) (*DescribeSnapshotsOutput, error) +} + +var _ DescribeSnapshotsAPIClient = (*Client)(nil) + +// DescribeSnapshotsPaginatorOptions is the paginator options for DescribeSnapshots +type DescribeSnapshotsPaginatorOptions struct { + // The maximum number of snapshot results returned by DescribeSnapshots in + // paginated output. When this parameter is used, DescribeSnapshots only returns + // MaxResults results in a single page along with a NextToken response element. The + // remaining results of the initial request can be seen by sending another + // DescribeSnapshots request with the returned NextToken value. This value can be + // between 5 and 1000; if MaxResults is given a value larger than 1000, only 1000 + // results are returned. If this parameter is not used, then DescribeSnapshots + // returns all results. You cannot specify this parameter and the snapshot IDs + // parameter in the same request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeSnapshotsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeSnapshots +type DescribeSnapshotsPaginator struct { + options DescribeSnapshotsPaginatorOptions + client DescribeSnapshotsAPIClient + params *DescribeSnapshotsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeSnapshotsPaginator returns a new DescribeSnapshotsPaginator +func NewDescribeSnapshotsPaginator(client DescribeSnapshotsAPIClient, params *DescribeSnapshotsInput, optFns ...func(*DescribeSnapshotsPaginatorOptions)) *DescribeSnapshotsPaginator { + options := DescribeSnapshotsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeSnapshotsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeSnapshotsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeSnapshots page. +func (p *DescribeSnapshotsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeSnapshotsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeSnapshots(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetGroupsForCapacityReservationAPIClient is a client that implements the +// GetGroupsForCapacityReservation operation. +type GetGroupsForCapacityReservationAPIClient interface { + GetGroupsForCapacityReservation(context.Context, *GetGroupsForCapacityReservationInput, ...func(*Options)) (*GetGroupsForCapacityReservationOutput, error) +} + +var _ GetGroupsForCapacityReservationAPIClient = (*Client)(nil) + +// GetGroupsForCapacityReservationPaginatorOptions is the paginator options for +// GetGroupsForCapacityReservation +type GetGroupsForCapacityReservationPaginatorOptions struct { + // The maximum number of results to return for the request in a single page. The + // remaining results can be seen by sending another request with the returned + // nextToken value. This value can be between 5 and 500. If maxResults is given a + // larger value than 500, you receive an error. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetGroupsForCapacityReservationPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.GetGroupsForCapacityReservation +type GetGroupsForCapacityReservationPaginator struct { + options GetGroupsForCapacityReservationPaginatorOptions + client GetGroupsForCapacityReservationAPIClient + params *GetGroupsForCapacityReservationInput + nextToken *string + firstPage bool + done bool +} + +// NewGetGroupsForCapacityReservationPaginator returns a new +// GetGroupsForCapacityReservationPaginator +func NewGetGroupsForCapacityReservationPaginator(client GetGroupsForCapacityReservationAPIClient, params *GetGroupsForCapacityReservationInput, optFns ...func(*GetGroupsForCapacityReservationPaginatorOptions)) *GetGroupsForCapacityReservationPaginator { + options := GetGroupsForCapacityReservationPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetGroupsForCapacityReservationPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetGroupsForCapacityReservationPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetGroupsForCapacityReservation page. +func (p *GetGroupsForCapacityReservationPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetGroupsForCapacityReservationOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetGroupsForCapacityReservation(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeFastSnapshotRestoresAPIClient is a client that implements the +// DescribeFastSnapshotRestores operation. +type DescribeFastSnapshotRestoresAPIClient interface { + DescribeFastSnapshotRestores(context.Context, *DescribeFastSnapshotRestoresInput, ...func(*Options)) (*DescribeFastSnapshotRestoresOutput, error) +} + +var _ DescribeFastSnapshotRestoresAPIClient = (*Client)(nil) + +// DescribeFastSnapshotRestoresPaginatorOptions is the paginator options for +// DescribeFastSnapshotRestores +type DescribeFastSnapshotRestoresPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeFastSnapshotRestoresPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeFastSnapshotRestores +type DescribeFastSnapshotRestoresPaginator struct { + options DescribeFastSnapshotRestoresPaginatorOptions + client DescribeFastSnapshotRestoresAPIClient + params *DescribeFastSnapshotRestoresInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeFastSnapshotRestoresPaginator returns a new +// DescribeFastSnapshotRestoresPaginator +func NewDescribeFastSnapshotRestoresPaginator(client DescribeFastSnapshotRestoresAPIClient, params *DescribeFastSnapshotRestoresInput, optFns ...func(*DescribeFastSnapshotRestoresPaginatorOptions)) *DescribeFastSnapshotRestoresPaginator { + options := DescribeFastSnapshotRestoresPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeFastSnapshotRestoresPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeFastSnapshotRestoresPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeFastSnapshotRestores page. +func (p *DescribeFastSnapshotRestoresPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeFastSnapshotRestoresOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeFastSnapshotRestores(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeEgressOnlyInternetGatewaysAPIClient is a client that implements the +// DescribeEgressOnlyInternetGateways operation. +type DescribeEgressOnlyInternetGatewaysAPIClient interface { + DescribeEgressOnlyInternetGateways(context.Context, *DescribeEgressOnlyInternetGatewaysInput, ...func(*Options)) (*DescribeEgressOnlyInternetGatewaysOutput, error) +} + +var _ DescribeEgressOnlyInternetGatewaysAPIClient = (*Client)(nil) + +// DescribeEgressOnlyInternetGatewaysPaginatorOptions is the paginator options for +// DescribeEgressOnlyInternetGateways +type DescribeEgressOnlyInternetGatewaysPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeEgressOnlyInternetGatewaysPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeEgressOnlyInternetGateways +type DescribeEgressOnlyInternetGatewaysPaginator struct { + options DescribeEgressOnlyInternetGatewaysPaginatorOptions + client DescribeEgressOnlyInternetGatewaysAPIClient + params *DescribeEgressOnlyInternetGatewaysInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeEgressOnlyInternetGatewaysPaginator returns a new +// DescribeEgressOnlyInternetGatewaysPaginator +func NewDescribeEgressOnlyInternetGatewaysPaginator(client DescribeEgressOnlyInternetGatewaysAPIClient, params *DescribeEgressOnlyInternetGatewaysInput, optFns ...func(*DescribeEgressOnlyInternetGatewaysPaginatorOptions)) *DescribeEgressOnlyInternetGatewaysPaginator { + options := DescribeEgressOnlyInternetGatewaysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeEgressOnlyInternetGatewaysPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEgressOnlyInternetGatewaysPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeEgressOnlyInternetGateways page. +func (p *DescribeEgressOnlyInternetGatewaysPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEgressOnlyInternetGatewaysOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeEgressOnlyInternetGateways(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeClassicLinkInstancesAPIClient is a client that implements the +// DescribeClassicLinkInstances operation. +type DescribeClassicLinkInstancesAPIClient interface { + DescribeClassicLinkInstances(context.Context, *DescribeClassicLinkInstancesInput, ...func(*Options)) (*DescribeClassicLinkInstancesOutput, error) +} + +var _ DescribeClassicLinkInstancesAPIClient = (*Client)(nil) + +// DescribeClassicLinkInstancesPaginatorOptions is the paginator options for +// DescribeClassicLinkInstances +type DescribeClassicLinkInstancesPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + // Constraint: If the value is greater than 1000, we return only 1000 items. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeClassicLinkInstancesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeClassicLinkInstances +type DescribeClassicLinkInstancesPaginator struct { + options DescribeClassicLinkInstancesPaginatorOptions + client DescribeClassicLinkInstancesAPIClient + params *DescribeClassicLinkInstancesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeClassicLinkInstancesPaginator returns a new +// DescribeClassicLinkInstancesPaginator +func NewDescribeClassicLinkInstancesPaginator(client DescribeClassicLinkInstancesAPIClient, params *DescribeClassicLinkInstancesInput, optFns ...func(*DescribeClassicLinkInstancesPaginatorOptions)) *DescribeClassicLinkInstancesPaginator { + options := DescribeClassicLinkInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeClassicLinkInstancesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeClassicLinkInstancesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeClassicLinkInstances page. +func (p *DescribeClassicLinkInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeClassicLinkInstancesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeClassicLinkInstances(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/ec2instanceconnect/go.sum b/service/ec2instanceconnect/go.sum index c669e324b14..32595049f96 100644 --- a/service/ec2instanceconnect/go.sum +++ b/service/ec2instanceconnect/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/ecr/go.sum b/service/ecr/go.sum index c669e324b14..32595049f96 100644 --- a/service/ecr/go.sum +++ b/service/ecr/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/ecr/paginators.go b/service/ecr/paginators.go new file mode 100644 index 00000000000..7e2ee509a64 --- /dev/null +++ b/service/ecr/paginators.go @@ -0,0 +1,423 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ecr + +import ( + "context" + "fmt" +) + +// ListImagesAPIClient is a client that implements the ListImages operation. +type ListImagesAPIClient interface { + ListImages(context.Context, *ListImagesInput, ...func(*Options)) (*ListImagesOutput, error) +} + +var _ ListImagesAPIClient = (*Client)(nil) + +// ListImagesPaginatorOptions is the paginator options for ListImages +type ListImagesPaginatorOptions struct { + // The maximum number of image results returned by ListImages in paginated output. + // When this parameter is used, ListImages only returns maxResults results in a + // single page along with a nextToken response element. The remaining results of + // the initial request can be seen by sending another ListImages request with the + // returned nextToken value. This value can be between 1 and 1000. If this + // parameter is not used, then ListImages returns up to 100 results and a nextToken + // value, if applicable. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListImagesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ecr.ListImages +type ListImagesPaginator struct { + options ListImagesPaginatorOptions + client ListImagesAPIClient + params *ListImagesInput + nextToken *string + firstPage bool + done bool +} + +// NewListImagesPaginator returns a new ListImagesPaginator +func NewListImagesPaginator(client ListImagesAPIClient, params *ListImagesInput, optFns ...func(*ListImagesPaginatorOptions)) *ListImagesPaginator { + options := ListImagesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListImagesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListImagesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListImages page. +func (p *ListImagesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListImagesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListImages(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeImageScanFindingsAPIClient is a client that implements the +// DescribeImageScanFindings operation. +type DescribeImageScanFindingsAPIClient interface { + DescribeImageScanFindings(context.Context, *DescribeImageScanFindingsInput, ...func(*Options)) (*DescribeImageScanFindingsOutput, error) +} + +var _ DescribeImageScanFindingsAPIClient = (*Client)(nil) + +// DescribeImageScanFindingsPaginatorOptions is the paginator options for +// DescribeImageScanFindings +type DescribeImageScanFindingsPaginatorOptions struct { + // The maximum number of image scan results returned by DescribeImageScanFindings + // in paginated output. When this parameter is used, DescribeImageScanFindings only + // returns maxResults results in a single page along with a nextToken response + // element. The remaining results of the initial request can be seen by sending + // another DescribeImageScanFindings request with the returned nextToken value. + // This value can be between 1 and 1000. If this parameter is not used, then + // DescribeImageScanFindings returns up to 100 results and a nextToken value, if + // applicable. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeImageScanFindingsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ecr.DescribeImageScanFindings +type DescribeImageScanFindingsPaginator struct { + options DescribeImageScanFindingsPaginatorOptions + client DescribeImageScanFindingsAPIClient + params *DescribeImageScanFindingsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeImageScanFindingsPaginator returns a new +// DescribeImageScanFindingsPaginator +func NewDescribeImageScanFindingsPaginator(client DescribeImageScanFindingsAPIClient, params *DescribeImageScanFindingsInput, optFns ...func(*DescribeImageScanFindingsPaginatorOptions)) *DescribeImageScanFindingsPaginator { + options := DescribeImageScanFindingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeImageScanFindingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeImageScanFindingsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeImageScanFindings page. +func (p *DescribeImageScanFindingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeImageScanFindingsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeImageScanFindings(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeImagesAPIClient is a client that implements the DescribeImages +// operation. +type DescribeImagesAPIClient interface { + DescribeImages(context.Context, *DescribeImagesInput, ...func(*Options)) (*DescribeImagesOutput, error) +} + +var _ DescribeImagesAPIClient = (*Client)(nil) + +// DescribeImagesPaginatorOptions is the paginator options for DescribeImages +type DescribeImagesPaginatorOptions struct { + // The maximum number of repository results returned by DescribeImages in paginated + // output. When this parameter is used, DescribeImages only returns maxResults + // results in a single page along with a nextToken response element. The remaining + // results of the initial request can be seen by sending another DescribeImages + // request with the returned nextToken value. This value can be between 1 and 1000. + // If this parameter is not used, then DescribeImages returns up to 100 results and + // a nextToken value, if applicable. This option cannot be used when you specify + // images with imageIds. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeImagesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ecr.DescribeImages +type DescribeImagesPaginator struct { + options DescribeImagesPaginatorOptions + client DescribeImagesAPIClient + params *DescribeImagesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeImagesPaginator returns a new DescribeImagesPaginator +func NewDescribeImagesPaginator(client DescribeImagesAPIClient, params *DescribeImagesInput, optFns ...func(*DescribeImagesPaginatorOptions)) *DescribeImagesPaginator { + options := DescribeImagesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeImagesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeImagesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeImages page. +func (p *DescribeImagesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeImagesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeImages(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetLifecyclePolicyPreviewAPIClient is a client that implements the +// GetLifecyclePolicyPreview operation. +type GetLifecyclePolicyPreviewAPIClient interface { + GetLifecyclePolicyPreview(context.Context, *GetLifecyclePolicyPreviewInput, ...func(*Options)) (*GetLifecyclePolicyPreviewOutput, error) +} + +var _ GetLifecyclePolicyPreviewAPIClient = (*Client)(nil) + +// GetLifecyclePolicyPreviewPaginatorOptions is the paginator options for +// GetLifecyclePolicyPreview +type GetLifecyclePolicyPreviewPaginatorOptions struct { + // The maximum number of repository results returned by + // GetLifecyclePolicyPreviewRequest in
 paginated output. When this parameter is + // used, GetLifecyclePolicyPreviewRequest only returns
 maxResults results in a + // single page along with a nextToken
 response element. The remaining results of + // the initial request can be seen by sending
 another + // GetLifecyclePolicyPreviewRequest request with the returned nextToken
 value. + // This value can be between 1 and 1000. If this
 parameter is not used, then + // GetLifecyclePolicyPreviewRequest returns up to
 100 results and a nextToken + // value, if
 applicable. This option cannot be used when you specify images with + // imageIds. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetLifecyclePolicyPreviewPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ecr.GetLifecyclePolicyPreview +type GetLifecyclePolicyPreviewPaginator struct { + options GetLifecyclePolicyPreviewPaginatorOptions + client GetLifecyclePolicyPreviewAPIClient + params *GetLifecyclePolicyPreviewInput + nextToken *string + firstPage bool + done bool +} + +// NewGetLifecyclePolicyPreviewPaginator returns a new +// GetLifecyclePolicyPreviewPaginator +func NewGetLifecyclePolicyPreviewPaginator(client GetLifecyclePolicyPreviewAPIClient, params *GetLifecyclePolicyPreviewInput, optFns ...func(*GetLifecyclePolicyPreviewPaginatorOptions)) *GetLifecyclePolicyPreviewPaginator { + options := GetLifecyclePolicyPreviewPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetLifecyclePolicyPreviewPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetLifecyclePolicyPreviewPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetLifecyclePolicyPreview page. +func (p *GetLifecyclePolicyPreviewPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetLifecyclePolicyPreviewOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetLifecyclePolicyPreview(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeRepositoriesAPIClient is a client that implements the +// DescribeRepositories operation. +type DescribeRepositoriesAPIClient interface { + DescribeRepositories(context.Context, *DescribeRepositoriesInput, ...func(*Options)) (*DescribeRepositoriesOutput, error) +} + +var _ DescribeRepositoriesAPIClient = (*Client)(nil) + +// DescribeRepositoriesPaginatorOptions is the paginator options for +// DescribeRepositories +type DescribeRepositoriesPaginatorOptions struct { + // The maximum number of repository results returned by DescribeRepositories in + // paginated output. When this parameter is used, DescribeRepositories only returns + // maxResults results in a single page along with a nextToken response element. The + // remaining results of the initial request can be seen by sending another + // DescribeRepositories request with the returned nextToken value. This value can + // be between 1 and 1000. If this parameter is not used, then DescribeRepositories + // returns up to 100 results and a nextToken value, if applicable. This option + // cannot be used when you specify repositories with repositoryNames. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeRepositoriesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ecr.DescribeRepositories +type DescribeRepositoriesPaginator struct { + options DescribeRepositoriesPaginatorOptions + client DescribeRepositoriesAPIClient + params *DescribeRepositoriesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeRepositoriesPaginator returns a new DescribeRepositoriesPaginator +func NewDescribeRepositoriesPaginator(client DescribeRepositoriesAPIClient, params *DescribeRepositoriesInput, optFns ...func(*DescribeRepositoriesPaginatorOptions)) *DescribeRepositoriesPaginator { + options := DescribeRepositoriesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeRepositoriesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeRepositoriesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeRepositories page. +func (p *DescribeRepositoriesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeRepositoriesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeRepositories(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/ecs/go.sum b/service/ecs/go.sum index c669e324b14..32595049f96 100644 --- a/service/ecs/go.sum +++ b/service/ecs/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/ecs/paginators.go b/service/ecs/paginators.go new file mode 100644 index 00000000000..8fdc67b74ec --- /dev/null +++ b/service/ecs/paginators.go @@ -0,0 +1,660 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ecs + +import ( + "context" + "fmt" +) + +// ListTasksAPIClient is a client that implements the ListTasks operation. +type ListTasksAPIClient interface { + ListTasks(context.Context, *ListTasksInput, ...func(*Options)) (*ListTasksOutput, error) +} + +var _ ListTasksAPIClient = (*Client)(nil) + +// ListTasksPaginatorOptions is the paginator options for ListTasks +type ListTasksPaginatorOptions struct { + // The maximum number of task results returned by ListTasks in paginated output. + // When this parameter is used, ListTasks only returns maxResults results in a + // single page along with a nextToken response element. The remaining results of + // the initial request can be seen by sending another ListTasks request with the + // returned nextToken value. This value can be between 1 and 100. If this parameter + // is not used, then ListTasks returns up to 100 results and a nextToken value if + // applicable. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTasksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ecs.ListTasks +type ListTasksPaginator struct { + options ListTasksPaginatorOptions + client ListTasksAPIClient + params *ListTasksInput + nextToken *string + firstPage bool + done bool +} + +// NewListTasksPaginator returns a new ListTasksPaginator +func NewListTasksPaginator(client ListTasksAPIClient, params *ListTasksInput, optFns ...func(*ListTasksPaginatorOptions)) *ListTasksPaginator { + options := ListTasksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTasksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTasksPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTasks page. +func (p *ListTasksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTasksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListTasks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListContainerInstancesAPIClient is a client that implements the +// ListContainerInstances operation. +type ListContainerInstancesAPIClient interface { + ListContainerInstances(context.Context, *ListContainerInstancesInput, ...func(*Options)) (*ListContainerInstancesOutput, error) +} + +var _ ListContainerInstancesAPIClient = (*Client)(nil) + +// ListContainerInstancesPaginatorOptions is the paginator options for +// ListContainerInstances +type ListContainerInstancesPaginatorOptions struct { + // The maximum number of container instance results returned by + // ListContainerInstances in paginated output. When this parameter is used, + // ListContainerInstances only returns maxResults results in a single page along + // with a nextToken response element. The remaining results of the initial request + // can be seen by sending another ListContainerInstances request with the returned + // nextToken value. This value can be between 1 and 100. If this parameter is not + // used, then ListContainerInstances returns up to 100 results and a nextToken + // value if applicable. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListContainerInstancesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ecs.ListContainerInstances +type ListContainerInstancesPaginator struct { + options ListContainerInstancesPaginatorOptions + client ListContainerInstancesAPIClient + params *ListContainerInstancesInput + nextToken *string + firstPage bool + done bool +} + +// NewListContainerInstancesPaginator returns a new ListContainerInstancesPaginator +func NewListContainerInstancesPaginator(client ListContainerInstancesAPIClient, params *ListContainerInstancesInput, optFns ...func(*ListContainerInstancesPaginatorOptions)) *ListContainerInstancesPaginator { + options := ListContainerInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListContainerInstancesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListContainerInstancesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListContainerInstances page. +func (p *ListContainerInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListContainerInstancesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListContainerInstances(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTaskDefinitionsAPIClient is a client that implements the ListTaskDefinitions +// operation. +type ListTaskDefinitionsAPIClient interface { + ListTaskDefinitions(context.Context, *ListTaskDefinitionsInput, ...func(*Options)) (*ListTaskDefinitionsOutput, error) +} + +var _ ListTaskDefinitionsAPIClient = (*Client)(nil) + +// ListTaskDefinitionsPaginatorOptions is the paginator options for +// ListTaskDefinitions +type ListTaskDefinitionsPaginatorOptions struct { + // The maximum number of task definition results returned by ListTaskDefinitions in + // paginated output. When this parameter is used, ListTaskDefinitions only returns + // maxResults results in a single page along with a nextToken response element. The + // remaining results of the initial request can be seen by sending another + // ListTaskDefinitions request with the returned nextToken value. This value can be + // between 1 and 100. If this parameter is not used, then ListTaskDefinitions + // returns up to 100 results and a nextToken value if applicable. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTaskDefinitionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ecs.ListTaskDefinitions +type ListTaskDefinitionsPaginator struct { + options ListTaskDefinitionsPaginatorOptions + client ListTaskDefinitionsAPIClient + params *ListTaskDefinitionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListTaskDefinitionsPaginator returns a new ListTaskDefinitionsPaginator +func NewListTaskDefinitionsPaginator(client ListTaskDefinitionsAPIClient, params *ListTaskDefinitionsInput, optFns ...func(*ListTaskDefinitionsPaginatorOptions)) *ListTaskDefinitionsPaginator { + options := ListTaskDefinitionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTaskDefinitionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTaskDefinitionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTaskDefinitions page. +func (p *ListTaskDefinitionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTaskDefinitionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListTaskDefinitions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListServicesAPIClient is a client that implements the ListServices operation. +type ListServicesAPIClient interface { + ListServices(context.Context, *ListServicesInput, ...func(*Options)) (*ListServicesOutput, error) +} + +var _ ListServicesAPIClient = (*Client)(nil) + +// ListServicesPaginatorOptions is the paginator options for ListServices +type ListServicesPaginatorOptions struct { + // The maximum number of service results returned by ListServices in paginated + // output. When this parameter is used, ListServices only returns maxResults + // results in a single page along with a nextToken response element. The remaining + // results of the initial request can be seen by sending another ListServices + // request with the returned nextToken value. This value can be between 1 and 100. + // If this parameter is not used, then ListServices returns up to 10 results and a + // nextToken value if applicable. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListServicesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ecs.ListServices +type ListServicesPaginator struct { + options ListServicesPaginatorOptions + client ListServicesAPIClient + params *ListServicesInput + nextToken *string + firstPage bool + done bool +} + +// NewListServicesPaginator returns a new ListServicesPaginator +func NewListServicesPaginator(client ListServicesAPIClient, params *ListServicesInput, optFns ...func(*ListServicesPaginatorOptions)) *ListServicesPaginator { + options := ListServicesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListServicesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListServicesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListServices page. +func (p *ListServicesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListServicesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListServices(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListClustersAPIClient is a client that implements the ListClusters operation. +type ListClustersAPIClient interface { + ListClusters(context.Context, *ListClustersInput, ...func(*Options)) (*ListClustersOutput, error) +} + +var _ ListClustersAPIClient = (*Client)(nil) + +// ListClustersPaginatorOptions is the paginator options for ListClusters +type ListClustersPaginatorOptions struct { + // The maximum number of cluster results returned by ListClusters in paginated + // output. When this parameter is used, ListClusters only returns maxResults + // results in a single page along with a nextToken response element. The remaining + // results of the initial request can be seen by sending another ListClusters + // request with the returned nextToken value. This value can be between 1 and 100. + // If this parameter is not used, then ListClusters returns up to 100 results and a + // nextToken value if applicable. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListClustersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ecs.ListClusters +type ListClustersPaginator struct { + options ListClustersPaginatorOptions + client ListClustersAPIClient + params *ListClustersInput + nextToken *string + firstPage bool + done bool +} + +// NewListClustersPaginator returns a new ListClustersPaginator +func NewListClustersPaginator(client ListClustersAPIClient, params *ListClustersInput, optFns ...func(*ListClustersPaginatorOptions)) *ListClustersPaginator { + options := ListClustersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListClustersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListClustersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListClusters page. +func (p *ListClustersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListClustersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListClusters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListAccountSettingsAPIClient is a client that implements the ListAccountSettings +// operation. +type ListAccountSettingsAPIClient interface { + ListAccountSettings(context.Context, *ListAccountSettingsInput, ...func(*Options)) (*ListAccountSettingsOutput, error) +} + +var _ ListAccountSettingsAPIClient = (*Client)(nil) + +// ListAccountSettingsPaginatorOptions is the paginator options for +// ListAccountSettings +type ListAccountSettingsPaginatorOptions struct { + // The maximum number of account setting results returned by ListAccountSettings in + // paginated output. When this parameter is used, ListAccountSettings only returns + // maxResults results in a single page along with a nextToken response element. The + // remaining results of the initial request can be seen by sending another + // ListAccountSettings request with the returned nextToken value. This value can be + // between 1 and 10. If this parameter is not used, then ListAccountSettings + // returns up to 10 results and a nextToken value if applicable. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAccountSettingsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ecs.ListAccountSettings +type ListAccountSettingsPaginator struct { + options ListAccountSettingsPaginatorOptions + client ListAccountSettingsAPIClient + params *ListAccountSettingsInput + nextToken *string + firstPage bool + done bool +} + +// NewListAccountSettingsPaginator returns a new ListAccountSettingsPaginator +func NewListAccountSettingsPaginator(client ListAccountSettingsAPIClient, params *ListAccountSettingsInput, optFns ...func(*ListAccountSettingsPaginatorOptions)) *ListAccountSettingsPaginator { + options := ListAccountSettingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAccountSettingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAccountSettingsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAccountSettings page. +func (p *ListAccountSettingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccountSettingsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListAccountSettings(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListAttributesAPIClient is a client that implements the ListAttributes +// operation. +type ListAttributesAPIClient interface { + ListAttributes(context.Context, *ListAttributesInput, ...func(*Options)) (*ListAttributesOutput, error) +} + +var _ ListAttributesAPIClient = (*Client)(nil) + +// ListAttributesPaginatorOptions is the paginator options for ListAttributes +type ListAttributesPaginatorOptions struct { + // The maximum number of cluster results returned by ListAttributes in paginated + // output. When this parameter is used, ListAttributes only returns maxResults + // results in a single page along with a nextToken response element. The remaining + // results of the initial request can be seen by sending another ListAttributes + // request with the returned nextToken value. This value can be between 1 and 100. + // If this parameter is not used, then ListAttributes returns up to 100 results and + // a nextToken value if applicable. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAttributesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ecs.ListAttributes +type ListAttributesPaginator struct { + options ListAttributesPaginatorOptions + client ListAttributesAPIClient + params *ListAttributesInput + nextToken *string + firstPage bool + done bool +} + +// NewListAttributesPaginator returns a new ListAttributesPaginator +func NewListAttributesPaginator(client ListAttributesAPIClient, params *ListAttributesInput, optFns ...func(*ListAttributesPaginatorOptions)) *ListAttributesPaginator { + options := ListAttributesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAttributesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAttributesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAttributes page. +func (p *ListAttributesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAttributesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListAttributes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTaskDefinitionFamiliesAPIClient is a client that implements the +// ListTaskDefinitionFamilies operation. +type ListTaskDefinitionFamiliesAPIClient interface { + ListTaskDefinitionFamilies(context.Context, *ListTaskDefinitionFamiliesInput, ...func(*Options)) (*ListTaskDefinitionFamiliesOutput, error) +} + +var _ ListTaskDefinitionFamiliesAPIClient = (*Client)(nil) + +// ListTaskDefinitionFamiliesPaginatorOptions is the paginator options for +// ListTaskDefinitionFamilies +type ListTaskDefinitionFamiliesPaginatorOptions struct { + // The maximum number of task definition family results returned by + // ListTaskDefinitionFamilies in paginated output. When this parameter is used, + // ListTaskDefinitions only returns maxResults results in a single page along with + // a nextToken response element. The remaining results of the initial request can + // be seen by sending another ListTaskDefinitionFamilies request with the returned + // nextToken value. This value can be between 1 and 100. If this parameter is not + // used, then ListTaskDefinitionFamilies returns up to 100 results and a nextToken + // value if applicable. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTaskDefinitionFamiliesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ecs.ListTaskDefinitionFamilies +type ListTaskDefinitionFamiliesPaginator struct { + options ListTaskDefinitionFamiliesPaginatorOptions + client ListTaskDefinitionFamiliesAPIClient + params *ListTaskDefinitionFamiliesInput + nextToken *string + firstPage bool + done bool +} + +// NewListTaskDefinitionFamiliesPaginator returns a new +// ListTaskDefinitionFamiliesPaginator +func NewListTaskDefinitionFamiliesPaginator(client ListTaskDefinitionFamiliesAPIClient, params *ListTaskDefinitionFamiliesInput, optFns ...func(*ListTaskDefinitionFamiliesPaginatorOptions)) *ListTaskDefinitionFamiliesPaginator { + options := ListTaskDefinitionFamiliesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTaskDefinitionFamiliesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTaskDefinitionFamiliesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTaskDefinitionFamilies page. +func (p *ListTaskDefinitionFamiliesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTaskDefinitionFamiliesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListTaskDefinitionFamilies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/efs/go.sum b/service/efs/go.sum index c669e324b14..32595049f96 100644 --- a/service/efs/go.sum +++ b/service/efs/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/efs/paginators.go b/service/efs/paginators.go new file mode 100644 index 00000000000..2f55d88d433 --- /dev/null +++ b/service/efs/paginators.go @@ -0,0 +1,318 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package efs + +import ( + "context" + "fmt" +) + +// DescribeFileSystemsAPIClient is a client that implements the DescribeFileSystems +// operation. +type DescribeFileSystemsAPIClient interface { + DescribeFileSystems(context.Context, *DescribeFileSystemsInput, ...func(*Options)) (*DescribeFileSystemsOutput, error) +} + +var _ DescribeFileSystemsAPIClient = (*Client)(nil) + +// DescribeFileSystemsPaginatorOptions is the paginator options for +// DescribeFileSystems +type DescribeFileSystemsPaginatorOptions struct { + // (Optional) Specifies the maximum number of file systems to return in the + // response (integer). This number is automatically set to 100. The response is + // paginated at 100 per page if you have more than 100 file systems. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeFileSystemsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/efs.DescribeFileSystems +type DescribeFileSystemsPaginator struct { + options DescribeFileSystemsPaginatorOptions + client DescribeFileSystemsAPIClient + params *DescribeFileSystemsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeFileSystemsPaginator returns a new DescribeFileSystemsPaginator +func NewDescribeFileSystemsPaginator(client DescribeFileSystemsAPIClient, params *DescribeFileSystemsInput, optFns ...func(*DescribeFileSystemsPaginatorOptions)) *DescribeFileSystemsPaginator { + options := DescribeFileSystemsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeFileSystemsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeFileSystemsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeFileSystems page. +func (p *DescribeFileSystemsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeFileSystemsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxItems = p.options.Limit + result, err := p.client.DescribeFileSystems(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeAccessPointsAPIClient is a client that implements the +// DescribeAccessPoints operation. +type DescribeAccessPointsAPIClient interface { + DescribeAccessPoints(context.Context, *DescribeAccessPointsInput, ...func(*Options)) (*DescribeAccessPointsOutput, error) +} + +var _ DescribeAccessPointsAPIClient = (*Client)(nil) + +// DescribeAccessPointsPaginatorOptions is the paginator options for +// DescribeAccessPoints +type DescribeAccessPointsPaginatorOptions struct { + // (Optional) When retrieving all access points for a file system, you can + // optionally specify the MaxItems parameter to limit the number of objects + // returned in a response. The default value is 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeAccessPointsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/efs.DescribeAccessPoints +type DescribeAccessPointsPaginator struct { + options DescribeAccessPointsPaginatorOptions + client DescribeAccessPointsAPIClient + params *DescribeAccessPointsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeAccessPointsPaginator returns a new DescribeAccessPointsPaginator +func NewDescribeAccessPointsPaginator(client DescribeAccessPointsAPIClient, params *DescribeAccessPointsInput, optFns ...func(*DescribeAccessPointsPaginatorOptions)) *DescribeAccessPointsPaginator { + options := DescribeAccessPointsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeAccessPointsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeAccessPointsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeAccessPoints page. +func (p *DescribeAccessPointsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeAccessPointsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeAccessPoints(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeTagsAPIClient is a client that implements the DescribeTags operation. +type DescribeTagsAPIClient interface { + DescribeTags(context.Context, *DescribeTagsInput, ...func(*Options)) (*DescribeTagsOutput, error) +} + +var _ DescribeTagsAPIClient = (*Client)(nil) + +// DescribeTagsPaginatorOptions is the paginator options for DescribeTags +type DescribeTagsPaginatorOptions struct { + // (Optional) The maximum number of file system tags to return in the response. + // Currently, this number is automatically set to 100, and other values are + // ignored. The response is paginated at 100 per page if you have more than 100 + // tags. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeTagsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/efs.DescribeTags +type DescribeTagsPaginator struct { + options DescribeTagsPaginatorOptions + client DescribeTagsAPIClient + params *DescribeTagsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeTagsPaginator returns a new DescribeTagsPaginator +func NewDescribeTagsPaginator(client DescribeTagsAPIClient, params *DescribeTagsInput, optFns ...func(*DescribeTagsPaginatorOptions)) *DescribeTagsPaginator { + options := DescribeTagsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeTagsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeTagsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeTags page. +func (p *DescribeTagsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTagsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxItems = p.options.Limit + result, err := p.client.DescribeTags(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTagsForResourceAPIClient is a client that implements the ListTagsForResource +// operation. +type ListTagsForResourceAPIClient interface { + ListTagsForResource(context.Context, *ListTagsForResourceInput, ...func(*Options)) (*ListTagsForResourceOutput, error) +} + +var _ ListTagsForResourceAPIClient = (*Client)(nil) + +// ListTagsForResourcePaginatorOptions is the paginator options for +// ListTagsForResource +type ListTagsForResourcePaginatorOptions struct { + // (Optional) Specifies the maximum number of tag objects to return in the + // response. The default value is 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTagsForResourcePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/efs.ListTagsForResource +type ListTagsForResourcePaginator struct { + options ListTagsForResourcePaginatorOptions + client ListTagsForResourceAPIClient + params *ListTagsForResourceInput + nextToken *string + firstPage bool + done bool +} + +// NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator +func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator { + options := ListTagsForResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTagsForResourcePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTagsForResourcePaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTagsForResource page. +func (p *ListTagsForResourcePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListTagsForResource(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/eks/go.sum b/service/eks/go.sum index c669e324b14..32595049f96 100644 --- a/service/eks/go.sum +++ b/service/eks/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/eks/paginators.go b/service/eks/paginators.go new file mode 100644 index 00000000000..14ba058ba4c --- /dev/null +++ b/service/eks/paginators.go @@ -0,0 +1,331 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package eks + +import ( + "context" + "fmt" +) + +// ListNodegroupsAPIClient is a client that implements the ListNodegroups +// operation. +type ListNodegroupsAPIClient interface { + ListNodegroups(context.Context, *ListNodegroupsInput, ...func(*Options)) (*ListNodegroupsOutput, error) +} + +var _ ListNodegroupsAPIClient = (*Client)(nil) + +// ListNodegroupsPaginatorOptions is the paginator options for ListNodegroups +type ListNodegroupsPaginatorOptions struct { + // The maximum number of node group results returned by ListNodegroups in paginated + // output. When you use this parameter, ListNodegroups returns only maxResults + // results in a single page along with a nextToken response element. You can see + // the remaining results of the initial request by sending another ListNodegroups + // request with the returned nextToken value. This value can be between 1 and 100. + // If you don't use this parameter, ListNodegroups returns up to 100 results and a + // nextToken value if applicable. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListNodegroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/eks.ListNodegroups +type ListNodegroupsPaginator struct { + options ListNodegroupsPaginatorOptions + client ListNodegroupsAPIClient + params *ListNodegroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewListNodegroupsPaginator returns a new ListNodegroupsPaginator +func NewListNodegroupsPaginator(client ListNodegroupsAPIClient, params *ListNodegroupsInput, optFns ...func(*ListNodegroupsPaginatorOptions)) *ListNodegroupsPaginator { + options := ListNodegroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListNodegroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListNodegroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListNodegroups page. +func (p *ListNodegroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListNodegroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListNodegroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListClustersAPIClient is a client that implements the ListClusters operation. +type ListClustersAPIClient interface { + ListClusters(context.Context, *ListClustersInput, ...func(*Options)) (*ListClustersOutput, error) +} + +var _ ListClustersAPIClient = (*Client)(nil) + +// ListClustersPaginatorOptions is the paginator options for ListClusters +type ListClustersPaginatorOptions struct { + // The maximum number of cluster results returned by ListClusters in paginated + // output. When you use this parameter, ListClusters returns only maxResults + // results in a single page along with a nextToken response element. You can see + // the remaining results of the initial request by sending another ListClusters + // request with the returned nextToken value. This value can be between 1 and 100. + // If you don't use this parameter, ListClusters returns up to 100 results and a + // nextToken value if applicable. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListClustersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/eks.ListClusters +type ListClustersPaginator struct { + options ListClustersPaginatorOptions + client ListClustersAPIClient + params *ListClustersInput + nextToken *string + firstPage bool + done bool +} + +// NewListClustersPaginator returns a new ListClustersPaginator +func NewListClustersPaginator(client ListClustersAPIClient, params *ListClustersInput, optFns ...func(*ListClustersPaginatorOptions)) *ListClustersPaginator { + options := ListClustersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListClustersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListClustersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListClusters page. +func (p *ListClustersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListClustersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListClusters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListFargateProfilesAPIClient is a client that implements the ListFargateProfiles +// operation. +type ListFargateProfilesAPIClient interface { + ListFargateProfiles(context.Context, *ListFargateProfilesInput, ...func(*Options)) (*ListFargateProfilesOutput, error) +} + +var _ ListFargateProfilesAPIClient = (*Client)(nil) + +// ListFargateProfilesPaginatorOptions is the paginator options for +// ListFargateProfiles +type ListFargateProfilesPaginatorOptions struct { + // The maximum number of Fargate profile results returned by ListFargateProfiles in + // paginated output. When you use this parameter, ListFargateProfiles returns only + // maxResults results in a single page along with a nextToken response element. You + // can see the remaining results of the initial request by sending another + // ListFargateProfiles request with the returned nextToken value. This value can be + // between 1 and 100. If you don't use this parameter, ListFargateProfiles returns + // up to 100 results and a nextToken value if applicable. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListFargateProfilesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/eks.ListFargateProfiles +type ListFargateProfilesPaginator struct { + options ListFargateProfilesPaginatorOptions + client ListFargateProfilesAPIClient + params *ListFargateProfilesInput + nextToken *string + firstPage bool + done bool +} + +// NewListFargateProfilesPaginator returns a new ListFargateProfilesPaginator +func NewListFargateProfilesPaginator(client ListFargateProfilesAPIClient, params *ListFargateProfilesInput, optFns ...func(*ListFargateProfilesPaginatorOptions)) *ListFargateProfilesPaginator { + options := ListFargateProfilesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListFargateProfilesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListFargateProfilesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListFargateProfiles page. +func (p *ListFargateProfilesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFargateProfilesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListFargateProfiles(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListUpdatesAPIClient is a client that implements the ListUpdates operation. +type ListUpdatesAPIClient interface { + ListUpdates(context.Context, *ListUpdatesInput, ...func(*Options)) (*ListUpdatesOutput, error) +} + +var _ ListUpdatesAPIClient = (*Client)(nil) + +// ListUpdatesPaginatorOptions is the paginator options for ListUpdates +type ListUpdatesPaginatorOptions struct { + // The maximum number of update results returned by ListUpdates in paginated + // output. When you use this parameter, ListUpdates returns only maxResults results + // in a single page along with a nextToken response element. You can see the + // remaining results of the initial request by sending another ListUpdates request + // with the returned nextToken value. This value can be between 1 and 100. If you + // don't use this parameter, ListUpdates returns up to 100 results and a nextToken + // value if applicable. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListUpdatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/eks.ListUpdates +type ListUpdatesPaginator struct { + options ListUpdatesPaginatorOptions + client ListUpdatesAPIClient + params *ListUpdatesInput + nextToken *string + firstPage bool + done bool +} + +// NewListUpdatesPaginator returns a new ListUpdatesPaginator +func NewListUpdatesPaginator(client ListUpdatesAPIClient, params *ListUpdatesInput, optFns ...func(*ListUpdatesPaginatorOptions)) *ListUpdatesPaginator { + options := ListUpdatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListUpdatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListUpdatesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListUpdates page. +func (p *ListUpdatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListUpdatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListUpdates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/elasticache/go.sum b/service/elasticache/go.sum index c669e324b14..32595049f96 100644 --- a/service/elasticache/go.sum +++ b/service/elasticache/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/elasticache/paginators.go b/service/elasticache/paginators.go new file mode 100644 index 00000000000..386af038ab9 --- /dev/null +++ b/service/elasticache/paginators.go @@ -0,0 +1,1350 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticache + +import ( + "context" + "fmt" +) + +// DescribeCacheParametersAPIClient is a client that implements the +// DescribeCacheParameters operation. +type DescribeCacheParametersAPIClient interface { + DescribeCacheParameters(context.Context, *DescribeCacheParametersInput, ...func(*Options)) (*DescribeCacheParametersOutput, error) +} + +var _ DescribeCacheParametersAPIClient = (*Client)(nil) + +// DescribeCacheParametersPaginatorOptions is the paginator options for +// DescribeCacheParameters +type DescribeCacheParametersPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a marker is included in the response so + // that the remaining results can be retrieved. Default: 100 Constraints: minimum + // 20; maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeCacheParametersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticache.DescribeCacheParameters +type DescribeCacheParametersPaginator struct { + options DescribeCacheParametersPaginatorOptions + client DescribeCacheParametersAPIClient + params *DescribeCacheParametersInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeCacheParametersPaginator returns a new +// DescribeCacheParametersPaginator +func NewDescribeCacheParametersPaginator(client DescribeCacheParametersAPIClient, params *DescribeCacheParametersInput, optFns ...func(*DescribeCacheParametersPaginatorOptions)) *DescribeCacheParametersPaginator { + options := DescribeCacheParametersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeCacheParametersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeCacheParametersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeCacheParameters page. +func (p *DescribeCacheParametersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCacheParametersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeCacheParameters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeCacheParameterGroupsAPIClient is a client that implements the +// DescribeCacheParameterGroups operation. +type DescribeCacheParameterGroupsAPIClient interface { + DescribeCacheParameterGroups(context.Context, *DescribeCacheParameterGroupsInput, ...func(*Options)) (*DescribeCacheParameterGroupsOutput, error) +} + +var _ DescribeCacheParameterGroupsAPIClient = (*Client)(nil) + +// DescribeCacheParameterGroupsPaginatorOptions is the paginator options for +// DescribeCacheParameterGroups +type DescribeCacheParameterGroupsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a marker is included in the response so + // that the remaining results can be retrieved. Default: 100 Constraints: minimum + // 20; maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeCacheParameterGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticache.DescribeCacheParameterGroups +type DescribeCacheParameterGroupsPaginator struct { + options DescribeCacheParameterGroupsPaginatorOptions + client DescribeCacheParameterGroupsAPIClient + params *DescribeCacheParameterGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeCacheParameterGroupsPaginator returns a new +// DescribeCacheParameterGroupsPaginator +func NewDescribeCacheParameterGroupsPaginator(client DescribeCacheParameterGroupsAPIClient, params *DescribeCacheParameterGroupsInput, optFns ...func(*DescribeCacheParameterGroupsPaginatorOptions)) *DescribeCacheParameterGroupsPaginator { + options := DescribeCacheParameterGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeCacheParameterGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeCacheParameterGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeCacheParameterGroups page. +func (p *DescribeCacheParameterGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCacheParameterGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeCacheParameterGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeUsersAPIClient is a client that implements the DescribeUsers operation. +type DescribeUsersAPIClient interface { + DescribeUsers(context.Context, *DescribeUsersInput, ...func(*Options)) (*DescribeUsersOutput, error) +} + +var _ DescribeUsersAPIClient = (*Client)(nil) + +// DescribeUsersPaginatorOptions is the paginator options for DescribeUsers +type DescribeUsersPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a marker is included in the response so + // that the remaining results can be retrieved. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeUsersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticache.DescribeUsers +type DescribeUsersPaginator struct { + options DescribeUsersPaginatorOptions + client DescribeUsersAPIClient + params *DescribeUsersInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeUsersPaginator returns a new DescribeUsersPaginator +func NewDescribeUsersPaginator(client DescribeUsersAPIClient, params *DescribeUsersInput, optFns ...func(*DescribeUsersPaginatorOptions)) *DescribeUsersPaginator { + options := DescribeUsersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeUsersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeUsersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeUsers page. +func (p *DescribeUsersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeUsersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeUsers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeCacheSubnetGroupsAPIClient is a client that implements the +// DescribeCacheSubnetGroups operation. +type DescribeCacheSubnetGroupsAPIClient interface { + DescribeCacheSubnetGroups(context.Context, *DescribeCacheSubnetGroupsInput, ...func(*Options)) (*DescribeCacheSubnetGroupsOutput, error) +} + +var _ DescribeCacheSubnetGroupsAPIClient = (*Client)(nil) + +// DescribeCacheSubnetGroupsPaginatorOptions is the paginator options for +// DescribeCacheSubnetGroups +type DescribeCacheSubnetGroupsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a marker is included in the response so + // that the remaining results can be retrieved. Default: 100 Constraints: minimum + // 20; maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeCacheSubnetGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticache.DescribeCacheSubnetGroups +type DescribeCacheSubnetGroupsPaginator struct { + options DescribeCacheSubnetGroupsPaginatorOptions + client DescribeCacheSubnetGroupsAPIClient + params *DescribeCacheSubnetGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeCacheSubnetGroupsPaginator returns a new +// DescribeCacheSubnetGroupsPaginator +func NewDescribeCacheSubnetGroupsPaginator(client DescribeCacheSubnetGroupsAPIClient, params *DescribeCacheSubnetGroupsInput, optFns ...func(*DescribeCacheSubnetGroupsPaginatorOptions)) *DescribeCacheSubnetGroupsPaginator { + options := DescribeCacheSubnetGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeCacheSubnetGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeCacheSubnetGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeCacheSubnetGroups page. +func (p *DescribeCacheSubnetGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCacheSubnetGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeCacheSubnetGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeServiceUpdatesAPIClient is a client that implements the +// DescribeServiceUpdates operation. +type DescribeServiceUpdatesAPIClient interface { + DescribeServiceUpdates(context.Context, *DescribeServiceUpdatesInput, ...func(*Options)) (*DescribeServiceUpdatesOutput, error) +} + +var _ DescribeServiceUpdatesAPIClient = (*Client)(nil) + +// DescribeServiceUpdatesPaginatorOptions is the paginator options for +// DescribeServiceUpdates +type DescribeServiceUpdatesPaginatorOptions struct { + // The maximum number of records to include in the response + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeServiceUpdatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticache.DescribeServiceUpdates +type DescribeServiceUpdatesPaginator struct { + options DescribeServiceUpdatesPaginatorOptions + client DescribeServiceUpdatesAPIClient + params *DescribeServiceUpdatesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeServiceUpdatesPaginator returns a new DescribeServiceUpdatesPaginator +func NewDescribeServiceUpdatesPaginator(client DescribeServiceUpdatesAPIClient, params *DescribeServiceUpdatesInput, optFns ...func(*DescribeServiceUpdatesPaginatorOptions)) *DescribeServiceUpdatesPaginator { + options := DescribeServiceUpdatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeServiceUpdatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeServiceUpdatesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeServiceUpdates page. +func (p *DescribeServiceUpdatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeServiceUpdatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeServiceUpdates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeCacheClustersAPIClient is a client that implements the +// DescribeCacheClusters operation. +type DescribeCacheClustersAPIClient interface { + DescribeCacheClusters(context.Context, *DescribeCacheClustersInput, ...func(*Options)) (*DescribeCacheClustersOutput, error) +} + +var _ DescribeCacheClustersAPIClient = (*Client)(nil) + +// DescribeCacheClustersPaginatorOptions is the paginator options for +// DescribeCacheClusters +type DescribeCacheClustersPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a marker is included in the response so + // that the remaining results can be retrieved. Default: 100 Constraints: minimum + // 20; maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeCacheClustersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticache.DescribeCacheClusters +type DescribeCacheClustersPaginator struct { + options DescribeCacheClustersPaginatorOptions + client DescribeCacheClustersAPIClient + params *DescribeCacheClustersInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeCacheClustersPaginator returns a new DescribeCacheClustersPaginator +func NewDescribeCacheClustersPaginator(client DescribeCacheClustersAPIClient, params *DescribeCacheClustersInput, optFns ...func(*DescribeCacheClustersPaginatorOptions)) *DescribeCacheClustersPaginator { + options := DescribeCacheClustersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeCacheClustersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeCacheClustersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeCacheClusters page. +func (p *DescribeCacheClustersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCacheClustersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeCacheClusters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeSnapshotsAPIClient is a client that implements the DescribeSnapshots +// operation. +type DescribeSnapshotsAPIClient interface { + DescribeSnapshots(context.Context, *DescribeSnapshotsInput, ...func(*Options)) (*DescribeSnapshotsOutput, error) +} + +var _ DescribeSnapshotsAPIClient = (*Client)(nil) + +// DescribeSnapshotsPaginatorOptions is the paginator options for DescribeSnapshots +type DescribeSnapshotsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a marker is included in the response so + // that the remaining results can be retrieved. Default: 50 Constraints: minimum + // 20; maximum 50. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeSnapshotsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticache.DescribeSnapshots +type DescribeSnapshotsPaginator struct { + options DescribeSnapshotsPaginatorOptions + client DescribeSnapshotsAPIClient + params *DescribeSnapshotsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeSnapshotsPaginator returns a new DescribeSnapshotsPaginator +func NewDescribeSnapshotsPaginator(client DescribeSnapshotsAPIClient, params *DescribeSnapshotsInput, optFns ...func(*DescribeSnapshotsPaginatorOptions)) *DescribeSnapshotsPaginator { + options := DescribeSnapshotsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeSnapshotsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeSnapshotsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeSnapshots page. +func (p *DescribeSnapshotsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeSnapshotsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeSnapshots(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeReplicationGroupsAPIClient is a client that implements the +// DescribeReplicationGroups operation. +type DescribeReplicationGroupsAPIClient interface { + DescribeReplicationGroups(context.Context, *DescribeReplicationGroupsInput, ...func(*Options)) (*DescribeReplicationGroupsOutput, error) +} + +var _ DescribeReplicationGroupsAPIClient = (*Client)(nil) + +// DescribeReplicationGroupsPaginatorOptions is the paginator options for +// DescribeReplicationGroups +type DescribeReplicationGroupsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a marker is included in the response so + // that the remaining results can be retrieved. Default: 100 Constraints: minimum + // 20; maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeReplicationGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticache.DescribeReplicationGroups +type DescribeReplicationGroupsPaginator struct { + options DescribeReplicationGroupsPaginatorOptions + client DescribeReplicationGroupsAPIClient + params *DescribeReplicationGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeReplicationGroupsPaginator returns a new +// DescribeReplicationGroupsPaginator +func NewDescribeReplicationGroupsPaginator(client DescribeReplicationGroupsAPIClient, params *DescribeReplicationGroupsInput, optFns ...func(*DescribeReplicationGroupsPaginatorOptions)) *DescribeReplicationGroupsPaginator { + options := DescribeReplicationGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeReplicationGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeReplicationGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeReplicationGroups page. +func (p *DescribeReplicationGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeReplicationGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeReplicationGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeEngineDefaultParametersAPIClient is a client that implements the +// DescribeEngineDefaultParameters operation. +type DescribeEngineDefaultParametersAPIClient interface { + DescribeEngineDefaultParameters(context.Context, *DescribeEngineDefaultParametersInput, ...func(*Options)) (*DescribeEngineDefaultParametersOutput, error) +} + +var _ DescribeEngineDefaultParametersAPIClient = (*Client)(nil) + +// DescribeEngineDefaultParametersPaginatorOptions is the paginator options for +// DescribeEngineDefaultParameters +type DescribeEngineDefaultParametersPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a marker is included in the response so + // that the remaining results can be retrieved. Default: 100 Constraints: minimum + // 20; maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeEngineDefaultParametersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticache.DescribeEngineDefaultParameters +type DescribeEngineDefaultParametersPaginator struct { + options DescribeEngineDefaultParametersPaginatorOptions + client DescribeEngineDefaultParametersAPIClient + params *DescribeEngineDefaultParametersInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeEngineDefaultParametersPaginator returns a new +// DescribeEngineDefaultParametersPaginator +func NewDescribeEngineDefaultParametersPaginator(client DescribeEngineDefaultParametersAPIClient, params *DescribeEngineDefaultParametersInput, optFns ...func(*DescribeEngineDefaultParametersPaginatorOptions)) *DescribeEngineDefaultParametersPaginator { + options := DescribeEngineDefaultParametersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeEngineDefaultParametersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEngineDefaultParametersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeEngineDefaultParameters page. +func (p *DescribeEngineDefaultParametersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEngineDefaultParametersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeEngineDefaultParameters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + if result.EngineDefaults != nil { + p.nextToken = result.EngineDefaults.Marker + } + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeReservedCacheNodesAPIClient is a client that implements the +// DescribeReservedCacheNodes operation. +type DescribeReservedCacheNodesAPIClient interface { + DescribeReservedCacheNodes(context.Context, *DescribeReservedCacheNodesInput, ...func(*Options)) (*DescribeReservedCacheNodesOutput, error) +} + +var _ DescribeReservedCacheNodesAPIClient = (*Client)(nil) + +// DescribeReservedCacheNodesPaginatorOptions is the paginator options for +// DescribeReservedCacheNodes +type DescribeReservedCacheNodesPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a marker is included in the response so + // that the remaining results can be retrieved. Default: 100 Constraints: minimum + // 20; maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeReservedCacheNodesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticache.DescribeReservedCacheNodes +type DescribeReservedCacheNodesPaginator struct { + options DescribeReservedCacheNodesPaginatorOptions + client DescribeReservedCacheNodesAPIClient + params *DescribeReservedCacheNodesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeReservedCacheNodesPaginator returns a new +// DescribeReservedCacheNodesPaginator +func NewDescribeReservedCacheNodesPaginator(client DescribeReservedCacheNodesAPIClient, params *DescribeReservedCacheNodesInput, optFns ...func(*DescribeReservedCacheNodesPaginatorOptions)) *DescribeReservedCacheNodesPaginator { + options := DescribeReservedCacheNodesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeReservedCacheNodesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeReservedCacheNodesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeReservedCacheNodes page. +func (p *DescribeReservedCacheNodesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeReservedCacheNodesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeReservedCacheNodes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeUpdateActionsAPIClient is a client that implements the +// DescribeUpdateActions operation. +type DescribeUpdateActionsAPIClient interface { + DescribeUpdateActions(context.Context, *DescribeUpdateActionsInput, ...func(*Options)) (*DescribeUpdateActionsOutput, error) +} + +var _ DescribeUpdateActionsAPIClient = (*Client)(nil) + +// DescribeUpdateActionsPaginatorOptions is the paginator options for +// DescribeUpdateActions +type DescribeUpdateActionsPaginatorOptions struct { + // The maximum number of records to include in the response + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeUpdateActionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticache.DescribeUpdateActions +type DescribeUpdateActionsPaginator struct { + options DescribeUpdateActionsPaginatorOptions + client DescribeUpdateActionsAPIClient + params *DescribeUpdateActionsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeUpdateActionsPaginator returns a new DescribeUpdateActionsPaginator +func NewDescribeUpdateActionsPaginator(client DescribeUpdateActionsAPIClient, params *DescribeUpdateActionsInput, optFns ...func(*DescribeUpdateActionsPaginatorOptions)) *DescribeUpdateActionsPaginator { + options := DescribeUpdateActionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeUpdateActionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeUpdateActionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeUpdateActions page. +func (p *DescribeUpdateActionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeUpdateActionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeUpdateActions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeReservedCacheNodesOfferingsAPIClient is a client that implements the +// DescribeReservedCacheNodesOfferings operation. +type DescribeReservedCacheNodesOfferingsAPIClient interface { + DescribeReservedCacheNodesOfferings(context.Context, *DescribeReservedCacheNodesOfferingsInput, ...func(*Options)) (*DescribeReservedCacheNodesOfferingsOutput, error) +} + +var _ DescribeReservedCacheNodesOfferingsAPIClient = (*Client)(nil) + +// DescribeReservedCacheNodesOfferingsPaginatorOptions is the paginator options for +// DescribeReservedCacheNodesOfferings +type DescribeReservedCacheNodesOfferingsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a marker is included in the response so + // that the remaining results can be retrieved. Default: 100 Constraints: minimum + // 20; maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeReservedCacheNodesOfferingsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticache.DescribeReservedCacheNodesOfferings +type DescribeReservedCacheNodesOfferingsPaginator struct { + options DescribeReservedCacheNodesOfferingsPaginatorOptions + client DescribeReservedCacheNodesOfferingsAPIClient + params *DescribeReservedCacheNodesOfferingsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeReservedCacheNodesOfferingsPaginator returns a new +// DescribeReservedCacheNodesOfferingsPaginator +func NewDescribeReservedCacheNodesOfferingsPaginator(client DescribeReservedCacheNodesOfferingsAPIClient, params *DescribeReservedCacheNodesOfferingsInput, optFns ...func(*DescribeReservedCacheNodesOfferingsPaginatorOptions)) *DescribeReservedCacheNodesOfferingsPaginator { + options := DescribeReservedCacheNodesOfferingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeReservedCacheNodesOfferingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeReservedCacheNodesOfferingsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeReservedCacheNodesOfferings page. +func (p *DescribeReservedCacheNodesOfferingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeReservedCacheNodesOfferingsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeReservedCacheNodesOfferings(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeEventsAPIClient is a client that implements the DescribeEvents +// operation. +type DescribeEventsAPIClient interface { + DescribeEvents(context.Context, *DescribeEventsInput, ...func(*Options)) (*DescribeEventsOutput, error) +} + +var _ DescribeEventsAPIClient = (*Client)(nil) + +// DescribeEventsPaginatorOptions is the paginator options for DescribeEvents +type DescribeEventsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a marker is included in the response so + // that the remaining results can be retrieved. Default: 100 Constraints: minimum + // 20; maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeEventsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticache.DescribeEvents +type DescribeEventsPaginator struct { + options DescribeEventsPaginatorOptions + client DescribeEventsAPIClient + params *DescribeEventsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeEventsPaginator returns a new DescribeEventsPaginator +func NewDescribeEventsPaginator(client DescribeEventsAPIClient, params *DescribeEventsInput, optFns ...func(*DescribeEventsPaginatorOptions)) *DescribeEventsPaginator { + options := DescribeEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeEventsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEventsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeEvents page. +func (p *DescribeEventsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEventsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeEvents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeCacheSecurityGroupsAPIClient is a client that implements the +// DescribeCacheSecurityGroups operation. +type DescribeCacheSecurityGroupsAPIClient interface { + DescribeCacheSecurityGroups(context.Context, *DescribeCacheSecurityGroupsInput, ...func(*Options)) (*DescribeCacheSecurityGroupsOutput, error) +} + +var _ DescribeCacheSecurityGroupsAPIClient = (*Client)(nil) + +// DescribeCacheSecurityGroupsPaginatorOptions is the paginator options for +// DescribeCacheSecurityGroups +type DescribeCacheSecurityGroupsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a marker is included in the response so + // that the remaining results can be retrieved. Default: 100 Constraints: minimum + // 20; maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeCacheSecurityGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticache.DescribeCacheSecurityGroups +type DescribeCacheSecurityGroupsPaginator struct { + options DescribeCacheSecurityGroupsPaginatorOptions + client DescribeCacheSecurityGroupsAPIClient + params *DescribeCacheSecurityGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeCacheSecurityGroupsPaginator returns a new +// DescribeCacheSecurityGroupsPaginator +func NewDescribeCacheSecurityGroupsPaginator(client DescribeCacheSecurityGroupsAPIClient, params *DescribeCacheSecurityGroupsInput, optFns ...func(*DescribeCacheSecurityGroupsPaginatorOptions)) *DescribeCacheSecurityGroupsPaginator { + options := DescribeCacheSecurityGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeCacheSecurityGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeCacheSecurityGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeCacheSecurityGroups page. +func (p *DescribeCacheSecurityGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCacheSecurityGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeCacheSecurityGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeCacheEngineVersionsAPIClient is a client that implements the +// DescribeCacheEngineVersions operation. +type DescribeCacheEngineVersionsAPIClient interface { + DescribeCacheEngineVersions(context.Context, *DescribeCacheEngineVersionsInput, ...func(*Options)) (*DescribeCacheEngineVersionsOutput, error) +} + +var _ DescribeCacheEngineVersionsAPIClient = (*Client)(nil) + +// DescribeCacheEngineVersionsPaginatorOptions is the paginator options for +// DescribeCacheEngineVersions +type DescribeCacheEngineVersionsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a marker is included in the response so + // that the remaining results can be retrieved. Default: 100 Constraints: minimum + // 20; maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeCacheEngineVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticache.DescribeCacheEngineVersions +type DescribeCacheEngineVersionsPaginator struct { + options DescribeCacheEngineVersionsPaginatorOptions + client DescribeCacheEngineVersionsAPIClient + params *DescribeCacheEngineVersionsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeCacheEngineVersionsPaginator returns a new +// DescribeCacheEngineVersionsPaginator +func NewDescribeCacheEngineVersionsPaginator(client DescribeCacheEngineVersionsAPIClient, params *DescribeCacheEngineVersionsInput, optFns ...func(*DescribeCacheEngineVersionsPaginatorOptions)) *DescribeCacheEngineVersionsPaginator { + options := DescribeCacheEngineVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeCacheEngineVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeCacheEngineVersionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeCacheEngineVersions page. +func (p *DescribeCacheEngineVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCacheEngineVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeCacheEngineVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeUserGroupsAPIClient is a client that implements the DescribeUserGroups +// operation. +type DescribeUserGroupsAPIClient interface { + DescribeUserGroups(context.Context, *DescribeUserGroupsInput, ...func(*Options)) (*DescribeUserGroupsOutput, error) +} + +var _ DescribeUserGroupsAPIClient = (*Client)(nil) + +// DescribeUserGroupsPaginatorOptions is the paginator options for +// DescribeUserGroups +type DescribeUserGroupsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a marker is included in the response so + // that the remaining results can be retrieved. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeUserGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticache.DescribeUserGroups +type DescribeUserGroupsPaginator struct { + options DescribeUserGroupsPaginatorOptions + client DescribeUserGroupsAPIClient + params *DescribeUserGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeUserGroupsPaginator returns a new DescribeUserGroupsPaginator +func NewDescribeUserGroupsPaginator(client DescribeUserGroupsAPIClient, params *DescribeUserGroupsInput, optFns ...func(*DescribeUserGroupsPaginatorOptions)) *DescribeUserGroupsPaginator { + options := DescribeUserGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeUserGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeUserGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeUserGroups page. +func (p *DescribeUserGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeUserGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeUserGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeGlobalReplicationGroupsAPIClient is a client that implements the +// DescribeGlobalReplicationGroups operation. +type DescribeGlobalReplicationGroupsAPIClient interface { + DescribeGlobalReplicationGroups(context.Context, *DescribeGlobalReplicationGroupsInput, ...func(*Options)) (*DescribeGlobalReplicationGroupsOutput, error) +} + +var _ DescribeGlobalReplicationGroupsAPIClient = (*Client)(nil) + +// DescribeGlobalReplicationGroupsPaginatorOptions is the paginator options for +// DescribeGlobalReplicationGroups +type DescribeGlobalReplicationGroupsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a marker is included in the response so + // that the remaining results can be retrieved. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeGlobalReplicationGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticache.DescribeGlobalReplicationGroups +type DescribeGlobalReplicationGroupsPaginator struct { + options DescribeGlobalReplicationGroupsPaginatorOptions + client DescribeGlobalReplicationGroupsAPIClient + params *DescribeGlobalReplicationGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeGlobalReplicationGroupsPaginator returns a new +// DescribeGlobalReplicationGroupsPaginator +func NewDescribeGlobalReplicationGroupsPaginator(client DescribeGlobalReplicationGroupsAPIClient, params *DescribeGlobalReplicationGroupsInput, optFns ...func(*DescribeGlobalReplicationGroupsPaginatorOptions)) *DescribeGlobalReplicationGroupsPaginator { + options := DescribeGlobalReplicationGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeGlobalReplicationGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeGlobalReplicationGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeGlobalReplicationGroups page. +func (p *DescribeGlobalReplicationGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeGlobalReplicationGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeGlobalReplicationGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/elasticbeanstalk/go.sum b/service/elasticbeanstalk/go.sum index c669e324b14..32595049f96 100644 --- a/service/elasticbeanstalk/go.sum +++ b/service/elasticbeanstalk/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/elasticbeanstalk/paginators.go b/service/elasticbeanstalk/paginators.go new file mode 100644 index 00000000000..495de43c411 --- /dev/null +++ b/service/elasticbeanstalk/paginators.go @@ -0,0 +1,313 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticbeanstalk + +import ( + "context" + "fmt" +) + +// ListPlatformBranchesAPIClient is a client that implements the +// ListPlatformBranches operation. +type ListPlatformBranchesAPIClient interface { + ListPlatformBranches(context.Context, *ListPlatformBranchesInput, ...func(*Options)) (*ListPlatformBranchesOutput, error) +} + +var _ ListPlatformBranchesAPIClient = (*Client)(nil) + +// ListPlatformBranchesPaginatorOptions is the paginator options for +// ListPlatformBranches +type ListPlatformBranchesPaginatorOptions struct { + // The maximum number of platform branch values returned in one call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListPlatformBranchesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk.ListPlatformBranches +type ListPlatformBranchesPaginator struct { + options ListPlatformBranchesPaginatorOptions + client ListPlatformBranchesAPIClient + params *ListPlatformBranchesInput + nextToken *string + firstPage bool + done bool +} + +// NewListPlatformBranchesPaginator returns a new ListPlatformBranchesPaginator +func NewListPlatformBranchesPaginator(client ListPlatformBranchesAPIClient, params *ListPlatformBranchesInput, optFns ...func(*ListPlatformBranchesPaginatorOptions)) *ListPlatformBranchesPaginator { + options := ListPlatformBranchesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListPlatformBranchesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPlatformBranchesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListPlatformBranches page. +func (p *ListPlatformBranchesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPlatformBranchesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.ListPlatformBranches(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeEnvironmentManagedActionHistoryAPIClient is a client that implements the +// DescribeEnvironmentManagedActionHistory operation. +type DescribeEnvironmentManagedActionHistoryAPIClient interface { + DescribeEnvironmentManagedActionHistory(context.Context, *DescribeEnvironmentManagedActionHistoryInput, ...func(*Options)) (*DescribeEnvironmentManagedActionHistoryOutput, error) +} + +var _ DescribeEnvironmentManagedActionHistoryAPIClient = (*Client)(nil) + +// DescribeEnvironmentManagedActionHistoryPaginatorOptions is the paginator options +// for DescribeEnvironmentManagedActionHistory +type DescribeEnvironmentManagedActionHistoryPaginatorOptions struct { + // The maximum number of items to return for a single request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeEnvironmentManagedActionHistoryPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk.DescribeEnvironmentManagedActionHistory +type DescribeEnvironmentManagedActionHistoryPaginator struct { + options DescribeEnvironmentManagedActionHistoryPaginatorOptions + client DescribeEnvironmentManagedActionHistoryAPIClient + params *DescribeEnvironmentManagedActionHistoryInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeEnvironmentManagedActionHistoryPaginator returns a new +// DescribeEnvironmentManagedActionHistoryPaginator +func NewDescribeEnvironmentManagedActionHistoryPaginator(client DescribeEnvironmentManagedActionHistoryAPIClient, params *DescribeEnvironmentManagedActionHistoryInput, optFns ...func(*DescribeEnvironmentManagedActionHistoryPaginatorOptions)) *DescribeEnvironmentManagedActionHistoryPaginator { + options := DescribeEnvironmentManagedActionHistoryPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeEnvironmentManagedActionHistoryPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEnvironmentManagedActionHistoryPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeEnvironmentManagedActionHistory page. +func (p *DescribeEnvironmentManagedActionHistoryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEnvironmentManagedActionHistoryOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxItems = p.options.Limit + result, err := p.client.DescribeEnvironmentManagedActionHistory(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListPlatformVersionsAPIClient is a client that implements the +// ListPlatformVersions operation. +type ListPlatformVersionsAPIClient interface { + ListPlatformVersions(context.Context, *ListPlatformVersionsInput, ...func(*Options)) (*ListPlatformVersionsOutput, error) +} + +var _ ListPlatformVersionsAPIClient = (*Client)(nil) + +// ListPlatformVersionsPaginatorOptions is the paginator options for +// ListPlatformVersions +type ListPlatformVersionsPaginatorOptions struct { + // The maximum number of platform version values returned in one call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListPlatformVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk.ListPlatformVersions +type ListPlatformVersionsPaginator struct { + options ListPlatformVersionsPaginatorOptions + client ListPlatformVersionsAPIClient + params *ListPlatformVersionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListPlatformVersionsPaginator returns a new ListPlatformVersionsPaginator +func NewListPlatformVersionsPaginator(client ListPlatformVersionsAPIClient, params *ListPlatformVersionsInput, optFns ...func(*ListPlatformVersionsPaginatorOptions)) *ListPlatformVersionsPaginator { + options := ListPlatformVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListPlatformVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPlatformVersionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListPlatformVersions page. +func (p *ListPlatformVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPlatformVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.ListPlatformVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeEventsAPIClient is a client that implements the DescribeEvents +// operation. +type DescribeEventsAPIClient interface { + DescribeEvents(context.Context, *DescribeEventsInput, ...func(*Options)) (*DescribeEventsOutput, error) +} + +var _ DescribeEventsAPIClient = (*Client)(nil) + +// DescribeEventsPaginatorOptions is the paginator options for DescribeEvents +type DescribeEventsPaginatorOptions struct { + // Specifies the maximum number of events that can be returned, beginning with the + // most recent event. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeEventsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk.DescribeEvents +type DescribeEventsPaginator struct { + options DescribeEventsPaginatorOptions + client DescribeEventsAPIClient + params *DescribeEventsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeEventsPaginator returns a new DescribeEventsPaginator +func NewDescribeEventsPaginator(client DescribeEventsAPIClient, params *DescribeEventsInput, optFns ...func(*DescribeEventsPaginatorOptions)) *DescribeEventsPaginator { + options := DescribeEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeEventsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEventsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeEvents page. +func (p *DescribeEventsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEventsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeEvents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/elasticinference/go.sum b/service/elasticinference/go.sum index c669e324b14..32595049f96 100644 --- a/service/elasticinference/go.sum +++ b/service/elasticinference/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/elasticinference/paginators.go b/service/elasticinference/paginators.go new file mode 100644 index 00000000000..214c65727d6 --- /dev/null +++ b/service/elasticinference/paginators.go @@ -0,0 +1,88 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticinference + +import ( + "context" + "fmt" +) + +// DescribeAcceleratorsAPIClient is a client that implements the +// DescribeAccelerators operation. +type DescribeAcceleratorsAPIClient interface { + DescribeAccelerators(context.Context, *DescribeAcceleratorsInput, ...func(*Options)) (*DescribeAcceleratorsOutput, error) +} + +var _ DescribeAcceleratorsAPIClient = (*Client)(nil) + +// DescribeAcceleratorsPaginatorOptions is the paginator options for +// DescribeAccelerators +type DescribeAcceleratorsPaginatorOptions struct { + // The total number of items to return in the command's output. If the total number + // of items available is more than the value specified, a NextToken is provided in + // the command's output. To resume pagination, provide the NextToken value in the + // starting-token argument of a subsequent command. Do not use the NextToken + // response element directly outside of the AWS CLI. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeAcceleratorsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticinference.DescribeAccelerators +type DescribeAcceleratorsPaginator struct { + options DescribeAcceleratorsPaginatorOptions + client DescribeAcceleratorsAPIClient + params *DescribeAcceleratorsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeAcceleratorsPaginator returns a new DescribeAcceleratorsPaginator +func NewDescribeAcceleratorsPaginator(client DescribeAcceleratorsAPIClient, params *DescribeAcceleratorsInput, optFns ...func(*DescribeAcceleratorsPaginatorOptions)) *DescribeAcceleratorsPaginator { + options := DescribeAcceleratorsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeAcceleratorsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeAcceleratorsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeAccelerators page. +func (p *DescribeAcceleratorsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeAcceleratorsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeAccelerators(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/elasticloadbalancing/go.sum b/service/elasticloadbalancing/go.sum index c669e324b14..32595049f96 100644 --- a/service/elasticloadbalancing/go.sum +++ b/service/elasticloadbalancing/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/elasticloadbalancing/paginators.go b/service/elasticloadbalancing/paginators.go new file mode 100644 index 00000000000..e3cb5a53e70 --- /dev/null +++ b/service/elasticloadbalancing/paginators.go @@ -0,0 +1,80 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticloadbalancing + +import ( + "context" + "fmt" +) + +// DescribeLoadBalancersAPIClient is a client that implements the +// DescribeLoadBalancers operation. +type DescribeLoadBalancersAPIClient interface { + DescribeLoadBalancers(context.Context, *DescribeLoadBalancersInput, ...func(*Options)) (*DescribeLoadBalancersOutput, error) +} + +var _ DescribeLoadBalancersAPIClient = (*Client)(nil) + +// DescribeLoadBalancersPaginatorOptions is the paginator options for +// DescribeLoadBalancers +type DescribeLoadBalancersPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeLoadBalancersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing.DescribeLoadBalancers +type DescribeLoadBalancersPaginator struct { + options DescribeLoadBalancersPaginatorOptions + client DescribeLoadBalancersAPIClient + params *DescribeLoadBalancersInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeLoadBalancersPaginator returns a new DescribeLoadBalancersPaginator +func NewDescribeLoadBalancersPaginator(client DescribeLoadBalancersAPIClient, params *DescribeLoadBalancersInput, optFns ...func(*DescribeLoadBalancersPaginatorOptions)) *DescribeLoadBalancersPaginator { + options := DescribeLoadBalancersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeLoadBalancersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeLoadBalancersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeLoadBalancers page. +func (p *DescribeLoadBalancersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeLoadBalancersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + result, err := p.client.DescribeLoadBalancers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/elasticloadbalancingv2/go.sum b/service/elasticloadbalancingv2/go.sum index c669e324b14..32595049f96 100644 --- a/service/elasticloadbalancingv2/go.sum +++ b/service/elasticloadbalancingv2/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/elasticloadbalancingv2/paginators.go b/service/elasticloadbalancingv2/paginators.go new file mode 100644 index 00000000000..f5b27a57561 --- /dev/null +++ b/service/elasticloadbalancingv2/paginators.go @@ -0,0 +1,223 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticloadbalancingv2 + +import ( + "context" + "fmt" +) + +// DescribeLoadBalancersAPIClient is a client that implements the +// DescribeLoadBalancers operation. +type DescribeLoadBalancersAPIClient interface { + DescribeLoadBalancers(context.Context, *DescribeLoadBalancersInput, ...func(*Options)) (*DescribeLoadBalancersOutput, error) +} + +var _ DescribeLoadBalancersAPIClient = (*Client)(nil) + +// DescribeLoadBalancersPaginatorOptions is the paginator options for +// DescribeLoadBalancers +type DescribeLoadBalancersPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeLoadBalancersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2.DescribeLoadBalancers +type DescribeLoadBalancersPaginator struct { + options DescribeLoadBalancersPaginatorOptions + client DescribeLoadBalancersAPIClient + params *DescribeLoadBalancersInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeLoadBalancersPaginator returns a new DescribeLoadBalancersPaginator +func NewDescribeLoadBalancersPaginator(client DescribeLoadBalancersAPIClient, params *DescribeLoadBalancersInput, optFns ...func(*DescribeLoadBalancersPaginatorOptions)) *DescribeLoadBalancersPaginator { + options := DescribeLoadBalancersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeLoadBalancersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeLoadBalancersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeLoadBalancers page. +func (p *DescribeLoadBalancersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeLoadBalancersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + result, err := p.client.DescribeLoadBalancers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeListenersAPIClient is a client that implements the DescribeListeners +// operation. +type DescribeListenersAPIClient interface { + DescribeListeners(context.Context, *DescribeListenersInput, ...func(*Options)) (*DescribeListenersOutput, error) +} + +var _ DescribeListenersAPIClient = (*Client)(nil) + +// DescribeListenersPaginatorOptions is the paginator options for DescribeListeners +type DescribeListenersPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeListenersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2.DescribeListeners +type DescribeListenersPaginator struct { + options DescribeListenersPaginatorOptions + client DescribeListenersAPIClient + params *DescribeListenersInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeListenersPaginator returns a new DescribeListenersPaginator +func NewDescribeListenersPaginator(client DescribeListenersAPIClient, params *DescribeListenersInput, optFns ...func(*DescribeListenersPaginatorOptions)) *DescribeListenersPaginator { + options := DescribeListenersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeListenersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeListenersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeListeners page. +func (p *DescribeListenersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeListenersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + result, err := p.client.DescribeListeners(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeTargetGroupsAPIClient is a client that implements the +// DescribeTargetGroups operation. +type DescribeTargetGroupsAPIClient interface { + DescribeTargetGroups(context.Context, *DescribeTargetGroupsInput, ...func(*Options)) (*DescribeTargetGroupsOutput, error) +} + +var _ DescribeTargetGroupsAPIClient = (*Client)(nil) + +// DescribeTargetGroupsPaginatorOptions is the paginator options for +// DescribeTargetGroups +type DescribeTargetGroupsPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeTargetGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2.DescribeTargetGroups +type DescribeTargetGroupsPaginator struct { + options DescribeTargetGroupsPaginatorOptions + client DescribeTargetGroupsAPIClient + params *DescribeTargetGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeTargetGroupsPaginator returns a new DescribeTargetGroupsPaginator +func NewDescribeTargetGroupsPaginator(client DescribeTargetGroupsAPIClient, params *DescribeTargetGroupsInput, optFns ...func(*DescribeTargetGroupsPaginatorOptions)) *DescribeTargetGroupsPaginator { + options := DescribeTargetGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeTargetGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeTargetGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeTargetGroups page. +func (p *DescribeTargetGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTargetGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + result, err := p.client.DescribeTargetGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/elasticsearchservice/go.sum b/service/elasticsearchservice/go.sum index c669e324b14..32595049f96 100644 --- a/service/elasticsearchservice/go.sum +++ b/service/elasticsearchservice/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/elasticsearchservice/paginators.go b/service/elasticsearchservice/paginators.go new file mode 100644 index 00000000000..8b3d3fc8dce --- /dev/null +++ b/service/elasticsearchservice/paginators.go @@ -0,0 +1,778 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticsearchservice + +import ( + "context" + "fmt" +) + +// GetUpgradeHistoryAPIClient is a client that implements the GetUpgradeHistory +// operation. +type GetUpgradeHistoryAPIClient interface { + GetUpgradeHistory(context.Context, *GetUpgradeHistoryInput, ...func(*Options)) (*GetUpgradeHistoryOutput, error) +} + +var _ GetUpgradeHistoryAPIClient = (*Client)(nil) + +// GetUpgradeHistoryPaginatorOptions is the paginator options for GetUpgradeHistory +type GetUpgradeHistoryPaginatorOptions struct { + // Set this value to limit the number of results returned. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetUpgradeHistoryPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticsearchservice.GetUpgradeHistory +type GetUpgradeHistoryPaginator struct { + options GetUpgradeHistoryPaginatorOptions + client GetUpgradeHistoryAPIClient + params *GetUpgradeHistoryInput + nextToken *string + firstPage bool + done bool +} + +// NewGetUpgradeHistoryPaginator returns a new GetUpgradeHistoryPaginator +func NewGetUpgradeHistoryPaginator(client GetUpgradeHistoryAPIClient, params *GetUpgradeHistoryInput, optFns ...func(*GetUpgradeHistoryPaginatorOptions)) *GetUpgradeHistoryPaginator { + options := GetUpgradeHistoryPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetUpgradeHistoryPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetUpgradeHistoryPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetUpgradeHistory page. +func (p *GetUpgradeHistoryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetUpgradeHistoryOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetUpgradeHistory(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListElasticsearchVersionsAPIClient is a client that implements the +// ListElasticsearchVersions operation. +type ListElasticsearchVersionsAPIClient interface { + ListElasticsearchVersions(context.Context, *ListElasticsearchVersionsInput, ...func(*Options)) (*ListElasticsearchVersionsOutput, error) +} + +var _ ListElasticsearchVersionsAPIClient = (*Client)(nil) + +// ListElasticsearchVersionsPaginatorOptions is the paginator options for +// ListElasticsearchVersions +type ListElasticsearchVersionsPaginatorOptions struct { + // Set this value to limit the number of results returned. Value provided must be + // greater than 10 else it wont be honored. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListElasticsearchVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticsearchservice.ListElasticsearchVersions +type ListElasticsearchVersionsPaginator struct { + options ListElasticsearchVersionsPaginatorOptions + client ListElasticsearchVersionsAPIClient + params *ListElasticsearchVersionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListElasticsearchVersionsPaginator returns a new +// ListElasticsearchVersionsPaginator +func NewListElasticsearchVersionsPaginator(client ListElasticsearchVersionsAPIClient, params *ListElasticsearchVersionsInput, optFns ...func(*ListElasticsearchVersionsPaginatorOptions)) *ListElasticsearchVersionsPaginator { + options := ListElasticsearchVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListElasticsearchVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListElasticsearchVersionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListElasticsearchVersions page. +func (p *ListElasticsearchVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListElasticsearchVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListElasticsearchVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribePackagesAPIClient is a client that implements the DescribePackages +// operation. +type DescribePackagesAPIClient interface { + DescribePackages(context.Context, *DescribePackagesInput, ...func(*Options)) (*DescribePackagesOutput, error) +} + +var _ DescribePackagesAPIClient = (*Client)(nil) + +// DescribePackagesPaginatorOptions is the paginator options for DescribePackages +type DescribePackagesPaginatorOptions struct { + // Limits results to a maximum number of packages. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribePackagesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticsearchservice.DescribePackages +type DescribePackagesPaginator struct { + options DescribePackagesPaginatorOptions + client DescribePackagesAPIClient + params *DescribePackagesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribePackagesPaginator returns a new DescribePackagesPaginator +func NewDescribePackagesPaginator(client DescribePackagesAPIClient, params *DescribePackagesInput, optFns ...func(*DescribePackagesPaginatorOptions)) *DescribePackagesPaginator { + options := DescribePackagesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribePackagesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribePackagesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribePackages page. +func (p *DescribePackagesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribePackagesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribePackages(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeOutboundCrossClusterSearchConnectionsAPIClient is a client that +// implements the DescribeOutboundCrossClusterSearchConnections operation. +type DescribeOutboundCrossClusterSearchConnectionsAPIClient interface { + DescribeOutboundCrossClusterSearchConnections(context.Context, *DescribeOutboundCrossClusterSearchConnectionsInput, ...func(*Options)) (*DescribeOutboundCrossClusterSearchConnectionsOutput, error) +} + +var _ DescribeOutboundCrossClusterSearchConnectionsAPIClient = (*Client)(nil) + +// DescribeOutboundCrossClusterSearchConnectionsPaginatorOptions is the paginator +// options for DescribeOutboundCrossClusterSearchConnections +type DescribeOutboundCrossClusterSearchConnectionsPaginatorOptions struct { + // Set this value to limit the number of results returned. If not specified, + // defaults to 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeOutboundCrossClusterSearchConnectionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticsearchservice.DescribeOutboundCrossClusterSearchConnections +type DescribeOutboundCrossClusterSearchConnectionsPaginator struct { + options DescribeOutboundCrossClusterSearchConnectionsPaginatorOptions + client DescribeOutboundCrossClusterSearchConnectionsAPIClient + params *DescribeOutboundCrossClusterSearchConnectionsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeOutboundCrossClusterSearchConnectionsPaginator returns a new +// DescribeOutboundCrossClusterSearchConnectionsPaginator +func NewDescribeOutboundCrossClusterSearchConnectionsPaginator(client DescribeOutboundCrossClusterSearchConnectionsAPIClient, params *DescribeOutboundCrossClusterSearchConnectionsInput, optFns ...func(*DescribeOutboundCrossClusterSearchConnectionsPaginatorOptions)) *DescribeOutboundCrossClusterSearchConnectionsPaginator { + options := DescribeOutboundCrossClusterSearchConnectionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeOutboundCrossClusterSearchConnectionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeOutboundCrossClusterSearchConnectionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeOutboundCrossClusterSearchConnections page. +func (p *DescribeOutboundCrossClusterSearchConnectionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeOutboundCrossClusterSearchConnectionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeOutboundCrossClusterSearchConnections(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeInboundCrossClusterSearchConnectionsAPIClient is a client that +// implements the DescribeInboundCrossClusterSearchConnections operation. +type DescribeInboundCrossClusterSearchConnectionsAPIClient interface { + DescribeInboundCrossClusterSearchConnections(context.Context, *DescribeInboundCrossClusterSearchConnectionsInput, ...func(*Options)) (*DescribeInboundCrossClusterSearchConnectionsOutput, error) +} + +var _ DescribeInboundCrossClusterSearchConnectionsAPIClient = (*Client)(nil) + +// DescribeInboundCrossClusterSearchConnectionsPaginatorOptions is the paginator +// options for DescribeInboundCrossClusterSearchConnections +type DescribeInboundCrossClusterSearchConnectionsPaginatorOptions struct { + // Set this value to limit the number of results returned. If not specified, + // defaults to 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeInboundCrossClusterSearchConnectionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticsearchservice.DescribeInboundCrossClusterSearchConnections +type DescribeInboundCrossClusterSearchConnectionsPaginator struct { + options DescribeInboundCrossClusterSearchConnectionsPaginatorOptions + client DescribeInboundCrossClusterSearchConnectionsAPIClient + params *DescribeInboundCrossClusterSearchConnectionsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeInboundCrossClusterSearchConnectionsPaginator returns a new +// DescribeInboundCrossClusterSearchConnectionsPaginator +func NewDescribeInboundCrossClusterSearchConnectionsPaginator(client DescribeInboundCrossClusterSearchConnectionsAPIClient, params *DescribeInboundCrossClusterSearchConnectionsInput, optFns ...func(*DescribeInboundCrossClusterSearchConnectionsPaginatorOptions)) *DescribeInboundCrossClusterSearchConnectionsPaginator { + options := DescribeInboundCrossClusterSearchConnectionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeInboundCrossClusterSearchConnectionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeInboundCrossClusterSearchConnectionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeInboundCrossClusterSearchConnections page. +func (p *DescribeInboundCrossClusterSearchConnectionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInboundCrossClusterSearchConnectionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeInboundCrossClusterSearchConnections(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDomainsForPackageAPIClient is a client that implements the +// ListDomainsForPackage operation. +type ListDomainsForPackageAPIClient interface { + ListDomainsForPackage(context.Context, *ListDomainsForPackageInput, ...func(*Options)) (*ListDomainsForPackageOutput, error) +} + +var _ ListDomainsForPackageAPIClient = (*Client)(nil) + +// ListDomainsForPackagePaginatorOptions is the paginator options for +// ListDomainsForPackage +type ListDomainsForPackagePaginatorOptions struct { + // Limits results to a maximum number of domains. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDomainsForPackagePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticsearchservice.ListDomainsForPackage +type ListDomainsForPackagePaginator struct { + options ListDomainsForPackagePaginatorOptions + client ListDomainsForPackageAPIClient + params *ListDomainsForPackageInput + nextToken *string + firstPage bool + done bool +} + +// NewListDomainsForPackagePaginator returns a new ListDomainsForPackagePaginator +func NewListDomainsForPackagePaginator(client ListDomainsForPackageAPIClient, params *ListDomainsForPackageInput, optFns ...func(*ListDomainsForPackagePaginatorOptions)) *ListDomainsForPackagePaginator { + options := ListDomainsForPackagePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDomainsForPackagePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDomainsForPackagePaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDomainsForPackage page. +func (p *ListDomainsForPackagePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDomainsForPackageOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListDomainsForPackage(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListPackagesForDomainAPIClient is a client that implements the +// ListPackagesForDomain operation. +type ListPackagesForDomainAPIClient interface { + ListPackagesForDomain(context.Context, *ListPackagesForDomainInput, ...func(*Options)) (*ListPackagesForDomainOutput, error) +} + +var _ ListPackagesForDomainAPIClient = (*Client)(nil) + +// ListPackagesForDomainPaginatorOptions is the paginator options for +// ListPackagesForDomain +type ListPackagesForDomainPaginatorOptions struct { + // Limits results to a maximum number of packages. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListPackagesForDomainPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticsearchservice.ListPackagesForDomain +type ListPackagesForDomainPaginator struct { + options ListPackagesForDomainPaginatorOptions + client ListPackagesForDomainAPIClient + params *ListPackagesForDomainInput + nextToken *string + firstPage bool + done bool +} + +// NewListPackagesForDomainPaginator returns a new ListPackagesForDomainPaginator +func NewListPackagesForDomainPaginator(client ListPackagesForDomainAPIClient, params *ListPackagesForDomainInput, optFns ...func(*ListPackagesForDomainPaginatorOptions)) *ListPackagesForDomainPaginator { + options := ListPackagesForDomainPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListPackagesForDomainPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPackagesForDomainPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListPackagesForDomain page. +func (p *ListPackagesForDomainPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPackagesForDomainOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListPackagesForDomain(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeReservedElasticsearchInstancesAPIClient is a client that implements the +// DescribeReservedElasticsearchInstances operation. +type DescribeReservedElasticsearchInstancesAPIClient interface { + DescribeReservedElasticsearchInstances(context.Context, *DescribeReservedElasticsearchInstancesInput, ...func(*Options)) (*DescribeReservedElasticsearchInstancesOutput, error) +} + +var _ DescribeReservedElasticsearchInstancesAPIClient = (*Client)(nil) + +// DescribeReservedElasticsearchInstancesPaginatorOptions is the paginator options +// for DescribeReservedElasticsearchInstances +type DescribeReservedElasticsearchInstancesPaginatorOptions struct { + // Set this value to limit the number of results returned. If not specified, + // defaults to 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeReservedElasticsearchInstancesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticsearchservice.DescribeReservedElasticsearchInstances +type DescribeReservedElasticsearchInstancesPaginator struct { + options DescribeReservedElasticsearchInstancesPaginatorOptions + client DescribeReservedElasticsearchInstancesAPIClient + params *DescribeReservedElasticsearchInstancesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeReservedElasticsearchInstancesPaginator returns a new +// DescribeReservedElasticsearchInstancesPaginator +func NewDescribeReservedElasticsearchInstancesPaginator(client DescribeReservedElasticsearchInstancesAPIClient, params *DescribeReservedElasticsearchInstancesInput, optFns ...func(*DescribeReservedElasticsearchInstancesPaginatorOptions)) *DescribeReservedElasticsearchInstancesPaginator { + options := DescribeReservedElasticsearchInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeReservedElasticsearchInstancesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeReservedElasticsearchInstancesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeReservedElasticsearchInstances page. +func (p *DescribeReservedElasticsearchInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeReservedElasticsearchInstancesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeReservedElasticsearchInstances(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeReservedElasticsearchInstanceOfferingsAPIClient is a client that +// implements the DescribeReservedElasticsearchInstanceOfferings operation. +type DescribeReservedElasticsearchInstanceOfferingsAPIClient interface { + DescribeReservedElasticsearchInstanceOfferings(context.Context, *DescribeReservedElasticsearchInstanceOfferingsInput, ...func(*Options)) (*DescribeReservedElasticsearchInstanceOfferingsOutput, error) +} + +var _ DescribeReservedElasticsearchInstanceOfferingsAPIClient = (*Client)(nil) + +// DescribeReservedElasticsearchInstanceOfferingsPaginatorOptions is the paginator +// options for DescribeReservedElasticsearchInstanceOfferings +type DescribeReservedElasticsearchInstanceOfferingsPaginatorOptions struct { + // Set this value to limit the number of results returned. If not specified, + // defaults to 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeReservedElasticsearchInstanceOfferingsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticsearchservice.DescribeReservedElasticsearchInstanceOfferings +type DescribeReservedElasticsearchInstanceOfferingsPaginator struct { + options DescribeReservedElasticsearchInstanceOfferingsPaginatorOptions + client DescribeReservedElasticsearchInstanceOfferingsAPIClient + params *DescribeReservedElasticsearchInstanceOfferingsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeReservedElasticsearchInstanceOfferingsPaginator returns a new +// DescribeReservedElasticsearchInstanceOfferingsPaginator +func NewDescribeReservedElasticsearchInstanceOfferingsPaginator(client DescribeReservedElasticsearchInstanceOfferingsAPIClient, params *DescribeReservedElasticsearchInstanceOfferingsInput, optFns ...func(*DescribeReservedElasticsearchInstanceOfferingsPaginatorOptions)) *DescribeReservedElasticsearchInstanceOfferingsPaginator { + options := DescribeReservedElasticsearchInstanceOfferingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeReservedElasticsearchInstanceOfferingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeReservedElasticsearchInstanceOfferingsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeReservedElasticsearchInstanceOfferings page. +func (p *DescribeReservedElasticsearchInstanceOfferingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeReservedElasticsearchInstanceOfferingsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeReservedElasticsearchInstanceOfferings(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListElasticsearchInstanceTypesAPIClient is a client that implements the +// ListElasticsearchInstanceTypes operation. +type ListElasticsearchInstanceTypesAPIClient interface { + ListElasticsearchInstanceTypes(context.Context, *ListElasticsearchInstanceTypesInput, ...func(*Options)) (*ListElasticsearchInstanceTypesOutput, error) +} + +var _ ListElasticsearchInstanceTypesAPIClient = (*Client)(nil) + +// ListElasticsearchInstanceTypesPaginatorOptions is the paginator options for +// ListElasticsearchInstanceTypes +type ListElasticsearchInstanceTypesPaginatorOptions struct { + // Set this value to limit the number of results returned. Value provided must be + // greater than 30 else it wont be honored. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListElasticsearchInstanceTypesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticsearchservice.ListElasticsearchInstanceTypes +type ListElasticsearchInstanceTypesPaginator struct { + options ListElasticsearchInstanceTypesPaginatorOptions + client ListElasticsearchInstanceTypesAPIClient + params *ListElasticsearchInstanceTypesInput + nextToken *string + firstPage bool + done bool +} + +// NewListElasticsearchInstanceTypesPaginator returns a new +// ListElasticsearchInstanceTypesPaginator +func NewListElasticsearchInstanceTypesPaginator(client ListElasticsearchInstanceTypesAPIClient, params *ListElasticsearchInstanceTypesInput, optFns ...func(*ListElasticsearchInstanceTypesPaginatorOptions)) *ListElasticsearchInstanceTypesPaginator { + options := ListElasticsearchInstanceTypesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListElasticsearchInstanceTypesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListElasticsearchInstanceTypesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListElasticsearchInstanceTypes page. +func (p *ListElasticsearchInstanceTypesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListElasticsearchInstanceTypesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListElasticsearchInstanceTypes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/elastictranscoder/go.sum b/service/elastictranscoder/go.sum index c669e324b14..32595049f96 100644 --- a/service/elastictranscoder/go.sum +++ b/service/elastictranscoder/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/elastictranscoder/paginators.go b/service/elastictranscoder/paginators.go new file mode 100644 index 00000000000..a04202cef22 --- /dev/null +++ b/service/elastictranscoder/paginators.go @@ -0,0 +1,291 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elastictranscoder + +import ( + "context" + "fmt" +) + +// ListJobsByPipelineAPIClient is a client that implements the ListJobsByPipeline +// operation. +type ListJobsByPipelineAPIClient interface { + ListJobsByPipeline(context.Context, *ListJobsByPipelineInput, ...func(*Options)) (*ListJobsByPipelineOutput, error) +} + +var _ ListJobsByPipelineAPIClient = (*Client)(nil) + +// ListJobsByPipelinePaginatorOptions is the paginator options for +// ListJobsByPipeline +type ListJobsByPipelinePaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListJobsByPipelinePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elastictranscoder.ListJobsByPipeline +type ListJobsByPipelinePaginator struct { + options ListJobsByPipelinePaginatorOptions + client ListJobsByPipelineAPIClient + params *ListJobsByPipelineInput + nextToken *string + firstPage bool + done bool +} + +// NewListJobsByPipelinePaginator returns a new ListJobsByPipelinePaginator +func NewListJobsByPipelinePaginator(client ListJobsByPipelineAPIClient, params *ListJobsByPipelineInput, optFns ...func(*ListJobsByPipelinePaginatorOptions)) *ListJobsByPipelinePaginator { + options := ListJobsByPipelinePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListJobsByPipelinePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListJobsByPipelinePaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListJobsByPipeline page. +func (p *ListJobsByPipelinePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListJobsByPipelineOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PageToken = p.nextToken + result, err := p.client.ListJobsByPipeline(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && params.PageToken != nil && p.nextToken != nil && *params.PageToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListJobsByStatusAPIClient is a client that implements the ListJobsByStatus +// operation. +type ListJobsByStatusAPIClient interface { + ListJobsByStatus(context.Context, *ListJobsByStatusInput, ...func(*Options)) (*ListJobsByStatusOutput, error) +} + +var _ ListJobsByStatusAPIClient = (*Client)(nil) + +// ListJobsByStatusPaginatorOptions is the paginator options for ListJobsByStatus +type ListJobsByStatusPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListJobsByStatusPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elastictranscoder.ListJobsByStatus +type ListJobsByStatusPaginator struct { + options ListJobsByStatusPaginatorOptions + client ListJobsByStatusAPIClient + params *ListJobsByStatusInput + nextToken *string + firstPage bool + done bool +} + +// NewListJobsByStatusPaginator returns a new ListJobsByStatusPaginator +func NewListJobsByStatusPaginator(client ListJobsByStatusAPIClient, params *ListJobsByStatusInput, optFns ...func(*ListJobsByStatusPaginatorOptions)) *ListJobsByStatusPaginator { + options := ListJobsByStatusPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListJobsByStatusPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListJobsByStatusPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListJobsByStatus page. +func (p *ListJobsByStatusPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListJobsByStatusOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PageToken = p.nextToken + result, err := p.client.ListJobsByStatus(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && params.PageToken != nil && p.nextToken != nil && *params.PageToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListPresetsAPIClient is a client that implements the ListPresets operation. +type ListPresetsAPIClient interface { + ListPresets(context.Context, *ListPresetsInput, ...func(*Options)) (*ListPresetsOutput, error) +} + +var _ ListPresetsAPIClient = (*Client)(nil) + +// ListPresetsPaginatorOptions is the paginator options for ListPresets +type ListPresetsPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListPresetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elastictranscoder.ListPresets +type ListPresetsPaginator struct { + options ListPresetsPaginatorOptions + client ListPresetsAPIClient + params *ListPresetsInput + nextToken *string + firstPage bool + done bool +} + +// NewListPresetsPaginator returns a new ListPresetsPaginator +func NewListPresetsPaginator(client ListPresetsAPIClient, params *ListPresetsInput, optFns ...func(*ListPresetsPaginatorOptions)) *ListPresetsPaginator { + options := ListPresetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListPresetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPresetsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListPresets page. +func (p *ListPresetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPresetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PageToken = p.nextToken + result, err := p.client.ListPresets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && params.PageToken != nil && p.nextToken != nil && *params.PageToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListPipelinesAPIClient is a client that implements the ListPipelines operation. +type ListPipelinesAPIClient interface { + ListPipelines(context.Context, *ListPipelinesInput, ...func(*Options)) (*ListPipelinesOutput, error) +} + +var _ ListPipelinesAPIClient = (*Client)(nil) + +// ListPipelinesPaginatorOptions is the paginator options for ListPipelines +type ListPipelinesPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListPipelinesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elastictranscoder.ListPipelines +type ListPipelinesPaginator struct { + options ListPipelinesPaginatorOptions + client ListPipelinesAPIClient + params *ListPipelinesInput + nextToken *string + firstPage bool + done bool +} + +// NewListPipelinesPaginator returns a new ListPipelinesPaginator +func NewListPipelinesPaginator(client ListPipelinesAPIClient, params *ListPipelinesInput, optFns ...func(*ListPipelinesPaginatorOptions)) *ListPipelinesPaginator { + options := ListPipelinesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListPipelinesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPipelinesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListPipelines page. +func (p *ListPipelinesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPipelinesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PageToken = p.nextToken + result, err := p.client.ListPipelines(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && params.PageToken != nil && p.nextToken != nil && *params.PageToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/emr/go.sum b/service/emr/go.sum index c669e324b14..32595049f96 100644 --- a/service/emr/go.sum +++ b/service/emr/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/emr/paginators.go b/service/emr/paginators.go new file mode 100644 index 00000000000..8cfcead4cea --- /dev/null +++ b/service/emr/paginators.go @@ -0,0 +1,579 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package emr + +import ( + "context" + "fmt" +) + +// ListInstancesAPIClient is a client that implements the ListInstances operation. +type ListInstancesAPIClient interface { + ListInstances(context.Context, *ListInstancesInput, ...func(*Options)) (*ListInstancesOutput, error) +} + +var _ ListInstancesAPIClient = (*Client)(nil) + +// ListInstancesPaginatorOptions is the paginator options for ListInstances +type ListInstancesPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListInstancesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/emr.ListInstances +type ListInstancesPaginator struct { + options ListInstancesPaginatorOptions + client ListInstancesAPIClient + params *ListInstancesInput + nextToken *string + firstPage bool + done bool +} + +// NewListInstancesPaginator returns a new ListInstancesPaginator +func NewListInstancesPaginator(client ListInstancesAPIClient, params *ListInstancesInput, optFns ...func(*ListInstancesPaginatorOptions)) *ListInstancesPaginator { + options := ListInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListInstancesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListInstancesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListInstances page. +func (p *ListInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListInstancesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + result, err := p.client.ListInstances(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListInstanceGroupsAPIClient is a client that implements the ListInstanceGroups +// operation. +type ListInstanceGroupsAPIClient interface { + ListInstanceGroups(context.Context, *ListInstanceGroupsInput, ...func(*Options)) (*ListInstanceGroupsOutput, error) +} + +var _ ListInstanceGroupsAPIClient = (*Client)(nil) + +// ListInstanceGroupsPaginatorOptions is the paginator options for +// ListInstanceGroups +type ListInstanceGroupsPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListInstanceGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/emr.ListInstanceGroups +type ListInstanceGroupsPaginator struct { + options ListInstanceGroupsPaginatorOptions + client ListInstanceGroupsAPIClient + params *ListInstanceGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewListInstanceGroupsPaginator returns a new ListInstanceGroupsPaginator +func NewListInstanceGroupsPaginator(client ListInstanceGroupsAPIClient, params *ListInstanceGroupsInput, optFns ...func(*ListInstanceGroupsPaginatorOptions)) *ListInstanceGroupsPaginator { + options := ListInstanceGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListInstanceGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListInstanceGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListInstanceGroups page. +func (p *ListInstanceGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListInstanceGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + result, err := p.client.ListInstanceGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListNotebookExecutionsAPIClient is a client that implements the +// ListNotebookExecutions operation. +type ListNotebookExecutionsAPIClient interface { + ListNotebookExecutions(context.Context, *ListNotebookExecutionsInput, ...func(*Options)) (*ListNotebookExecutionsOutput, error) +} + +var _ ListNotebookExecutionsAPIClient = (*Client)(nil) + +// ListNotebookExecutionsPaginatorOptions is the paginator options for +// ListNotebookExecutions +type ListNotebookExecutionsPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListNotebookExecutionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/emr.ListNotebookExecutions +type ListNotebookExecutionsPaginator struct { + options ListNotebookExecutionsPaginatorOptions + client ListNotebookExecutionsAPIClient + params *ListNotebookExecutionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListNotebookExecutionsPaginator returns a new ListNotebookExecutionsPaginator +func NewListNotebookExecutionsPaginator(client ListNotebookExecutionsAPIClient, params *ListNotebookExecutionsInput, optFns ...func(*ListNotebookExecutionsPaginatorOptions)) *ListNotebookExecutionsPaginator { + options := ListNotebookExecutionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListNotebookExecutionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListNotebookExecutionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListNotebookExecutions page. +func (p *ListNotebookExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListNotebookExecutionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + result, err := p.client.ListNotebookExecutions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListBootstrapActionsAPIClient is a client that implements the +// ListBootstrapActions operation. +type ListBootstrapActionsAPIClient interface { + ListBootstrapActions(context.Context, *ListBootstrapActionsInput, ...func(*Options)) (*ListBootstrapActionsOutput, error) +} + +var _ ListBootstrapActionsAPIClient = (*Client)(nil) + +// ListBootstrapActionsPaginatorOptions is the paginator options for +// ListBootstrapActions +type ListBootstrapActionsPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListBootstrapActionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/emr.ListBootstrapActions +type ListBootstrapActionsPaginator struct { + options ListBootstrapActionsPaginatorOptions + client ListBootstrapActionsAPIClient + params *ListBootstrapActionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListBootstrapActionsPaginator returns a new ListBootstrapActionsPaginator +func NewListBootstrapActionsPaginator(client ListBootstrapActionsAPIClient, params *ListBootstrapActionsInput, optFns ...func(*ListBootstrapActionsPaginatorOptions)) *ListBootstrapActionsPaginator { + options := ListBootstrapActionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListBootstrapActionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListBootstrapActionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListBootstrapActions page. +func (p *ListBootstrapActionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBootstrapActionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + result, err := p.client.ListBootstrapActions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListClustersAPIClient is a client that implements the ListClusters operation. +type ListClustersAPIClient interface { + ListClusters(context.Context, *ListClustersInput, ...func(*Options)) (*ListClustersOutput, error) +} + +var _ ListClustersAPIClient = (*Client)(nil) + +// ListClustersPaginatorOptions is the paginator options for ListClusters +type ListClustersPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListClustersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/emr.ListClusters +type ListClustersPaginator struct { + options ListClustersPaginatorOptions + client ListClustersAPIClient + params *ListClustersInput + nextToken *string + firstPage bool + done bool +} + +// NewListClustersPaginator returns a new ListClustersPaginator +func NewListClustersPaginator(client ListClustersAPIClient, params *ListClustersInput, optFns ...func(*ListClustersPaginatorOptions)) *ListClustersPaginator { + options := ListClustersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListClustersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListClustersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListClusters page. +func (p *ListClustersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListClustersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + result, err := p.client.ListClusters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListSecurityConfigurationsAPIClient is a client that implements the +// ListSecurityConfigurations operation. +type ListSecurityConfigurationsAPIClient interface { + ListSecurityConfigurations(context.Context, *ListSecurityConfigurationsInput, ...func(*Options)) (*ListSecurityConfigurationsOutput, error) +} + +var _ ListSecurityConfigurationsAPIClient = (*Client)(nil) + +// ListSecurityConfigurationsPaginatorOptions is the paginator options for +// ListSecurityConfigurations +type ListSecurityConfigurationsPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListSecurityConfigurationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/emr.ListSecurityConfigurations +type ListSecurityConfigurationsPaginator struct { + options ListSecurityConfigurationsPaginatorOptions + client ListSecurityConfigurationsAPIClient + params *ListSecurityConfigurationsInput + nextToken *string + firstPage bool + done bool +} + +// NewListSecurityConfigurationsPaginator returns a new +// ListSecurityConfigurationsPaginator +func NewListSecurityConfigurationsPaginator(client ListSecurityConfigurationsAPIClient, params *ListSecurityConfigurationsInput, optFns ...func(*ListSecurityConfigurationsPaginatorOptions)) *ListSecurityConfigurationsPaginator { + options := ListSecurityConfigurationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListSecurityConfigurationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSecurityConfigurationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListSecurityConfigurations page. +func (p *ListSecurityConfigurationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSecurityConfigurationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + result, err := p.client.ListSecurityConfigurations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListInstanceFleetsAPIClient is a client that implements the ListInstanceFleets +// operation. +type ListInstanceFleetsAPIClient interface { + ListInstanceFleets(context.Context, *ListInstanceFleetsInput, ...func(*Options)) (*ListInstanceFleetsOutput, error) +} + +var _ ListInstanceFleetsAPIClient = (*Client)(nil) + +// ListInstanceFleetsPaginatorOptions is the paginator options for +// ListInstanceFleets +type ListInstanceFleetsPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListInstanceFleetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/emr.ListInstanceFleets +type ListInstanceFleetsPaginator struct { + options ListInstanceFleetsPaginatorOptions + client ListInstanceFleetsAPIClient + params *ListInstanceFleetsInput + nextToken *string + firstPage bool + done bool +} + +// NewListInstanceFleetsPaginator returns a new ListInstanceFleetsPaginator +func NewListInstanceFleetsPaginator(client ListInstanceFleetsAPIClient, params *ListInstanceFleetsInput, optFns ...func(*ListInstanceFleetsPaginatorOptions)) *ListInstanceFleetsPaginator { + options := ListInstanceFleetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListInstanceFleetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListInstanceFleetsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListInstanceFleets page. +func (p *ListInstanceFleetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListInstanceFleetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + result, err := p.client.ListInstanceFleets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListStepsAPIClient is a client that implements the ListSteps operation. +type ListStepsAPIClient interface { + ListSteps(context.Context, *ListStepsInput, ...func(*Options)) (*ListStepsOutput, error) +} + +var _ ListStepsAPIClient = (*Client)(nil) + +// ListStepsPaginatorOptions is the paginator options for ListSteps +type ListStepsPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListStepsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/emr.ListSteps +type ListStepsPaginator struct { + options ListStepsPaginatorOptions + client ListStepsAPIClient + params *ListStepsInput + nextToken *string + firstPage bool + done bool +} + +// NewListStepsPaginator returns a new ListStepsPaginator +func NewListStepsPaginator(client ListStepsAPIClient, params *ListStepsInput, optFns ...func(*ListStepsPaginatorOptions)) *ListStepsPaginator { + options := ListStepsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListStepsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListStepsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListSteps page. +func (p *ListStepsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListStepsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + result, err := p.client.ListSteps(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/eventbridge/go.sum b/service/eventbridge/go.sum index c669e324b14..32595049f96 100644 --- a/service/eventbridge/go.sum +++ b/service/eventbridge/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/firehose/go.sum b/service/firehose/go.sum index c669e324b14..32595049f96 100644 --- a/service/firehose/go.sum +++ b/service/firehose/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/fms/go.sum b/service/fms/go.sum index c669e324b14..32595049f96 100644 --- a/service/fms/go.sum +++ b/service/fms/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/fms/paginators.go b/service/fms/paginators.go new file mode 100644 index 00000000000..2247dada79a --- /dev/null +++ b/service/fms/paginators.go @@ -0,0 +1,244 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package fms + +import ( + "context" + "fmt" +) + +// ListPoliciesAPIClient is a client that implements the ListPolicies operation. +type ListPoliciesAPIClient interface { + ListPolicies(context.Context, *ListPoliciesInput, ...func(*Options)) (*ListPoliciesOutput, error) +} + +var _ ListPoliciesAPIClient = (*Client)(nil) + +// ListPoliciesPaginatorOptions is the paginator options for ListPolicies +type ListPoliciesPaginatorOptions struct { + // Specifies the number of PolicySummary objects that you want AWS Firewall Manager + // to return for this request. If you have more PolicySummary objects than the + // number that you specify for MaxResults, the response includes a NextToken value + // that you can use to get another batch of PolicySummary objects. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListPoliciesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/fms.ListPolicies +type ListPoliciesPaginator struct { + options ListPoliciesPaginatorOptions + client ListPoliciesAPIClient + params *ListPoliciesInput + nextToken *string + firstPage bool + done bool +} + +// NewListPoliciesPaginator returns a new ListPoliciesPaginator +func NewListPoliciesPaginator(client ListPoliciesAPIClient, params *ListPoliciesInput, optFns ...func(*ListPoliciesPaginatorOptions)) *ListPoliciesPaginator { + options := ListPoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListPoliciesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPoliciesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListPolicies page. +func (p *ListPoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPoliciesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListPolicies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListComplianceStatusAPIClient is a client that implements the +// ListComplianceStatus operation. +type ListComplianceStatusAPIClient interface { + ListComplianceStatus(context.Context, *ListComplianceStatusInput, ...func(*Options)) (*ListComplianceStatusOutput, error) +} + +var _ ListComplianceStatusAPIClient = (*Client)(nil) + +// ListComplianceStatusPaginatorOptions is the paginator options for +// ListComplianceStatus +type ListComplianceStatusPaginatorOptions struct { + // Specifies the number of PolicyComplianceStatus objects that you want AWS + // Firewall Manager to return for this request. If you have more + // PolicyComplianceStatus objects than the number that you specify for MaxResults, + // the response includes a NextToken value that you can use to get another batch of + // PolicyComplianceStatus objects. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListComplianceStatusPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/fms.ListComplianceStatus +type ListComplianceStatusPaginator struct { + options ListComplianceStatusPaginatorOptions + client ListComplianceStatusAPIClient + params *ListComplianceStatusInput + nextToken *string + firstPage bool + done bool +} + +// NewListComplianceStatusPaginator returns a new ListComplianceStatusPaginator +func NewListComplianceStatusPaginator(client ListComplianceStatusAPIClient, params *ListComplianceStatusInput, optFns ...func(*ListComplianceStatusPaginatorOptions)) *ListComplianceStatusPaginator { + options := ListComplianceStatusPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListComplianceStatusPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListComplianceStatusPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListComplianceStatus page. +func (p *ListComplianceStatusPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListComplianceStatusOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListComplianceStatus(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListMemberAccountsAPIClient is a client that implements the ListMemberAccounts +// operation. +type ListMemberAccountsAPIClient interface { + ListMemberAccounts(context.Context, *ListMemberAccountsInput, ...func(*Options)) (*ListMemberAccountsOutput, error) +} + +var _ ListMemberAccountsAPIClient = (*Client)(nil) + +// ListMemberAccountsPaginatorOptions is the paginator options for +// ListMemberAccounts +type ListMemberAccountsPaginatorOptions struct { + // Specifies the number of member account IDs that you want AWS Firewall Manager to + // return for this request. If you have more IDs than the number that you specify + // for MaxResults, the response includes a NextToken value that you can use to get + // another batch of member account IDs. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListMemberAccountsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/fms.ListMemberAccounts +type ListMemberAccountsPaginator struct { + options ListMemberAccountsPaginatorOptions + client ListMemberAccountsAPIClient + params *ListMemberAccountsInput + nextToken *string + firstPage bool + done bool +} + +// NewListMemberAccountsPaginator returns a new ListMemberAccountsPaginator +func NewListMemberAccountsPaginator(client ListMemberAccountsAPIClient, params *ListMemberAccountsInput, optFns ...func(*ListMemberAccountsPaginatorOptions)) *ListMemberAccountsPaginator { + options := ListMemberAccountsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListMemberAccountsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMemberAccountsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListMemberAccounts page. +func (p *ListMemberAccountsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMemberAccountsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListMemberAccounts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/forecast/go.sum b/service/forecast/go.sum index c669e324b14..32595049f96 100644 --- a/service/forecast/go.sum +++ b/service/forecast/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/forecast/paginators.go b/service/forecast/paginators.go new file mode 100644 index 00000000000..e3f8bf95ecb --- /dev/null +++ b/service/forecast/paginators.go @@ -0,0 +1,458 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package forecast + +import ( + "context" + "fmt" +) + +// ListForecastExportJobsAPIClient is a client that implements the +// ListForecastExportJobs operation. +type ListForecastExportJobsAPIClient interface { + ListForecastExportJobs(context.Context, *ListForecastExportJobsInput, ...func(*Options)) (*ListForecastExportJobsOutput, error) +} + +var _ ListForecastExportJobsAPIClient = (*Client)(nil) + +// ListForecastExportJobsPaginatorOptions is the paginator options for +// ListForecastExportJobs +type ListForecastExportJobsPaginatorOptions struct { + // The number of items to return in the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListForecastExportJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/forecast.ListForecastExportJobs +type ListForecastExportJobsPaginator struct { + options ListForecastExportJobsPaginatorOptions + client ListForecastExportJobsAPIClient + params *ListForecastExportJobsInput + nextToken *string + firstPage bool + done bool +} + +// NewListForecastExportJobsPaginator returns a new ListForecastExportJobsPaginator +func NewListForecastExportJobsPaginator(client ListForecastExportJobsAPIClient, params *ListForecastExportJobsInput, optFns ...func(*ListForecastExportJobsPaginatorOptions)) *ListForecastExportJobsPaginator { + options := ListForecastExportJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListForecastExportJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListForecastExportJobsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListForecastExportJobs page. +func (p *ListForecastExportJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListForecastExportJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListForecastExportJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDatasetsAPIClient is a client that implements the ListDatasets operation. +type ListDatasetsAPIClient interface { + ListDatasets(context.Context, *ListDatasetsInput, ...func(*Options)) (*ListDatasetsOutput, error) +} + +var _ ListDatasetsAPIClient = (*Client)(nil) + +// ListDatasetsPaginatorOptions is the paginator options for ListDatasets +type ListDatasetsPaginatorOptions struct { + // The number of items to return in the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDatasetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/forecast.ListDatasets +type ListDatasetsPaginator struct { + options ListDatasetsPaginatorOptions + client ListDatasetsAPIClient + params *ListDatasetsInput + nextToken *string + firstPage bool + done bool +} + +// NewListDatasetsPaginator returns a new ListDatasetsPaginator +func NewListDatasetsPaginator(client ListDatasetsAPIClient, params *ListDatasetsInput, optFns ...func(*ListDatasetsPaginatorOptions)) *ListDatasetsPaginator { + options := ListDatasetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDatasetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDatasetsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDatasets page. +func (p *ListDatasetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDatasetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListDatasets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDatasetImportJobsAPIClient is a client that implements the +// ListDatasetImportJobs operation. +type ListDatasetImportJobsAPIClient interface { + ListDatasetImportJobs(context.Context, *ListDatasetImportJobsInput, ...func(*Options)) (*ListDatasetImportJobsOutput, error) +} + +var _ ListDatasetImportJobsAPIClient = (*Client)(nil) + +// ListDatasetImportJobsPaginatorOptions is the paginator options for +// ListDatasetImportJobs +type ListDatasetImportJobsPaginatorOptions struct { + // The number of items to return in the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDatasetImportJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/forecast.ListDatasetImportJobs +type ListDatasetImportJobsPaginator struct { + options ListDatasetImportJobsPaginatorOptions + client ListDatasetImportJobsAPIClient + params *ListDatasetImportJobsInput + nextToken *string + firstPage bool + done bool +} + +// NewListDatasetImportJobsPaginator returns a new ListDatasetImportJobsPaginator +func NewListDatasetImportJobsPaginator(client ListDatasetImportJobsAPIClient, params *ListDatasetImportJobsInput, optFns ...func(*ListDatasetImportJobsPaginatorOptions)) *ListDatasetImportJobsPaginator { + options := ListDatasetImportJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDatasetImportJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDatasetImportJobsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDatasetImportJobs page. +func (p *ListDatasetImportJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDatasetImportJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListDatasetImportJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDatasetGroupsAPIClient is a client that implements the ListDatasetGroups +// operation. +type ListDatasetGroupsAPIClient interface { + ListDatasetGroups(context.Context, *ListDatasetGroupsInput, ...func(*Options)) (*ListDatasetGroupsOutput, error) +} + +var _ ListDatasetGroupsAPIClient = (*Client)(nil) + +// ListDatasetGroupsPaginatorOptions is the paginator options for ListDatasetGroups +type ListDatasetGroupsPaginatorOptions struct { + // The number of items to return in the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDatasetGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/forecast.ListDatasetGroups +type ListDatasetGroupsPaginator struct { + options ListDatasetGroupsPaginatorOptions + client ListDatasetGroupsAPIClient + params *ListDatasetGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewListDatasetGroupsPaginator returns a new ListDatasetGroupsPaginator +func NewListDatasetGroupsPaginator(client ListDatasetGroupsAPIClient, params *ListDatasetGroupsInput, optFns ...func(*ListDatasetGroupsPaginatorOptions)) *ListDatasetGroupsPaginator { + options := ListDatasetGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDatasetGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDatasetGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDatasetGroups page. +func (p *ListDatasetGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDatasetGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListDatasetGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListForecastsAPIClient is a client that implements the ListForecasts operation. +type ListForecastsAPIClient interface { + ListForecasts(context.Context, *ListForecastsInput, ...func(*Options)) (*ListForecastsOutput, error) +} + +var _ ListForecastsAPIClient = (*Client)(nil) + +// ListForecastsPaginatorOptions is the paginator options for ListForecasts +type ListForecastsPaginatorOptions struct { + // The number of items to return in the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListForecastsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/forecast.ListForecasts +type ListForecastsPaginator struct { + options ListForecastsPaginatorOptions + client ListForecastsAPIClient + params *ListForecastsInput + nextToken *string + firstPage bool + done bool +} + +// NewListForecastsPaginator returns a new ListForecastsPaginator +func NewListForecastsPaginator(client ListForecastsAPIClient, params *ListForecastsInput, optFns ...func(*ListForecastsPaginatorOptions)) *ListForecastsPaginator { + options := ListForecastsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListForecastsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListForecastsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListForecasts page. +func (p *ListForecastsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListForecastsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListForecasts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListPredictorsAPIClient is a client that implements the ListPredictors +// operation. +type ListPredictorsAPIClient interface { + ListPredictors(context.Context, *ListPredictorsInput, ...func(*Options)) (*ListPredictorsOutput, error) +} + +var _ ListPredictorsAPIClient = (*Client)(nil) + +// ListPredictorsPaginatorOptions is the paginator options for ListPredictors +type ListPredictorsPaginatorOptions struct { + // The number of items to return in the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListPredictorsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/forecast.ListPredictors +type ListPredictorsPaginator struct { + options ListPredictorsPaginatorOptions + client ListPredictorsAPIClient + params *ListPredictorsInput + nextToken *string + firstPage bool + done bool +} + +// NewListPredictorsPaginator returns a new ListPredictorsPaginator +func NewListPredictorsPaginator(client ListPredictorsAPIClient, params *ListPredictorsInput, optFns ...func(*ListPredictorsPaginatorOptions)) *ListPredictorsPaginator { + options := ListPredictorsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListPredictorsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPredictorsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListPredictors page. +func (p *ListPredictorsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPredictorsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListPredictors(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/forecastquery/go.sum b/service/forecastquery/go.sum index c669e324b14..32595049f96 100644 --- a/service/forecastquery/go.sum +++ b/service/forecastquery/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/frauddetector/go.sum b/service/frauddetector/go.sum index c669e324b14..32595049f96 100644 --- a/service/frauddetector/go.sum +++ b/service/frauddetector/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/frauddetector/paginators.go b/service/frauddetector/paginators.go new file mode 100644 index 00000000000..fe9c0427b98 --- /dev/null +++ b/service/frauddetector/paginators.go @@ -0,0 +1,828 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package frauddetector + +import ( + "context" + "fmt" +) + +// GetEntityTypesAPIClient is a client that implements the GetEntityTypes +// operation. +type GetEntityTypesAPIClient interface { + GetEntityTypes(context.Context, *GetEntityTypesInput, ...func(*Options)) (*GetEntityTypesOutput, error) +} + +var _ GetEntityTypesAPIClient = (*Client)(nil) + +// GetEntityTypesPaginatorOptions is the paginator options for GetEntityTypes +type GetEntityTypesPaginatorOptions struct { + // The maximum number of objects to return for the request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetEntityTypesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/frauddetector.GetEntityTypes +type GetEntityTypesPaginator struct { + options GetEntityTypesPaginatorOptions + client GetEntityTypesAPIClient + params *GetEntityTypesInput + nextToken *string + firstPage bool + done bool +} + +// NewGetEntityTypesPaginator returns a new GetEntityTypesPaginator +func NewGetEntityTypesPaginator(client GetEntityTypesAPIClient, params *GetEntityTypesInput, optFns ...func(*GetEntityTypesPaginatorOptions)) *GetEntityTypesPaginator { + options := GetEntityTypesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetEntityTypesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetEntityTypesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetEntityTypes page. +func (p *GetEntityTypesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetEntityTypesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetEntityTypes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetVariablesAPIClient is a client that implements the GetVariables operation. +type GetVariablesAPIClient interface { + GetVariables(context.Context, *GetVariablesInput, ...func(*Options)) (*GetVariablesOutput, error) +} + +var _ GetVariablesAPIClient = (*Client)(nil) + +// GetVariablesPaginatorOptions is the paginator options for GetVariables +type GetVariablesPaginatorOptions struct { + // The max size per page determined for the get variable request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetVariablesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/frauddetector.GetVariables +type GetVariablesPaginator struct { + options GetVariablesPaginatorOptions + client GetVariablesAPIClient + params *GetVariablesInput + nextToken *string + firstPage bool + done bool +} + +// NewGetVariablesPaginator returns a new GetVariablesPaginator +func NewGetVariablesPaginator(client GetVariablesAPIClient, params *GetVariablesInput, optFns ...func(*GetVariablesPaginatorOptions)) *GetVariablesPaginator { + options := GetVariablesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetVariablesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetVariablesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetVariables page. +func (p *GetVariablesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetVariablesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetVariables(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTagsForResourceAPIClient is a client that implements the ListTagsForResource +// operation. +type ListTagsForResourceAPIClient interface { + ListTagsForResource(context.Context, *ListTagsForResourceInput, ...func(*Options)) (*ListTagsForResourceOutput, error) +} + +var _ ListTagsForResourceAPIClient = (*Client)(nil) + +// ListTagsForResourcePaginatorOptions is the paginator options for +// ListTagsForResource +type ListTagsForResourcePaginatorOptions struct { + // The maximum number of objects to return for the request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTagsForResourcePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/frauddetector.ListTagsForResource +type ListTagsForResourcePaginator struct { + options ListTagsForResourcePaginatorOptions + client ListTagsForResourceAPIClient + params *ListTagsForResourceInput + nextToken *string + firstPage bool + done bool +} + +// NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator +func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator { + options := ListTagsForResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTagsForResourcePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTagsForResourcePaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTagsForResource page. +func (p *ListTagsForResourcePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListTagsForResource(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetDetectorsAPIClient is a client that implements the GetDetectors operation. +type GetDetectorsAPIClient interface { + GetDetectors(context.Context, *GetDetectorsInput, ...func(*Options)) (*GetDetectorsOutput, error) +} + +var _ GetDetectorsAPIClient = (*Client)(nil) + +// GetDetectorsPaginatorOptions is the paginator options for GetDetectors +type GetDetectorsPaginatorOptions struct { + // The maximum number of objects to return for the request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetDetectorsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/frauddetector.GetDetectors +type GetDetectorsPaginator struct { + options GetDetectorsPaginatorOptions + client GetDetectorsAPIClient + params *GetDetectorsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetDetectorsPaginator returns a new GetDetectorsPaginator +func NewGetDetectorsPaginator(client GetDetectorsAPIClient, params *GetDetectorsInput, optFns ...func(*GetDetectorsPaginatorOptions)) *GetDetectorsPaginator { + options := GetDetectorsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetDetectorsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetDetectorsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetDetectors page. +func (p *GetDetectorsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetDetectorsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetDetectors(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetOutcomesAPIClient is a client that implements the GetOutcomes operation. +type GetOutcomesAPIClient interface { + GetOutcomes(context.Context, *GetOutcomesInput, ...func(*Options)) (*GetOutcomesOutput, error) +} + +var _ GetOutcomesAPIClient = (*Client)(nil) + +// GetOutcomesPaginatorOptions is the paginator options for GetOutcomes +type GetOutcomesPaginatorOptions struct { + // The maximum number of objects to return for the request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetOutcomesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/frauddetector.GetOutcomes +type GetOutcomesPaginator struct { + options GetOutcomesPaginatorOptions + client GetOutcomesAPIClient + params *GetOutcomesInput + nextToken *string + firstPage bool + done bool +} + +// NewGetOutcomesPaginator returns a new GetOutcomesPaginator +func NewGetOutcomesPaginator(client GetOutcomesAPIClient, params *GetOutcomesInput, optFns ...func(*GetOutcomesPaginatorOptions)) *GetOutcomesPaginator { + options := GetOutcomesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetOutcomesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetOutcomesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetOutcomes page. +func (p *GetOutcomesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetOutcomesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetOutcomes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeModelVersionsAPIClient is a client that implements the +// DescribeModelVersions operation. +type DescribeModelVersionsAPIClient interface { + DescribeModelVersions(context.Context, *DescribeModelVersionsInput, ...func(*Options)) (*DescribeModelVersionsOutput, error) +} + +var _ DescribeModelVersionsAPIClient = (*Client)(nil) + +// DescribeModelVersionsPaginatorOptions is the paginator options for +// DescribeModelVersions +type DescribeModelVersionsPaginatorOptions struct { + // The maximum number of results to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeModelVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/frauddetector.DescribeModelVersions +type DescribeModelVersionsPaginator struct { + options DescribeModelVersionsPaginatorOptions + client DescribeModelVersionsAPIClient + params *DescribeModelVersionsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeModelVersionsPaginator returns a new DescribeModelVersionsPaginator +func NewDescribeModelVersionsPaginator(client DescribeModelVersionsAPIClient, params *DescribeModelVersionsInput, optFns ...func(*DescribeModelVersionsPaginatorOptions)) *DescribeModelVersionsPaginator { + options := DescribeModelVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeModelVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeModelVersionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeModelVersions page. +func (p *DescribeModelVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeModelVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeModelVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetRulesAPIClient is a client that implements the GetRules operation. +type GetRulesAPIClient interface { + GetRules(context.Context, *GetRulesInput, ...func(*Options)) (*GetRulesOutput, error) +} + +var _ GetRulesAPIClient = (*Client)(nil) + +// GetRulesPaginatorOptions is the paginator options for GetRules +type GetRulesPaginatorOptions struct { + // The maximum number of rules to return for the request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetRulesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/frauddetector.GetRules +type GetRulesPaginator struct { + options GetRulesPaginatorOptions + client GetRulesAPIClient + params *GetRulesInput + nextToken *string + firstPage bool + done bool +} + +// NewGetRulesPaginator returns a new GetRulesPaginator +func NewGetRulesPaginator(client GetRulesAPIClient, params *GetRulesInput, optFns ...func(*GetRulesPaginatorOptions)) *GetRulesPaginator { + options := GetRulesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetRulesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetRulesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetRules page. +func (p *GetRulesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetRulesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetRules(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetModelsAPIClient is a client that implements the GetModels operation. +type GetModelsAPIClient interface { + GetModels(context.Context, *GetModelsInput, ...func(*Options)) (*GetModelsOutput, error) +} + +var _ GetModelsAPIClient = (*Client)(nil) + +// GetModelsPaginatorOptions is the paginator options for GetModels +type GetModelsPaginatorOptions struct { + // The maximum number of objects to return for the request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetModelsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/frauddetector.GetModels +type GetModelsPaginator struct { + options GetModelsPaginatorOptions + client GetModelsAPIClient + params *GetModelsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetModelsPaginator returns a new GetModelsPaginator +func NewGetModelsPaginator(client GetModelsAPIClient, params *GetModelsInput, optFns ...func(*GetModelsPaginatorOptions)) *GetModelsPaginator { + options := GetModelsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetModelsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetModelsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetModels page. +func (p *GetModelsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetModelsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetModels(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetExternalModelsAPIClient is a client that implements the GetExternalModels +// operation. +type GetExternalModelsAPIClient interface { + GetExternalModels(context.Context, *GetExternalModelsInput, ...func(*Options)) (*GetExternalModelsOutput, error) +} + +var _ GetExternalModelsAPIClient = (*Client)(nil) + +// GetExternalModelsPaginatorOptions is the paginator options for GetExternalModels +type GetExternalModelsPaginatorOptions struct { + // The maximum number of objects to return for the request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetExternalModelsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/frauddetector.GetExternalModels +type GetExternalModelsPaginator struct { + options GetExternalModelsPaginatorOptions + client GetExternalModelsAPIClient + params *GetExternalModelsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetExternalModelsPaginator returns a new GetExternalModelsPaginator +func NewGetExternalModelsPaginator(client GetExternalModelsAPIClient, params *GetExternalModelsInput, optFns ...func(*GetExternalModelsPaginatorOptions)) *GetExternalModelsPaginator { + options := GetExternalModelsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetExternalModelsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetExternalModelsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetExternalModels page. +func (p *GetExternalModelsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetExternalModelsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetExternalModels(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetLabelsAPIClient is a client that implements the GetLabels operation. +type GetLabelsAPIClient interface { + GetLabels(context.Context, *GetLabelsInput, ...func(*Options)) (*GetLabelsOutput, error) +} + +var _ GetLabelsAPIClient = (*Client)(nil) + +// GetLabelsPaginatorOptions is the paginator options for GetLabels +type GetLabelsPaginatorOptions struct { + // The maximum number of objects to return for the request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetLabelsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/frauddetector.GetLabels +type GetLabelsPaginator struct { + options GetLabelsPaginatorOptions + client GetLabelsAPIClient + params *GetLabelsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetLabelsPaginator returns a new GetLabelsPaginator +func NewGetLabelsPaginator(client GetLabelsAPIClient, params *GetLabelsInput, optFns ...func(*GetLabelsPaginatorOptions)) *GetLabelsPaginator { + options := GetLabelsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetLabelsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetLabelsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetLabels page. +func (p *GetLabelsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetLabelsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetLabels(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetEventTypesAPIClient is a client that implements the GetEventTypes operation. +type GetEventTypesAPIClient interface { + GetEventTypes(context.Context, *GetEventTypesInput, ...func(*Options)) (*GetEventTypesOutput, error) +} + +var _ GetEventTypesAPIClient = (*Client)(nil) + +// GetEventTypesPaginatorOptions is the paginator options for GetEventTypes +type GetEventTypesPaginatorOptions struct { + // The maximum number of objects to return for the request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetEventTypesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/frauddetector.GetEventTypes +type GetEventTypesPaginator struct { + options GetEventTypesPaginatorOptions + client GetEventTypesAPIClient + params *GetEventTypesInput + nextToken *string + firstPage bool + done bool +} + +// NewGetEventTypesPaginator returns a new GetEventTypesPaginator +func NewGetEventTypesPaginator(client GetEventTypesAPIClient, params *GetEventTypesInput, optFns ...func(*GetEventTypesPaginatorOptions)) *GetEventTypesPaginator { + options := GetEventTypesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetEventTypesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetEventTypesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetEventTypes page. +func (p *GetEventTypesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetEventTypesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetEventTypes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/fsx/go.sum b/service/fsx/go.sum index c669e324b14..32595049f96 100644 --- a/service/fsx/go.sum +++ b/service/fsx/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/fsx/paginators.go b/service/fsx/paginators.go new file mode 100644 index 00000000000..8684ce70816 --- /dev/null +++ b/service/fsx/paginators.go @@ -0,0 +1,243 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package fsx + +import ( + "context" + "fmt" +) + +// DescribeFileSystemsAPIClient is a client that implements the DescribeFileSystems +// operation. +type DescribeFileSystemsAPIClient interface { + DescribeFileSystems(context.Context, *DescribeFileSystemsInput, ...func(*Options)) (*DescribeFileSystemsOutput, error) +} + +var _ DescribeFileSystemsAPIClient = (*Client)(nil) + +// DescribeFileSystemsPaginatorOptions is the paginator options for +// DescribeFileSystems +type DescribeFileSystemsPaginatorOptions struct { + // Maximum number of file systems to return in the response (integer). This + // parameter value must be greater than 0. The number of items that Amazon FSx + // returns is the minimum of the MaxResults parameter specified in the request and + // the service's internal maximum number of items per page. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeFileSystemsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/fsx.DescribeFileSystems +type DescribeFileSystemsPaginator struct { + options DescribeFileSystemsPaginatorOptions + client DescribeFileSystemsAPIClient + params *DescribeFileSystemsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeFileSystemsPaginator returns a new DescribeFileSystemsPaginator +func NewDescribeFileSystemsPaginator(client DescribeFileSystemsAPIClient, params *DescribeFileSystemsInput, optFns ...func(*DescribeFileSystemsPaginatorOptions)) *DescribeFileSystemsPaginator { + options := DescribeFileSystemsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeFileSystemsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeFileSystemsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeFileSystems page. +func (p *DescribeFileSystemsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeFileSystemsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeFileSystems(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeBackupsAPIClient is a client that implements the DescribeBackups +// operation. +type DescribeBackupsAPIClient interface { + DescribeBackups(context.Context, *DescribeBackupsInput, ...func(*Options)) (*DescribeBackupsOutput, error) +} + +var _ DescribeBackupsAPIClient = (*Client)(nil) + +// DescribeBackupsPaginatorOptions is the paginator options for DescribeBackups +type DescribeBackupsPaginatorOptions struct { + // Maximum number of backups to return in the response (integer). This parameter + // value must be greater than 0. The number of items that Amazon FSx returns is the + // minimum of the MaxResults parameter specified in the request and the service's + // internal maximum number of items per page. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeBackupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/fsx.DescribeBackups +type DescribeBackupsPaginator struct { + options DescribeBackupsPaginatorOptions + client DescribeBackupsAPIClient + params *DescribeBackupsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeBackupsPaginator returns a new DescribeBackupsPaginator +func NewDescribeBackupsPaginator(client DescribeBackupsAPIClient, params *DescribeBackupsInput, optFns ...func(*DescribeBackupsPaginatorOptions)) *DescribeBackupsPaginator { + options := DescribeBackupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeBackupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeBackupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeBackups page. +func (p *DescribeBackupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeBackupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeBackups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeDataRepositoryTasksAPIClient is a client that implements the +// DescribeDataRepositoryTasks operation. +type DescribeDataRepositoryTasksAPIClient interface { + DescribeDataRepositoryTasks(context.Context, *DescribeDataRepositoryTasksInput, ...func(*Options)) (*DescribeDataRepositoryTasksOutput, error) +} + +var _ DescribeDataRepositoryTasksAPIClient = (*Client)(nil) + +// DescribeDataRepositoryTasksPaginatorOptions is the paginator options for +// DescribeDataRepositoryTasks +type DescribeDataRepositoryTasksPaginatorOptions struct { + // The maximum number of resources to return in the response. This value must be an + // integer greater than zero. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeDataRepositoryTasksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/fsx.DescribeDataRepositoryTasks +type DescribeDataRepositoryTasksPaginator struct { + options DescribeDataRepositoryTasksPaginatorOptions + client DescribeDataRepositoryTasksAPIClient + params *DescribeDataRepositoryTasksInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeDataRepositoryTasksPaginator returns a new +// DescribeDataRepositoryTasksPaginator +func NewDescribeDataRepositoryTasksPaginator(client DescribeDataRepositoryTasksAPIClient, params *DescribeDataRepositoryTasksInput, optFns ...func(*DescribeDataRepositoryTasksPaginatorOptions)) *DescribeDataRepositoryTasksPaginator { + options := DescribeDataRepositoryTasksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeDataRepositoryTasksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDataRepositoryTasksPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeDataRepositoryTasks page. +func (p *DescribeDataRepositoryTasksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDataRepositoryTasksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeDataRepositoryTasks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/gamelift/go.sum b/service/gamelift/go.sum index c669e324b14..32595049f96 100644 --- a/service/gamelift/go.sum +++ b/service/gamelift/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/gamelift/paginators.go b/service/gamelift/paginators.go new file mode 100644 index 00000000000..2b9d68b200e --- /dev/null +++ b/service/gamelift/paginators.go @@ -0,0 +1,1551 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package gamelift + +import ( + "context" + "fmt" +) + +// ListGameServersAPIClient is a client that implements the ListGameServers +// operation. +type ListGameServersAPIClient interface { + ListGameServers(context.Context, *ListGameServersInput, ...func(*Options)) (*ListGameServersOutput, error) +} + +var _ ListGameServersAPIClient = (*Client)(nil) + +// ListGameServersPaginatorOptions is the paginator options for ListGameServers +type ListGameServersPaginatorOptions struct { + // The maximum number of results to return. Use this parameter with NextToken to + // get results as a set of sequential segments. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListGameServersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/gamelift.ListGameServers +type ListGameServersPaginator struct { + options ListGameServersPaginatorOptions + client ListGameServersAPIClient + params *ListGameServersInput + nextToken *string + firstPage bool + done bool +} + +// NewListGameServersPaginator returns a new ListGameServersPaginator +func NewListGameServersPaginator(client ListGameServersAPIClient, params *ListGameServersInput, optFns ...func(*ListGameServersPaginatorOptions)) *ListGameServersPaginator { + options := ListGameServersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListGameServersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListGameServersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListGameServers page. +func (p *ListGameServersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListGameServersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.ListGameServers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListBuildsAPIClient is a client that implements the ListBuilds operation. +type ListBuildsAPIClient interface { + ListBuilds(context.Context, *ListBuildsInput, ...func(*Options)) (*ListBuildsOutput, error) +} + +var _ ListBuildsAPIClient = (*Client)(nil) + +// ListBuildsPaginatorOptions is the paginator options for ListBuilds +type ListBuildsPaginatorOptions struct { + // The maximum number of results to return. Use this parameter with NextToken to + // get results as a set of sequential pages. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListBuildsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/gamelift.ListBuilds +type ListBuildsPaginator struct { + options ListBuildsPaginatorOptions + client ListBuildsAPIClient + params *ListBuildsInput + nextToken *string + firstPage bool + done bool +} + +// NewListBuildsPaginator returns a new ListBuildsPaginator +func NewListBuildsPaginator(client ListBuildsAPIClient, params *ListBuildsInput, optFns ...func(*ListBuildsPaginatorOptions)) *ListBuildsPaginator { + options := ListBuildsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListBuildsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListBuildsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListBuilds page. +func (p *ListBuildsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBuildsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.ListBuilds(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListGameServerGroupsAPIClient is a client that implements the +// ListGameServerGroups operation. +type ListGameServerGroupsAPIClient interface { + ListGameServerGroups(context.Context, *ListGameServerGroupsInput, ...func(*Options)) (*ListGameServerGroupsOutput, error) +} + +var _ ListGameServerGroupsAPIClient = (*Client)(nil) + +// ListGameServerGroupsPaginatorOptions is the paginator options for +// ListGameServerGroups +type ListGameServerGroupsPaginatorOptions struct { + // The maximum number of results to return. Use this parameter with NextToken to + // get results as a set of sequential segments. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListGameServerGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/gamelift.ListGameServerGroups +type ListGameServerGroupsPaginator struct { + options ListGameServerGroupsPaginatorOptions + client ListGameServerGroupsAPIClient + params *ListGameServerGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewListGameServerGroupsPaginator returns a new ListGameServerGroupsPaginator +func NewListGameServerGroupsPaginator(client ListGameServerGroupsAPIClient, params *ListGameServerGroupsInput, optFns ...func(*ListGameServerGroupsPaginatorOptions)) *ListGameServerGroupsPaginator { + options := ListGameServerGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListGameServerGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListGameServerGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListGameServerGroups page. +func (p *ListGameServerGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListGameServerGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.ListGameServerGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeScalingPoliciesAPIClient is a client that implements the +// DescribeScalingPolicies operation. +type DescribeScalingPoliciesAPIClient interface { + DescribeScalingPolicies(context.Context, *DescribeScalingPoliciesInput, ...func(*Options)) (*DescribeScalingPoliciesOutput, error) +} + +var _ DescribeScalingPoliciesAPIClient = (*Client)(nil) + +// DescribeScalingPoliciesPaginatorOptions is the paginator options for +// DescribeScalingPolicies +type DescribeScalingPoliciesPaginatorOptions struct { + // The maximum number of results to return. Use this parameter with NextToken to + // get results as a set of sequential pages. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeScalingPoliciesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/gamelift.DescribeScalingPolicies +type DescribeScalingPoliciesPaginator struct { + options DescribeScalingPoliciesPaginatorOptions + client DescribeScalingPoliciesAPIClient + params *DescribeScalingPoliciesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeScalingPoliciesPaginator returns a new +// DescribeScalingPoliciesPaginator +func NewDescribeScalingPoliciesPaginator(client DescribeScalingPoliciesAPIClient, params *DescribeScalingPoliciesInput, optFns ...func(*DescribeScalingPoliciesPaginatorOptions)) *DescribeScalingPoliciesPaginator { + options := DescribeScalingPoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeScalingPoliciesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeScalingPoliciesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeScalingPolicies page. +func (p *DescribeScalingPoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeScalingPoliciesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.DescribeScalingPolicies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeFleetAttributesAPIClient is a client that implements the +// DescribeFleetAttributes operation. +type DescribeFleetAttributesAPIClient interface { + DescribeFleetAttributes(context.Context, *DescribeFleetAttributesInput, ...func(*Options)) (*DescribeFleetAttributesOutput, error) +} + +var _ DescribeFleetAttributesAPIClient = (*Client)(nil) + +// DescribeFleetAttributesPaginatorOptions is the paginator options for +// DescribeFleetAttributes +type DescribeFleetAttributesPaginatorOptions struct { + // The maximum number of results to return. Use this parameter with NextToken to + // get results as a set of sequential pages. This parameter is ignored when the + // request specifies one or a list of fleet IDs. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeFleetAttributesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/gamelift.DescribeFleetAttributes +type DescribeFleetAttributesPaginator struct { + options DescribeFleetAttributesPaginatorOptions + client DescribeFleetAttributesAPIClient + params *DescribeFleetAttributesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeFleetAttributesPaginator returns a new +// DescribeFleetAttributesPaginator +func NewDescribeFleetAttributesPaginator(client DescribeFleetAttributesAPIClient, params *DescribeFleetAttributesInput, optFns ...func(*DescribeFleetAttributesPaginatorOptions)) *DescribeFleetAttributesPaginator { + options := DescribeFleetAttributesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeFleetAttributesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeFleetAttributesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeFleetAttributes page. +func (p *DescribeFleetAttributesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeFleetAttributesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.DescribeFleetAttributes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeGameSessionQueuesAPIClient is a client that implements the +// DescribeGameSessionQueues operation. +type DescribeGameSessionQueuesAPIClient interface { + DescribeGameSessionQueues(context.Context, *DescribeGameSessionQueuesInput, ...func(*Options)) (*DescribeGameSessionQueuesOutput, error) +} + +var _ DescribeGameSessionQueuesAPIClient = (*Client)(nil) + +// DescribeGameSessionQueuesPaginatorOptions is the paginator options for +// DescribeGameSessionQueues +type DescribeGameSessionQueuesPaginatorOptions struct { + // The maximum number of results to return. Use this parameter with NextToken to + // get results as a set of sequential pages. You can request up to 50 results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeGameSessionQueuesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/gamelift.DescribeGameSessionQueues +type DescribeGameSessionQueuesPaginator struct { + options DescribeGameSessionQueuesPaginatorOptions + client DescribeGameSessionQueuesAPIClient + params *DescribeGameSessionQueuesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeGameSessionQueuesPaginator returns a new +// DescribeGameSessionQueuesPaginator +func NewDescribeGameSessionQueuesPaginator(client DescribeGameSessionQueuesAPIClient, params *DescribeGameSessionQueuesInput, optFns ...func(*DescribeGameSessionQueuesPaginatorOptions)) *DescribeGameSessionQueuesPaginator { + options := DescribeGameSessionQueuesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeGameSessionQueuesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeGameSessionQueuesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeGameSessionQueues page. +func (p *DescribeGameSessionQueuesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeGameSessionQueuesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.DescribeGameSessionQueues(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListScriptsAPIClient is a client that implements the ListScripts operation. +type ListScriptsAPIClient interface { + ListScripts(context.Context, *ListScriptsInput, ...func(*Options)) (*ListScriptsOutput, error) +} + +var _ ListScriptsAPIClient = (*Client)(nil) + +// ListScriptsPaginatorOptions is the paginator options for ListScripts +type ListScriptsPaginatorOptions struct { + // The maximum number of results to return. Use this parameter with NextToken to + // get results as a set of sequential pages. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListScriptsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/gamelift.ListScripts +type ListScriptsPaginator struct { + options ListScriptsPaginatorOptions + client ListScriptsAPIClient + params *ListScriptsInput + nextToken *string + firstPage bool + done bool +} + +// NewListScriptsPaginator returns a new ListScriptsPaginator +func NewListScriptsPaginator(client ListScriptsAPIClient, params *ListScriptsInput, optFns ...func(*ListScriptsPaginatorOptions)) *ListScriptsPaginator { + options := ListScriptsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListScriptsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListScriptsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListScripts page. +func (p *ListScriptsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListScriptsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.ListScripts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListFleetsAPIClient is a client that implements the ListFleets operation. +type ListFleetsAPIClient interface { + ListFleets(context.Context, *ListFleetsInput, ...func(*Options)) (*ListFleetsOutput, error) +} + +var _ ListFleetsAPIClient = (*Client)(nil) + +// ListFleetsPaginatorOptions is the paginator options for ListFleets +type ListFleetsPaginatorOptions struct { + // The maximum number of results to return. Use this parameter with NextToken to + // get results as a set of sequential pages. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListFleetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/gamelift.ListFleets +type ListFleetsPaginator struct { + options ListFleetsPaginatorOptions + client ListFleetsAPIClient + params *ListFleetsInput + nextToken *string + firstPage bool + done bool +} + +// NewListFleetsPaginator returns a new ListFleetsPaginator +func NewListFleetsPaginator(client ListFleetsAPIClient, params *ListFleetsInput, optFns ...func(*ListFleetsPaginatorOptions)) *ListFleetsPaginator { + options := ListFleetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListFleetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListFleetsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListFleets page. +func (p *ListFleetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFleetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.ListFleets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribePlayerSessionsAPIClient is a client that implements the +// DescribePlayerSessions operation. +type DescribePlayerSessionsAPIClient interface { + DescribePlayerSessions(context.Context, *DescribePlayerSessionsInput, ...func(*Options)) (*DescribePlayerSessionsOutput, error) +} + +var _ DescribePlayerSessionsAPIClient = (*Client)(nil) + +// DescribePlayerSessionsPaginatorOptions is the paginator options for +// DescribePlayerSessions +type DescribePlayerSessionsPaginatorOptions struct { + // The maximum number of results to return. Use this parameter with NextToken to + // get results as a set of sequential pages. If a player session ID is specified, + // this parameter is ignored. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribePlayerSessionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/gamelift.DescribePlayerSessions +type DescribePlayerSessionsPaginator struct { + options DescribePlayerSessionsPaginatorOptions + client DescribePlayerSessionsAPIClient + params *DescribePlayerSessionsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribePlayerSessionsPaginator returns a new DescribePlayerSessionsPaginator +func NewDescribePlayerSessionsPaginator(client DescribePlayerSessionsAPIClient, params *DescribePlayerSessionsInput, optFns ...func(*DescribePlayerSessionsPaginatorOptions)) *DescribePlayerSessionsPaginator { + options := DescribePlayerSessionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribePlayerSessionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribePlayerSessionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribePlayerSessions page. +func (p *DescribePlayerSessionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribePlayerSessionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.DescribePlayerSessions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeFleetEventsAPIClient is a client that implements the DescribeFleetEvents +// operation. +type DescribeFleetEventsAPIClient interface { + DescribeFleetEvents(context.Context, *DescribeFleetEventsInput, ...func(*Options)) (*DescribeFleetEventsOutput, error) +} + +var _ DescribeFleetEventsAPIClient = (*Client)(nil) + +// DescribeFleetEventsPaginatorOptions is the paginator options for +// DescribeFleetEvents +type DescribeFleetEventsPaginatorOptions struct { + // The maximum number of results to return. Use this parameter with NextToken to + // get results as a set of sequential pages. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeFleetEventsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/gamelift.DescribeFleetEvents +type DescribeFleetEventsPaginator struct { + options DescribeFleetEventsPaginatorOptions + client DescribeFleetEventsAPIClient + params *DescribeFleetEventsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeFleetEventsPaginator returns a new DescribeFleetEventsPaginator +func NewDescribeFleetEventsPaginator(client DescribeFleetEventsAPIClient, params *DescribeFleetEventsInput, optFns ...func(*DescribeFleetEventsPaginatorOptions)) *DescribeFleetEventsPaginator { + options := DescribeFleetEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeFleetEventsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeFleetEventsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeFleetEvents page. +func (p *DescribeFleetEventsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeFleetEventsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.DescribeFleetEvents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeGameServerInstancesAPIClient is a client that implements the +// DescribeGameServerInstances operation. +type DescribeGameServerInstancesAPIClient interface { + DescribeGameServerInstances(context.Context, *DescribeGameServerInstancesInput, ...func(*Options)) (*DescribeGameServerInstancesOutput, error) +} + +var _ DescribeGameServerInstancesAPIClient = (*Client)(nil) + +// DescribeGameServerInstancesPaginatorOptions is the paginator options for +// DescribeGameServerInstances +type DescribeGameServerInstancesPaginatorOptions struct { + // The maximum number of results to return. Use this parameter with NextToken to + // get results as a set of sequential segments. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeGameServerInstancesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/gamelift.DescribeGameServerInstances +type DescribeGameServerInstancesPaginator struct { + options DescribeGameServerInstancesPaginatorOptions + client DescribeGameServerInstancesAPIClient + params *DescribeGameServerInstancesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeGameServerInstancesPaginator returns a new +// DescribeGameServerInstancesPaginator +func NewDescribeGameServerInstancesPaginator(client DescribeGameServerInstancesAPIClient, params *DescribeGameServerInstancesInput, optFns ...func(*DescribeGameServerInstancesPaginatorOptions)) *DescribeGameServerInstancesPaginator { + options := DescribeGameServerInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeGameServerInstancesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeGameServerInstancesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeGameServerInstances page. +func (p *DescribeGameServerInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeGameServerInstancesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.DescribeGameServerInstances(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeFleetUtilizationAPIClient is a client that implements the +// DescribeFleetUtilization operation. +type DescribeFleetUtilizationAPIClient interface { + DescribeFleetUtilization(context.Context, *DescribeFleetUtilizationInput, ...func(*Options)) (*DescribeFleetUtilizationOutput, error) +} + +var _ DescribeFleetUtilizationAPIClient = (*Client)(nil) + +// DescribeFleetUtilizationPaginatorOptions is the paginator options for +// DescribeFleetUtilization +type DescribeFleetUtilizationPaginatorOptions struct { + // The maximum number of results to return. Use this parameter with NextToken to + // get results as a set of sequential pages. This parameter is ignored when the + // request specifies one or a list of fleet IDs. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeFleetUtilizationPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/gamelift.DescribeFleetUtilization +type DescribeFleetUtilizationPaginator struct { + options DescribeFleetUtilizationPaginatorOptions + client DescribeFleetUtilizationAPIClient + params *DescribeFleetUtilizationInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeFleetUtilizationPaginator returns a new +// DescribeFleetUtilizationPaginator +func NewDescribeFleetUtilizationPaginator(client DescribeFleetUtilizationAPIClient, params *DescribeFleetUtilizationInput, optFns ...func(*DescribeFleetUtilizationPaginatorOptions)) *DescribeFleetUtilizationPaginator { + options := DescribeFleetUtilizationPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeFleetUtilizationPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeFleetUtilizationPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeFleetUtilization page. +func (p *DescribeFleetUtilizationPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeFleetUtilizationOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.DescribeFleetUtilization(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeMatchmakingRuleSetsAPIClient is a client that implements the +// DescribeMatchmakingRuleSets operation. +type DescribeMatchmakingRuleSetsAPIClient interface { + DescribeMatchmakingRuleSets(context.Context, *DescribeMatchmakingRuleSetsInput, ...func(*Options)) (*DescribeMatchmakingRuleSetsOutput, error) +} + +var _ DescribeMatchmakingRuleSetsAPIClient = (*Client)(nil) + +// DescribeMatchmakingRuleSetsPaginatorOptions is the paginator options for +// DescribeMatchmakingRuleSets +type DescribeMatchmakingRuleSetsPaginatorOptions struct { + // The maximum number of results to return. Use this parameter with NextToken to + // get results as a set of sequential pages. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeMatchmakingRuleSetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/gamelift.DescribeMatchmakingRuleSets +type DescribeMatchmakingRuleSetsPaginator struct { + options DescribeMatchmakingRuleSetsPaginatorOptions + client DescribeMatchmakingRuleSetsAPIClient + params *DescribeMatchmakingRuleSetsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeMatchmakingRuleSetsPaginator returns a new +// DescribeMatchmakingRuleSetsPaginator +func NewDescribeMatchmakingRuleSetsPaginator(client DescribeMatchmakingRuleSetsAPIClient, params *DescribeMatchmakingRuleSetsInput, optFns ...func(*DescribeMatchmakingRuleSetsPaginatorOptions)) *DescribeMatchmakingRuleSetsPaginator { + options := DescribeMatchmakingRuleSetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeMatchmakingRuleSetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeMatchmakingRuleSetsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeMatchmakingRuleSets page. +func (p *DescribeMatchmakingRuleSetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeMatchmakingRuleSetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.DescribeMatchmakingRuleSets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListAliasesAPIClient is a client that implements the ListAliases operation. +type ListAliasesAPIClient interface { + ListAliases(context.Context, *ListAliasesInput, ...func(*Options)) (*ListAliasesOutput, error) +} + +var _ ListAliasesAPIClient = (*Client)(nil) + +// ListAliasesPaginatorOptions is the paginator options for ListAliases +type ListAliasesPaginatorOptions struct { + // The maximum number of results to return. Use this parameter with NextToken to + // get results as a set of sequential pages. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAliasesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/gamelift.ListAliases +type ListAliasesPaginator struct { + options ListAliasesPaginatorOptions + client ListAliasesAPIClient + params *ListAliasesInput + nextToken *string + firstPage bool + done bool +} + +// NewListAliasesPaginator returns a new ListAliasesPaginator +func NewListAliasesPaginator(client ListAliasesAPIClient, params *ListAliasesInput, optFns ...func(*ListAliasesPaginatorOptions)) *ListAliasesPaginator { + options := ListAliasesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAliasesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAliasesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAliases page. +func (p *ListAliasesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAliasesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.ListAliases(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeGameSessionDetailsAPIClient is a client that implements the +// DescribeGameSessionDetails operation. +type DescribeGameSessionDetailsAPIClient interface { + DescribeGameSessionDetails(context.Context, *DescribeGameSessionDetailsInput, ...func(*Options)) (*DescribeGameSessionDetailsOutput, error) +} + +var _ DescribeGameSessionDetailsAPIClient = (*Client)(nil) + +// DescribeGameSessionDetailsPaginatorOptions is the paginator options for +// DescribeGameSessionDetails +type DescribeGameSessionDetailsPaginatorOptions struct { + // The maximum number of results to return. Use this parameter with NextToken to + // get results as a set of sequential pages. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeGameSessionDetailsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/gamelift.DescribeGameSessionDetails +type DescribeGameSessionDetailsPaginator struct { + options DescribeGameSessionDetailsPaginatorOptions + client DescribeGameSessionDetailsAPIClient + params *DescribeGameSessionDetailsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeGameSessionDetailsPaginator returns a new +// DescribeGameSessionDetailsPaginator +func NewDescribeGameSessionDetailsPaginator(client DescribeGameSessionDetailsAPIClient, params *DescribeGameSessionDetailsInput, optFns ...func(*DescribeGameSessionDetailsPaginatorOptions)) *DescribeGameSessionDetailsPaginator { + options := DescribeGameSessionDetailsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeGameSessionDetailsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeGameSessionDetailsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeGameSessionDetails page. +func (p *DescribeGameSessionDetailsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeGameSessionDetailsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.DescribeGameSessionDetails(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeFleetCapacityAPIClient is a client that implements the +// DescribeFleetCapacity operation. +type DescribeFleetCapacityAPIClient interface { + DescribeFleetCapacity(context.Context, *DescribeFleetCapacityInput, ...func(*Options)) (*DescribeFleetCapacityOutput, error) +} + +var _ DescribeFleetCapacityAPIClient = (*Client)(nil) + +// DescribeFleetCapacityPaginatorOptions is the paginator options for +// DescribeFleetCapacity +type DescribeFleetCapacityPaginatorOptions struct { + // The maximum number of results to return. Use this parameter with NextToken to + // get results as a set of sequential pages. This parameter is ignored when the + // request specifies one or a list of fleet IDs. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeFleetCapacityPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/gamelift.DescribeFleetCapacity +type DescribeFleetCapacityPaginator struct { + options DescribeFleetCapacityPaginatorOptions + client DescribeFleetCapacityAPIClient + params *DescribeFleetCapacityInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeFleetCapacityPaginator returns a new DescribeFleetCapacityPaginator +func NewDescribeFleetCapacityPaginator(client DescribeFleetCapacityAPIClient, params *DescribeFleetCapacityInput, optFns ...func(*DescribeFleetCapacityPaginatorOptions)) *DescribeFleetCapacityPaginator { + options := DescribeFleetCapacityPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeFleetCapacityPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeFleetCapacityPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeFleetCapacity page. +func (p *DescribeFleetCapacityPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeFleetCapacityOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.DescribeFleetCapacity(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeInstancesAPIClient is a client that implements the DescribeInstances +// operation. +type DescribeInstancesAPIClient interface { + DescribeInstances(context.Context, *DescribeInstancesInput, ...func(*Options)) (*DescribeInstancesOutput, error) +} + +var _ DescribeInstancesAPIClient = (*Client)(nil) + +// DescribeInstancesPaginatorOptions is the paginator options for DescribeInstances +type DescribeInstancesPaginatorOptions struct { + // The maximum number of results to return. Use this parameter with NextToken to + // get results as a set of sequential pages. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeInstancesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/gamelift.DescribeInstances +type DescribeInstancesPaginator struct { + options DescribeInstancesPaginatorOptions + client DescribeInstancesAPIClient + params *DescribeInstancesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeInstancesPaginator returns a new DescribeInstancesPaginator +func NewDescribeInstancesPaginator(client DescribeInstancesAPIClient, params *DescribeInstancesInput, optFns ...func(*DescribeInstancesPaginatorOptions)) *DescribeInstancesPaginator { + options := DescribeInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeInstancesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeInstancesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeInstances page. +func (p *DescribeInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInstancesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.DescribeInstances(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// SearchGameSessionsAPIClient is a client that implements the SearchGameSessions +// operation. +type SearchGameSessionsAPIClient interface { + SearchGameSessions(context.Context, *SearchGameSessionsInput, ...func(*Options)) (*SearchGameSessionsOutput, error) +} + +var _ SearchGameSessionsAPIClient = (*Client)(nil) + +// SearchGameSessionsPaginatorOptions is the paginator options for +// SearchGameSessions +type SearchGameSessionsPaginatorOptions struct { + // The maximum number of results to return. Use this parameter with NextToken to + // get results as a set of sequential pages. The maximum number of results returned + // is 20, even if this value is not set or is set higher than 20. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// SearchGameSessionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/gamelift.SearchGameSessions +type SearchGameSessionsPaginator struct { + options SearchGameSessionsPaginatorOptions + client SearchGameSessionsAPIClient + params *SearchGameSessionsInput + nextToken *string + firstPage bool + done bool +} + +// NewSearchGameSessionsPaginator returns a new SearchGameSessionsPaginator +func NewSearchGameSessionsPaginator(client SearchGameSessionsAPIClient, params *SearchGameSessionsInput, optFns ...func(*SearchGameSessionsPaginatorOptions)) *SearchGameSessionsPaginator { + options := SearchGameSessionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &SearchGameSessionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchGameSessionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next SearchGameSessions page. +func (p *SearchGameSessionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchGameSessionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.SearchGameSessions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeMatchmakingConfigurationsAPIClient is a client that implements the +// DescribeMatchmakingConfigurations operation. +type DescribeMatchmakingConfigurationsAPIClient interface { + DescribeMatchmakingConfigurations(context.Context, *DescribeMatchmakingConfigurationsInput, ...func(*Options)) (*DescribeMatchmakingConfigurationsOutput, error) +} + +var _ DescribeMatchmakingConfigurationsAPIClient = (*Client)(nil) + +// DescribeMatchmakingConfigurationsPaginatorOptions is the paginator options for +// DescribeMatchmakingConfigurations +type DescribeMatchmakingConfigurationsPaginatorOptions struct { + // The maximum number of results to return. Use this parameter with NextToken to + // get results as a set of sequential pages. This parameter is limited to 10. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeMatchmakingConfigurationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/gamelift.DescribeMatchmakingConfigurations +type DescribeMatchmakingConfigurationsPaginator struct { + options DescribeMatchmakingConfigurationsPaginatorOptions + client DescribeMatchmakingConfigurationsAPIClient + params *DescribeMatchmakingConfigurationsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeMatchmakingConfigurationsPaginator returns a new +// DescribeMatchmakingConfigurationsPaginator +func NewDescribeMatchmakingConfigurationsPaginator(client DescribeMatchmakingConfigurationsAPIClient, params *DescribeMatchmakingConfigurationsInput, optFns ...func(*DescribeMatchmakingConfigurationsPaginatorOptions)) *DescribeMatchmakingConfigurationsPaginator { + options := DescribeMatchmakingConfigurationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeMatchmakingConfigurationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeMatchmakingConfigurationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeMatchmakingConfigurations page. +func (p *DescribeMatchmakingConfigurationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeMatchmakingConfigurationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.DescribeMatchmakingConfigurations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeGameSessionsAPIClient is a client that implements the +// DescribeGameSessions operation. +type DescribeGameSessionsAPIClient interface { + DescribeGameSessions(context.Context, *DescribeGameSessionsInput, ...func(*Options)) (*DescribeGameSessionsOutput, error) +} + +var _ DescribeGameSessionsAPIClient = (*Client)(nil) + +// DescribeGameSessionsPaginatorOptions is the paginator options for +// DescribeGameSessions +type DescribeGameSessionsPaginatorOptions struct { + // The maximum number of results to return. Use this parameter with NextToken to + // get results as a set of sequential pages. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeGameSessionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/gamelift.DescribeGameSessions +type DescribeGameSessionsPaginator struct { + options DescribeGameSessionsPaginatorOptions + client DescribeGameSessionsAPIClient + params *DescribeGameSessionsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeGameSessionsPaginator returns a new DescribeGameSessionsPaginator +func NewDescribeGameSessionsPaginator(client DescribeGameSessionsAPIClient, params *DescribeGameSessionsInput, optFns ...func(*DescribeGameSessionsPaginatorOptions)) *DescribeGameSessionsPaginator { + options := DescribeGameSessionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeGameSessionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeGameSessionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeGameSessions page. +func (p *DescribeGameSessionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeGameSessionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.DescribeGameSessions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/glacier/go.sum b/service/glacier/go.sum index c669e324b14..32595049f96 100644 --- a/service/glacier/go.sum +++ b/service/glacier/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/globalaccelerator/go.sum b/service/globalaccelerator/go.sum index c669e324b14..32595049f96 100644 --- a/service/globalaccelerator/go.sum +++ b/service/globalaccelerator/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/glue/go.sum b/service/glue/go.sum index c669e324b14..32595049f96 100644 --- a/service/glue/go.sum +++ b/service/glue/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/glue/paginators.go b/service/glue/paginators.go new file mode 100644 index 00000000000..73735ee0024 --- /dev/null +++ b/service/glue/paginators.go @@ -0,0 +1,1871 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package glue + +import ( + "context" + "fmt" +) + +// ListDevEndpointsAPIClient is a client that implements the ListDevEndpoints +// operation. +type ListDevEndpointsAPIClient interface { + ListDevEndpoints(context.Context, *ListDevEndpointsInput, ...func(*Options)) (*ListDevEndpointsOutput, error) +} + +var _ ListDevEndpointsAPIClient = (*Client)(nil) + +// ListDevEndpointsPaginatorOptions is the paginator options for ListDevEndpoints +type ListDevEndpointsPaginatorOptions struct { + // The maximum size of a list to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDevEndpointsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/glue.ListDevEndpoints +type ListDevEndpointsPaginator struct { + options ListDevEndpointsPaginatorOptions + client ListDevEndpointsAPIClient + params *ListDevEndpointsInput + nextToken *string + firstPage bool + done bool +} + +// NewListDevEndpointsPaginator returns a new ListDevEndpointsPaginator +func NewListDevEndpointsPaginator(client ListDevEndpointsAPIClient, params *ListDevEndpointsInput, optFns ...func(*ListDevEndpointsPaginatorOptions)) *ListDevEndpointsPaginator { + options := ListDevEndpointsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDevEndpointsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDevEndpointsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDevEndpoints page. +func (p *ListDevEndpointsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDevEndpointsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListDevEndpoints(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetDatabasesAPIClient is a client that implements the GetDatabases operation. +type GetDatabasesAPIClient interface { + GetDatabases(context.Context, *GetDatabasesInput, ...func(*Options)) (*GetDatabasesOutput, error) +} + +var _ GetDatabasesAPIClient = (*Client)(nil) + +// GetDatabasesPaginatorOptions is the paginator options for GetDatabases +type GetDatabasesPaginatorOptions struct { + // The maximum number of databases to return in one response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetDatabasesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/glue.GetDatabases +type GetDatabasesPaginator struct { + options GetDatabasesPaginatorOptions + client GetDatabasesAPIClient + params *GetDatabasesInput + nextToken *string + firstPage bool + done bool +} + +// NewGetDatabasesPaginator returns a new GetDatabasesPaginator +func NewGetDatabasesPaginator(client GetDatabasesAPIClient, params *GetDatabasesInput, optFns ...func(*GetDatabasesPaginatorOptions)) *GetDatabasesPaginator { + options := GetDatabasesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetDatabasesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetDatabasesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetDatabases page. +func (p *GetDatabasesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetDatabasesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetDatabases(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetTableVersionsAPIClient is a client that implements the GetTableVersions +// operation. +type GetTableVersionsAPIClient interface { + GetTableVersions(context.Context, *GetTableVersionsInput, ...func(*Options)) (*GetTableVersionsOutput, error) +} + +var _ GetTableVersionsAPIClient = (*Client)(nil) + +// GetTableVersionsPaginatorOptions is the paginator options for GetTableVersions +type GetTableVersionsPaginatorOptions struct { + // The maximum number of table versions to return in one response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetTableVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/glue.GetTableVersions +type GetTableVersionsPaginator struct { + options GetTableVersionsPaginatorOptions + client GetTableVersionsAPIClient + params *GetTableVersionsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetTableVersionsPaginator returns a new GetTableVersionsPaginator +func NewGetTableVersionsPaginator(client GetTableVersionsAPIClient, params *GetTableVersionsInput, optFns ...func(*GetTableVersionsPaginatorOptions)) *GetTableVersionsPaginator { + options := GetTableVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetTableVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetTableVersionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetTableVersions page. +func (p *GetTableVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetTableVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetTableVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// SearchTablesAPIClient is a client that implements the SearchTables operation. +type SearchTablesAPIClient interface { + SearchTables(context.Context, *SearchTablesInput, ...func(*Options)) (*SearchTablesOutput, error) +} + +var _ SearchTablesAPIClient = (*Client)(nil) + +// SearchTablesPaginatorOptions is the paginator options for SearchTables +type SearchTablesPaginatorOptions struct { + // The maximum number of tables to return in a single response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// SearchTablesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/glue.SearchTables +type SearchTablesPaginator struct { + options SearchTablesPaginatorOptions + client SearchTablesAPIClient + params *SearchTablesInput + nextToken *string + firstPage bool + done bool +} + +// NewSearchTablesPaginator returns a new SearchTablesPaginator +func NewSearchTablesPaginator(client SearchTablesAPIClient, params *SearchTablesInput, optFns ...func(*SearchTablesPaginatorOptions)) *SearchTablesPaginator { + options := SearchTablesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &SearchTablesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchTablesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next SearchTables page. +func (p *SearchTablesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchTablesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.SearchTables(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetJobsAPIClient is a client that implements the GetJobs operation. +type GetJobsAPIClient interface { + GetJobs(context.Context, *GetJobsInput, ...func(*Options)) (*GetJobsOutput, error) +} + +var _ GetJobsAPIClient = (*Client)(nil) + +// GetJobsPaginatorOptions is the paginator options for GetJobs +type GetJobsPaginatorOptions struct { + // The maximum size of the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/glue.GetJobs +type GetJobsPaginator struct { + options GetJobsPaginatorOptions + client GetJobsAPIClient + params *GetJobsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetJobsPaginator returns a new GetJobsPaginator +func NewGetJobsPaginator(client GetJobsAPIClient, params *GetJobsInput, optFns ...func(*GetJobsPaginatorOptions)) *GetJobsPaginator { + options := GetJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetJobsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetJobs page. +func (p *GetJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetJobRunsAPIClient is a client that implements the GetJobRuns operation. +type GetJobRunsAPIClient interface { + GetJobRuns(context.Context, *GetJobRunsInput, ...func(*Options)) (*GetJobRunsOutput, error) +} + +var _ GetJobRunsAPIClient = (*Client)(nil) + +// GetJobRunsPaginatorOptions is the paginator options for GetJobRuns +type GetJobRunsPaginatorOptions struct { + // The maximum size of the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetJobRunsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/glue.GetJobRuns +type GetJobRunsPaginator struct { + options GetJobRunsPaginatorOptions + client GetJobRunsAPIClient + params *GetJobRunsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetJobRunsPaginator returns a new GetJobRunsPaginator +func NewGetJobRunsPaginator(client GetJobRunsAPIClient, params *GetJobRunsInput, optFns ...func(*GetJobRunsPaginatorOptions)) *GetJobRunsPaginator { + options := GetJobRunsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetJobRunsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetJobRunsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetJobRuns page. +func (p *GetJobRunsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetJobRunsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetJobRuns(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetCrawlerMetricsAPIClient is a client that implements the GetCrawlerMetrics +// operation. +type GetCrawlerMetricsAPIClient interface { + GetCrawlerMetrics(context.Context, *GetCrawlerMetricsInput, ...func(*Options)) (*GetCrawlerMetricsOutput, error) +} + +var _ GetCrawlerMetricsAPIClient = (*Client)(nil) + +// GetCrawlerMetricsPaginatorOptions is the paginator options for GetCrawlerMetrics +type GetCrawlerMetricsPaginatorOptions struct { + // The maximum size of a list to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetCrawlerMetricsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/glue.GetCrawlerMetrics +type GetCrawlerMetricsPaginator struct { + options GetCrawlerMetricsPaginatorOptions + client GetCrawlerMetricsAPIClient + params *GetCrawlerMetricsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetCrawlerMetricsPaginator returns a new GetCrawlerMetricsPaginator +func NewGetCrawlerMetricsPaginator(client GetCrawlerMetricsAPIClient, params *GetCrawlerMetricsInput, optFns ...func(*GetCrawlerMetricsPaginatorOptions)) *GetCrawlerMetricsPaginator { + options := GetCrawlerMetricsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetCrawlerMetricsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetCrawlerMetricsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetCrawlerMetrics page. +func (p *GetCrawlerMetricsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetCrawlerMetricsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetCrawlerMetrics(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetTablesAPIClient is a client that implements the GetTables operation. +type GetTablesAPIClient interface { + GetTables(context.Context, *GetTablesInput, ...func(*Options)) (*GetTablesOutput, error) +} + +var _ GetTablesAPIClient = (*Client)(nil) + +// GetTablesPaginatorOptions is the paginator options for GetTables +type GetTablesPaginatorOptions struct { + // The maximum number of tables to return in a single response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetTablesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/glue.GetTables +type GetTablesPaginator struct { + options GetTablesPaginatorOptions + client GetTablesAPIClient + params *GetTablesInput + nextToken *string + firstPage bool + done bool +} + +// NewGetTablesPaginator returns a new GetTablesPaginator +func NewGetTablesPaginator(client GetTablesAPIClient, params *GetTablesInput, optFns ...func(*GetTablesPaginatorOptions)) *GetTablesPaginator { + options := GetTablesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetTablesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetTablesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetTables page. +func (p *GetTablesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetTablesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetTables(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetCrawlersAPIClient is a client that implements the GetCrawlers operation. +type GetCrawlersAPIClient interface { + GetCrawlers(context.Context, *GetCrawlersInput, ...func(*Options)) (*GetCrawlersOutput, error) +} + +var _ GetCrawlersAPIClient = (*Client)(nil) + +// GetCrawlersPaginatorOptions is the paginator options for GetCrawlers +type GetCrawlersPaginatorOptions struct { + // The number of crawlers to return on each call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetCrawlersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/glue.GetCrawlers +type GetCrawlersPaginator struct { + options GetCrawlersPaginatorOptions + client GetCrawlersAPIClient + params *GetCrawlersInput + nextToken *string + firstPage bool + done bool +} + +// NewGetCrawlersPaginator returns a new GetCrawlersPaginator +func NewGetCrawlersPaginator(client GetCrawlersAPIClient, params *GetCrawlersInput, optFns ...func(*GetCrawlersPaginatorOptions)) *GetCrawlersPaginator { + options := GetCrawlersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetCrawlersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetCrawlersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetCrawlers page. +func (p *GetCrawlersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetCrawlersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetCrawlers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetPartitionIndexesAPIClient is a client that implements the GetPartitionIndexes +// operation. +type GetPartitionIndexesAPIClient interface { + GetPartitionIndexes(context.Context, *GetPartitionIndexesInput, ...func(*Options)) (*GetPartitionIndexesOutput, error) +} + +var _ GetPartitionIndexesAPIClient = (*Client)(nil) + +// GetPartitionIndexesPaginatorOptions is the paginator options for +// GetPartitionIndexes +type GetPartitionIndexesPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetPartitionIndexesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/glue.GetPartitionIndexes +type GetPartitionIndexesPaginator struct { + options GetPartitionIndexesPaginatorOptions + client GetPartitionIndexesAPIClient + params *GetPartitionIndexesInput + nextToken *string + firstPage bool + done bool +} + +// NewGetPartitionIndexesPaginator returns a new GetPartitionIndexesPaginator +func NewGetPartitionIndexesPaginator(client GetPartitionIndexesAPIClient, params *GetPartitionIndexesInput, optFns ...func(*GetPartitionIndexesPaginatorOptions)) *GetPartitionIndexesPaginator { + options := GetPartitionIndexesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetPartitionIndexesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetPartitionIndexesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetPartitionIndexes page. +func (p *GetPartitionIndexesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetPartitionIndexesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.GetPartitionIndexes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListJobsAPIClient is a client that implements the ListJobs operation. +type ListJobsAPIClient interface { + ListJobs(context.Context, *ListJobsInput, ...func(*Options)) (*ListJobsOutput, error) +} + +var _ ListJobsAPIClient = (*Client)(nil) + +// ListJobsPaginatorOptions is the paginator options for ListJobs +type ListJobsPaginatorOptions struct { + // The maximum size of a list to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/glue.ListJobs +type ListJobsPaginator struct { + options ListJobsPaginatorOptions + client ListJobsAPIClient + params *ListJobsInput + nextToken *string + firstPage bool + done bool +} + +// NewListJobsPaginator returns a new ListJobsPaginator +func NewListJobsPaginator(client ListJobsAPIClient, params *ListJobsInput, optFns ...func(*ListJobsPaginatorOptions)) *ListJobsPaginator { + options := ListJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListJobsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListJobs page. +func (p *ListJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListMLTransformsAPIClient is a client that implements the ListMLTransforms +// operation. +type ListMLTransformsAPIClient interface { + ListMLTransforms(context.Context, *ListMLTransformsInput, ...func(*Options)) (*ListMLTransformsOutput, error) +} + +var _ ListMLTransformsAPIClient = (*Client)(nil) + +// ListMLTransformsPaginatorOptions is the paginator options for ListMLTransforms +type ListMLTransformsPaginatorOptions struct { + // The maximum size of a list to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListMLTransformsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/glue.ListMLTransforms +type ListMLTransformsPaginator struct { + options ListMLTransformsPaginatorOptions + client ListMLTransformsAPIClient + params *ListMLTransformsInput + nextToken *string + firstPage bool + done bool +} + +// NewListMLTransformsPaginator returns a new ListMLTransformsPaginator +func NewListMLTransformsPaginator(client ListMLTransformsAPIClient, params *ListMLTransformsInput, optFns ...func(*ListMLTransformsPaginatorOptions)) *ListMLTransformsPaginator { + options := ListMLTransformsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListMLTransformsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMLTransformsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListMLTransforms page. +func (p *ListMLTransformsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMLTransformsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListMLTransforms(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListCrawlersAPIClient is a client that implements the ListCrawlers operation. +type ListCrawlersAPIClient interface { + ListCrawlers(context.Context, *ListCrawlersInput, ...func(*Options)) (*ListCrawlersOutput, error) +} + +var _ ListCrawlersAPIClient = (*Client)(nil) + +// ListCrawlersPaginatorOptions is the paginator options for ListCrawlers +type ListCrawlersPaginatorOptions struct { + // The maximum size of a list to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListCrawlersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/glue.ListCrawlers +type ListCrawlersPaginator struct { + options ListCrawlersPaginatorOptions + client ListCrawlersAPIClient + params *ListCrawlersInput + nextToken *string + firstPage bool + done bool +} + +// NewListCrawlersPaginator returns a new ListCrawlersPaginator +func NewListCrawlersPaginator(client ListCrawlersAPIClient, params *ListCrawlersInput, optFns ...func(*ListCrawlersPaginatorOptions)) *ListCrawlersPaginator { + options := ListCrawlersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListCrawlersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCrawlersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListCrawlers page. +func (p *ListCrawlersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCrawlersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListCrawlers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetSecurityConfigurationsAPIClient is a client that implements the +// GetSecurityConfigurations operation. +type GetSecurityConfigurationsAPIClient interface { + GetSecurityConfigurations(context.Context, *GetSecurityConfigurationsInput, ...func(*Options)) (*GetSecurityConfigurationsOutput, error) +} + +var _ GetSecurityConfigurationsAPIClient = (*Client)(nil) + +// GetSecurityConfigurationsPaginatorOptions is the paginator options for +// GetSecurityConfigurations +type GetSecurityConfigurationsPaginatorOptions struct { + // The maximum number of results to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetSecurityConfigurationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/glue.GetSecurityConfigurations +type GetSecurityConfigurationsPaginator struct { + options GetSecurityConfigurationsPaginatorOptions + client GetSecurityConfigurationsAPIClient + params *GetSecurityConfigurationsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetSecurityConfigurationsPaginator returns a new +// GetSecurityConfigurationsPaginator +func NewGetSecurityConfigurationsPaginator(client GetSecurityConfigurationsAPIClient, params *GetSecurityConfigurationsInput, optFns ...func(*GetSecurityConfigurationsPaginatorOptions)) *GetSecurityConfigurationsPaginator { + options := GetSecurityConfigurationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetSecurityConfigurationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetSecurityConfigurationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetSecurityConfigurations page. +func (p *GetSecurityConfigurationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetSecurityConfigurationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetSecurityConfigurations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetTriggersAPIClient is a client that implements the GetTriggers operation. +type GetTriggersAPIClient interface { + GetTriggers(context.Context, *GetTriggersInput, ...func(*Options)) (*GetTriggersOutput, error) +} + +var _ GetTriggersAPIClient = (*Client)(nil) + +// GetTriggersPaginatorOptions is the paginator options for GetTriggers +type GetTriggersPaginatorOptions struct { + // The maximum size of the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetTriggersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/glue.GetTriggers +type GetTriggersPaginator struct { + options GetTriggersPaginatorOptions + client GetTriggersAPIClient + params *GetTriggersInput + nextToken *string + firstPage bool + done bool +} + +// NewGetTriggersPaginator returns a new GetTriggersPaginator +func NewGetTriggersPaginator(client GetTriggersAPIClient, params *GetTriggersInput, optFns ...func(*GetTriggersPaginatorOptions)) *GetTriggersPaginator { + options := GetTriggersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetTriggersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetTriggersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetTriggers page. +func (p *GetTriggersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetTriggersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetTriggers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTriggersAPIClient is a client that implements the ListTriggers operation. +type ListTriggersAPIClient interface { + ListTriggers(context.Context, *ListTriggersInput, ...func(*Options)) (*ListTriggersOutput, error) +} + +var _ ListTriggersAPIClient = (*Client)(nil) + +// ListTriggersPaginatorOptions is the paginator options for ListTriggers +type ListTriggersPaginatorOptions struct { + // The maximum size of a list to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTriggersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/glue.ListTriggers +type ListTriggersPaginator struct { + options ListTriggersPaginatorOptions + client ListTriggersAPIClient + params *ListTriggersInput + nextToken *string + firstPage bool + done bool +} + +// NewListTriggersPaginator returns a new ListTriggersPaginator +func NewListTriggersPaginator(client ListTriggersAPIClient, params *ListTriggersInput, optFns ...func(*ListTriggersPaginatorOptions)) *ListTriggersPaginator { + options := ListTriggersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTriggersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTriggersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTriggers page. +func (p *ListTriggersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTriggersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListTriggers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetPartitionsAPIClient is a client that implements the GetPartitions operation. +type GetPartitionsAPIClient interface { + GetPartitions(context.Context, *GetPartitionsInput, ...func(*Options)) (*GetPartitionsOutput, error) +} + +var _ GetPartitionsAPIClient = (*Client)(nil) + +// GetPartitionsPaginatorOptions is the paginator options for GetPartitions +type GetPartitionsPaginatorOptions struct { + // The maximum number of partitions to return in a single response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetPartitionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/glue.GetPartitions +type GetPartitionsPaginator struct { + options GetPartitionsPaginatorOptions + client GetPartitionsAPIClient + params *GetPartitionsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetPartitionsPaginator returns a new GetPartitionsPaginator +func NewGetPartitionsPaginator(client GetPartitionsAPIClient, params *GetPartitionsInput, optFns ...func(*GetPartitionsPaginatorOptions)) *GetPartitionsPaginator { + options := GetPartitionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetPartitionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetPartitionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetPartitions page. +func (p *GetPartitionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetPartitionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetPartitions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetMLTransformsAPIClient is a client that implements the GetMLTransforms +// operation. +type GetMLTransformsAPIClient interface { + GetMLTransforms(context.Context, *GetMLTransformsInput, ...func(*Options)) (*GetMLTransformsOutput, error) +} + +var _ GetMLTransformsAPIClient = (*Client)(nil) + +// GetMLTransformsPaginatorOptions is the paginator options for GetMLTransforms +type GetMLTransformsPaginatorOptions struct { + // The maximum number of results to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetMLTransformsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/glue.GetMLTransforms +type GetMLTransformsPaginator struct { + options GetMLTransformsPaginatorOptions + client GetMLTransformsAPIClient + params *GetMLTransformsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetMLTransformsPaginator returns a new GetMLTransformsPaginator +func NewGetMLTransformsPaginator(client GetMLTransformsAPIClient, params *GetMLTransformsInput, optFns ...func(*GetMLTransformsPaginatorOptions)) *GetMLTransformsPaginator { + options := GetMLTransformsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetMLTransformsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetMLTransformsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetMLTransforms page. +func (p *GetMLTransformsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetMLTransformsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetMLTransforms(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetWorkflowRunsAPIClient is a client that implements the GetWorkflowRuns +// operation. +type GetWorkflowRunsAPIClient interface { + GetWorkflowRuns(context.Context, *GetWorkflowRunsInput, ...func(*Options)) (*GetWorkflowRunsOutput, error) +} + +var _ GetWorkflowRunsAPIClient = (*Client)(nil) + +// GetWorkflowRunsPaginatorOptions is the paginator options for GetWorkflowRuns +type GetWorkflowRunsPaginatorOptions struct { + // The maximum number of workflow runs to be included in the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetWorkflowRunsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/glue.GetWorkflowRuns +type GetWorkflowRunsPaginator struct { + options GetWorkflowRunsPaginatorOptions + client GetWorkflowRunsAPIClient + params *GetWorkflowRunsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetWorkflowRunsPaginator returns a new GetWorkflowRunsPaginator +func NewGetWorkflowRunsPaginator(client GetWorkflowRunsAPIClient, params *GetWorkflowRunsInput, optFns ...func(*GetWorkflowRunsPaginatorOptions)) *GetWorkflowRunsPaginator { + options := GetWorkflowRunsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetWorkflowRunsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetWorkflowRunsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetWorkflowRuns page. +func (p *GetWorkflowRunsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetWorkflowRunsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetWorkflowRuns(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListWorkflowsAPIClient is a client that implements the ListWorkflows operation. +type ListWorkflowsAPIClient interface { + ListWorkflows(context.Context, *ListWorkflowsInput, ...func(*Options)) (*ListWorkflowsOutput, error) +} + +var _ ListWorkflowsAPIClient = (*Client)(nil) + +// ListWorkflowsPaginatorOptions is the paginator options for ListWorkflows +type ListWorkflowsPaginatorOptions struct { + // The maximum size of a list to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListWorkflowsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/glue.ListWorkflows +type ListWorkflowsPaginator struct { + options ListWorkflowsPaginatorOptions + client ListWorkflowsAPIClient + params *ListWorkflowsInput + nextToken *string + firstPage bool + done bool +} + +// NewListWorkflowsPaginator returns a new ListWorkflowsPaginator +func NewListWorkflowsPaginator(client ListWorkflowsAPIClient, params *ListWorkflowsInput, optFns ...func(*ListWorkflowsPaginatorOptions)) *ListWorkflowsPaginator { + options := ListWorkflowsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListWorkflowsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListWorkflowsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListWorkflows page. +func (p *ListWorkflowsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListWorkflowsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListWorkflows(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetMLTaskRunsAPIClient is a client that implements the GetMLTaskRuns operation. +type GetMLTaskRunsAPIClient interface { + GetMLTaskRuns(context.Context, *GetMLTaskRunsInput, ...func(*Options)) (*GetMLTaskRunsOutput, error) +} + +var _ GetMLTaskRunsAPIClient = (*Client)(nil) + +// GetMLTaskRunsPaginatorOptions is the paginator options for GetMLTaskRuns +type GetMLTaskRunsPaginatorOptions struct { + // The maximum number of results to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetMLTaskRunsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/glue.GetMLTaskRuns +type GetMLTaskRunsPaginator struct { + options GetMLTaskRunsPaginatorOptions + client GetMLTaskRunsAPIClient + params *GetMLTaskRunsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetMLTaskRunsPaginator returns a new GetMLTaskRunsPaginator +func NewGetMLTaskRunsPaginator(client GetMLTaskRunsAPIClient, params *GetMLTaskRunsInput, optFns ...func(*GetMLTaskRunsPaginatorOptions)) *GetMLTaskRunsPaginator { + options := GetMLTaskRunsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetMLTaskRunsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetMLTaskRunsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetMLTaskRuns page. +func (p *GetMLTaskRunsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetMLTaskRunsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetMLTaskRuns(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetDevEndpointsAPIClient is a client that implements the GetDevEndpoints +// operation. +type GetDevEndpointsAPIClient interface { + GetDevEndpoints(context.Context, *GetDevEndpointsInput, ...func(*Options)) (*GetDevEndpointsOutput, error) +} + +var _ GetDevEndpointsAPIClient = (*Client)(nil) + +// GetDevEndpointsPaginatorOptions is the paginator options for GetDevEndpoints +type GetDevEndpointsPaginatorOptions struct { + // The maximum size of information to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetDevEndpointsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/glue.GetDevEndpoints +type GetDevEndpointsPaginator struct { + options GetDevEndpointsPaginatorOptions + client GetDevEndpointsAPIClient + params *GetDevEndpointsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetDevEndpointsPaginator returns a new GetDevEndpointsPaginator +func NewGetDevEndpointsPaginator(client GetDevEndpointsAPIClient, params *GetDevEndpointsInput, optFns ...func(*GetDevEndpointsPaginatorOptions)) *GetDevEndpointsPaginator { + options := GetDevEndpointsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetDevEndpointsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetDevEndpointsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetDevEndpoints page. +func (p *GetDevEndpointsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetDevEndpointsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetDevEndpoints(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetConnectionsAPIClient is a client that implements the GetConnections +// operation. +type GetConnectionsAPIClient interface { + GetConnections(context.Context, *GetConnectionsInput, ...func(*Options)) (*GetConnectionsOutput, error) +} + +var _ GetConnectionsAPIClient = (*Client)(nil) + +// GetConnectionsPaginatorOptions is the paginator options for GetConnections +type GetConnectionsPaginatorOptions struct { + // The maximum number of connections to return in one response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetConnectionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/glue.GetConnections +type GetConnectionsPaginator struct { + options GetConnectionsPaginatorOptions + client GetConnectionsAPIClient + params *GetConnectionsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetConnectionsPaginator returns a new GetConnectionsPaginator +func NewGetConnectionsPaginator(client GetConnectionsAPIClient, params *GetConnectionsInput, optFns ...func(*GetConnectionsPaginatorOptions)) *GetConnectionsPaginator { + options := GetConnectionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetConnectionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetConnectionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetConnections page. +func (p *GetConnectionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetConnectionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetConnections(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetClassifiersAPIClient is a client that implements the GetClassifiers +// operation. +type GetClassifiersAPIClient interface { + GetClassifiers(context.Context, *GetClassifiersInput, ...func(*Options)) (*GetClassifiersOutput, error) +} + +var _ GetClassifiersAPIClient = (*Client)(nil) + +// GetClassifiersPaginatorOptions is the paginator options for GetClassifiers +type GetClassifiersPaginatorOptions struct { + // The size of the list to return (optional). + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetClassifiersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/glue.GetClassifiers +type GetClassifiersPaginator struct { + options GetClassifiersPaginatorOptions + client GetClassifiersAPIClient + params *GetClassifiersInput + nextToken *string + firstPage bool + done bool +} + +// NewGetClassifiersPaginator returns a new GetClassifiersPaginator +func NewGetClassifiersPaginator(client GetClassifiersAPIClient, params *GetClassifiersInput, optFns ...func(*GetClassifiersPaginatorOptions)) *GetClassifiersPaginator { + options := GetClassifiersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetClassifiersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetClassifiersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetClassifiers page. +func (p *GetClassifiersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetClassifiersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetClassifiers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetUserDefinedFunctionsAPIClient is a client that implements the +// GetUserDefinedFunctions operation. +type GetUserDefinedFunctionsAPIClient interface { + GetUserDefinedFunctions(context.Context, *GetUserDefinedFunctionsInput, ...func(*Options)) (*GetUserDefinedFunctionsOutput, error) +} + +var _ GetUserDefinedFunctionsAPIClient = (*Client)(nil) + +// GetUserDefinedFunctionsPaginatorOptions is the paginator options for +// GetUserDefinedFunctions +type GetUserDefinedFunctionsPaginatorOptions struct { + // The maximum number of functions to return in one response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetUserDefinedFunctionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/glue.GetUserDefinedFunctions +type GetUserDefinedFunctionsPaginator struct { + options GetUserDefinedFunctionsPaginatorOptions + client GetUserDefinedFunctionsAPIClient + params *GetUserDefinedFunctionsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetUserDefinedFunctionsPaginator returns a new +// GetUserDefinedFunctionsPaginator +func NewGetUserDefinedFunctionsPaginator(client GetUserDefinedFunctionsAPIClient, params *GetUserDefinedFunctionsInput, optFns ...func(*GetUserDefinedFunctionsPaginatorOptions)) *GetUserDefinedFunctionsPaginator { + options := GetUserDefinedFunctionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetUserDefinedFunctionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetUserDefinedFunctionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetUserDefinedFunctions page. +func (p *GetUserDefinedFunctionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetUserDefinedFunctionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetUserDefinedFunctions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/greengrass/go.sum b/service/greengrass/go.sum index c669e324b14..32595049f96 100644 --- a/service/greengrass/go.sum +++ b/service/greengrass/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/groundstation/go.sum b/service/groundstation/go.sum index c669e324b14..32595049f96 100644 --- a/service/groundstation/go.sum +++ b/service/groundstation/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/groundstation/paginators.go b/service/groundstation/paginators.go new file mode 100644 index 00000000000..e1cb2c96f7e --- /dev/null +++ b/service/groundstation/paginators.go @@ -0,0 +1,460 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package groundstation + +import ( + "context" + "fmt" +) + +// ListMissionProfilesAPIClient is a client that implements the ListMissionProfiles +// operation. +type ListMissionProfilesAPIClient interface { + ListMissionProfiles(context.Context, *ListMissionProfilesInput, ...func(*Options)) (*ListMissionProfilesOutput, error) +} + +var _ ListMissionProfilesAPIClient = (*Client)(nil) + +// ListMissionProfilesPaginatorOptions is the paginator options for +// ListMissionProfiles +type ListMissionProfilesPaginatorOptions struct { + // Maximum number of mission profiles returned. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListMissionProfilesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/groundstation.ListMissionProfiles +type ListMissionProfilesPaginator struct { + options ListMissionProfilesPaginatorOptions + client ListMissionProfilesAPIClient + params *ListMissionProfilesInput + nextToken *string + firstPage bool + done bool +} + +// NewListMissionProfilesPaginator returns a new ListMissionProfilesPaginator +func NewListMissionProfilesPaginator(client ListMissionProfilesAPIClient, params *ListMissionProfilesInput, optFns ...func(*ListMissionProfilesPaginatorOptions)) *ListMissionProfilesPaginator { + options := ListMissionProfilesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListMissionProfilesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMissionProfilesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListMissionProfiles page. +func (p *ListMissionProfilesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMissionProfilesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListMissionProfiles(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDataflowEndpointGroupsAPIClient is a client that implements the +// ListDataflowEndpointGroups operation. +type ListDataflowEndpointGroupsAPIClient interface { + ListDataflowEndpointGroups(context.Context, *ListDataflowEndpointGroupsInput, ...func(*Options)) (*ListDataflowEndpointGroupsOutput, error) +} + +var _ ListDataflowEndpointGroupsAPIClient = (*Client)(nil) + +// ListDataflowEndpointGroupsPaginatorOptions is the paginator options for +// ListDataflowEndpointGroups +type ListDataflowEndpointGroupsPaginatorOptions struct { + // Maximum number of dataflow endpoint groups returned. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDataflowEndpointGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/groundstation.ListDataflowEndpointGroups +type ListDataflowEndpointGroupsPaginator struct { + options ListDataflowEndpointGroupsPaginatorOptions + client ListDataflowEndpointGroupsAPIClient + params *ListDataflowEndpointGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewListDataflowEndpointGroupsPaginator returns a new +// ListDataflowEndpointGroupsPaginator +func NewListDataflowEndpointGroupsPaginator(client ListDataflowEndpointGroupsAPIClient, params *ListDataflowEndpointGroupsInput, optFns ...func(*ListDataflowEndpointGroupsPaginatorOptions)) *ListDataflowEndpointGroupsPaginator { + options := ListDataflowEndpointGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDataflowEndpointGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDataflowEndpointGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDataflowEndpointGroups page. +func (p *ListDataflowEndpointGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDataflowEndpointGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListDataflowEndpointGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListSatellitesAPIClient is a client that implements the ListSatellites +// operation. +type ListSatellitesAPIClient interface { + ListSatellites(context.Context, *ListSatellitesInput, ...func(*Options)) (*ListSatellitesOutput, error) +} + +var _ ListSatellitesAPIClient = (*Client)(nil) + +// ListSatellitesPaginatorOptions is the paginator options for ListSatellites +type ListSatellitesPaginatorOptions struct { + // Maximum number of satellites returned. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListSatellitesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/groundstation.ListSatellites +type ListSatellitesPaginator struct { + options ListSatellitesPaginatorOptions + client ListSatellitesAPIClient + params *ListSatellitesInput + nextToken *string + firstPage bool + done bool +} + +// NewListSatellitesPaginator returns a new ListSatellitesPaginator +func NewListSatellitesPaginator(client ListSatellitesAPIClient, params *ListSatellitesInput, optFns ...func(*ListSatellitesPaginatorOptions)) *ListSatellitesPaginator { + options := ListSatellitesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListSatellitesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSatellitesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListSatellites page. +func (p *ListSatellitesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSatellitesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListSatellites(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListGroundStationsAPIClient is a client that implements the ListGroundStations +// operation. +type ListGroundStationsAPIClient interface { + ListGroundStations(context.Context, *ListGroundStationsInput, ...func(*Options)) (*ListGroundStationsOutput, error) +} + +var _ ListGroundStationsAPIClient = (*Client)(nil) + +// ListGroundStationsPaginatorOptions is the paginator options for +// ListGroundStations +type ListGroundStationsPaginatorOptions struct { + // Maximum number of ground stations returned. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListGroundStationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/groundstation.ListGroundStations +type ListGroundStationsPaginator struct { + options ListGroundStationsPaginatorOptions + client ListGroundStationsAPIClient + params *ListGroundStationsInput + nextToken *string + firstPage bool + done bool +} + +// NewListGroundStationsPaginator returns a new ListGroundStationsPaginator +func NewListGroundStationsPaginator(client ListGroundStationsAPIClient, params *ListGroundStationsInput, optFns ...func(*ListGroundStationsPaginatorOptions)) *ListGroundStationsPaginator { + options := ListGroundStationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListGroundStationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListGroundStationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListGroundStations page. +func (p *ListGroundStationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListGroundStationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListGroundStations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListContactsAPIClient is a client that implements the ListContacts operation. +type ListContactsAPIClient interface { + ListContacts(context.Context, *ListContactsInput, ...func(*Options)) (*ListContactsOutput, error) +} + +var _ ListContactsAPIClient = (*Client)(nil) + +// ListContactsPaginatorOptions is the paginator options for ListContacts +type ListContactsPaginatorOptions struct { + // Maximum number of contacts returned. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListContactsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/groundstation.ListContacts +type ListContactsPaginator struct { + options ListContactsPaginatorOptions + client ListContactsAPIClient + params *ListContactsInput + nextToken *string + firstPage bool + done bool +} + +// NewListContactsPaginator returns a new ListContactsPaginator +func NewListContactsPaginator(client ListContactsAPIClient, params *ListContactsInput, optFns ...func(*ListContactsPaginatorOptions)) *ListContactsPaginator { + options := ListContactsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListContactsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListContactsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListContacts page. +func (p *ListContactsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListContactsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListContacts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListConfigsAPIClient is a client that implements the ListConfigs operation. +type ListConfigsAPIClient interface { + ListConfigs(context.Context, *ListConfigsInput, ...func(*Options)) (*ListConfigsOutput, error) +} + +var _ ListConfigsAPIClient = (*Client)(nil) + +// ListConfigsPaginatorOptions is the paginator options for ListConfigs +type ListConfigsPaginatorOptions struct { + // Maximum number of Configs returned. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListConfigsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/groundstation.ListConfigs +type ListConfigsPaginator struct { + options ListConfigsPaginatorOptions + client ListConfigsAPIClient + params *ListConfigsInput + nextToken *string + firstPage bool + done bool +} + +// NewListConfigsPaginator returns a new ListConfigsPaginator +func NewListConfigsPaginator(client ListConfigsAPIClient, params *ListConfigsInput, optFns ...func(*ListConfigsPaginatorOptions)) *ListConfigsPaginator { + options := ListConfigsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListConfigsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListConfigsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListConfigs page. +func (p *ListConfigsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListConfigsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListConfigs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/guardduty/go.sum b/service/guardduty/go.sum index c669e324b14..32595049f96 100644 --- a/service/guardduty/go.sum +++ b/service/guardduty/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/guardduty/paginators.go b/service/guardduty/paginators.go new file mode 100644 index 00000000000..e0444ea7d58 --- /dev/null +++ b/service/guardduty/paginators.go @@ -0,0 +1,766 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package guardduty + +import ( + "context" + "fmt" +) + +// ListOrganizationAdminAccountsAPIClient is a client that implements the +// ListOrganizationAdminAccounts operation. +type ListOrganizationAdminAccountsAPIClient interface { + ListOrganizationAdminAccounts(context.Context, *ListOrganizationAdminAccountsInput, ...func(*Options)) (*ListOrganizationAdminAccountsOutput, error) +} + +var _ ListOrganizationAdminAccountsAPIClient = (*Client)(nil) + +// ListOrganizationAdminAccountsPaginatorOptions is the paginator options for +// ListOrganizationAdminAccounts +type ListOrganizationAdminAccountsPaginatorOptions struct { + // The maximum number of results to return in the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListOrganizationAdminAccountsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/guardduty.ListOrganizationAdminAccounts +type ListOrganizationAdminAccountsPaginator struct { + options ListOrganizationAdminAccountsPaginatorOptions + client ListOrganizationAdminAccountsAPIClient + params *ListOrganizationAdminAccountsInput + nextToken *string + firstPage bool + done bool +} + +// NewListOrganizationAdminAccountsPaginator returns a new +// ListOrganizationAdminAccountsPaginator +func NewListOrganizationAdminAccountsPaginator(client ListOrganizationAdminAccountsAPIClient, params *ListOrganizationAdminAccountsInput, optFns ...func(*ListOrganizationAdminAccountsPaginatorOptions)) *ListOrganizationAdminAccountsPaginator { + options := ListOrganizationAdminAccountsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListOrganizationAdminAccountsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListOrganizationAdminAccountsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListOrganizationAdminAccounts page. +func (p *ListOrganizationAdminAccountsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListOrganizationAdminAccountsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListOrganizationAdminAccounts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListMembersAPIClient is a client that implements the ListMembers operation. +type ListMembersAPIClient interface { + ListMembers(context.Context, *ListMembersInput, ...func(*Options)) (*ListMembersOutput, error) +} + +var _ ListMembersAPIClient = (*Client)(nil) + +// ListMembersPaginatorOptions is the paginator options for ListMembers +type ListMembersPaginatorOptions struct { + // You can use this parameter to indicate the maximum number of items you want in + // the response. The default value is 50. The maximum value is 50. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListMembersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/guardduty.ListMembers +type ListMembersPaginator struct { + options ListMembersPaginatorOptions + client ListMembersAPIClient + params *ListMembersInput + nextToken *string + firstPage bool + done bool +} + +// NewListMembersPaginator returns a new ListMembersPaginator +func NewListMembersPaginator(client ListMembersAPIClient, params *ListMembersInput, optFns ...func(*ListMembersPaginatorOptions)) *ListMembersPaginator { + options := ListMembersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListMembersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMembersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListMembers page. +func (p *ListMembersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMembersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListMembers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListFiltersAPIClient is a client that implements the ListFilters operation. +type ListFiltersAPIClient interface { + ListFilters(context.Context, *ListFiltersInput, ...func(*Options)) (*ListFiltersOutput, error) +} + +var _ ListFiltersAPIClient = (*Client)(nil) + +// ListFiltersPaginatorOptions is the paginator options for ListFilters +type ListFiltersPaginatorOptions struct { + // You can use this parameter to indicate the maximum number of items that you want + // in the response. The default value is 50. The maximum value is 50. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListFiltersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/guardduty.ListFilters +type ListFiltersPaginator struct { + options ListFiltersPaginatorOptions + client ListFiltersAPIClient + params *ListFiltersInput + nextToken *string + firstPage bool + done bool +} + +// NewListFiltersPaginator returns a new ListFiltersPaginator +func NewListFiltersPaginator(client ListFiltersAPIClient, params *ListFiltersInput, optFns ...func(*ListFiltersPaginatorOptions)) *ListFiltersPaginator { + options := ListFiltersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListFiltersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListFiltersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListFilters page. +func (p *ListFiltersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFiltersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListFilters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDetectorsAPIClient is a client that implements the ListDetectors operation. +type ListDetectorsAPIClient interface { + ListDetectors(context.Context, *ListDetectorsInput, ...func(*Options)) (*ListDetectorsOutput, error) +} + +var _ ListDetectorsAPIClient = (*Client)(nil) + +// ListDetectorsPaginatorOptions is the paginator options for ListDetectors +type ListDetectorsPaginatorOptions struct { + // You can use this parameter to indicate the maximum number of items that you want + // in the response. The default value is 50. The maximum value is 50. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDetectorsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/guardduty.ListDetectors +type ListDetectorsPaginator struct { + options ListDetectorsPaginatorOptions + client ListDetectorsAPIClient + params *ListDetectorsInput + nextToken *string + firstPage bool + done bool +} + +// NewListDetectorsPaginator returns a new ListDetectorsPaginator +func NewListDetectorsPaginator(client ListDetectorsAPIClient, params *ListDetectorsInput, optFns ...func(*ListDetectorsPaginatorOptions)) *ListDetectorsPaginator { + options := ListDetectorsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDetectorsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDetectorsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDetectors page. +func (p *ListDetectorsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDetectorsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListDetectors(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListFindingsAPIClient is a client that implements the ListFindings operation. +type ListFindingsAPIClient interface { + ListFindings(context.Context, *ListFindingsInput, ...func(*Options)) (*ListFindingsOutput, error) +} + +var _ ListFindingsAPIClient = (*Client)(nil) + +// ListFindingsPaginatorOptions is the paginator options for ListFindings +type ListFindingsPaginatorOptions struct { + // You can use this parameter to indicate the maximum number of items you want in + // the response. The default value is 50. The maximum value is 50. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListFindingsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/guardduty.ListFindings +type ListFindingsPaginator struct { + options ListFindingsPaginatorOptions + client ListFindingsAPIClient + params *ListFindingsInput + nextToken *string + firstPage bool + done bool +} + +// NewListFindingsPaginator returns a new ListFindingsPaginator +func NewListFindingsPaginator(client ListFindingsAPIClient, params *ListFindingsInput, optFns ...func(*ListFindingsPaginatorOptions)) *ListFindingsPaginator { + options := ListFindingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListFindingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListFindingsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListFindings page. +func (p *ListFindingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFindingsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListFindings(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetUsageStatisticsAPIClient is a client that implements the GetUsageStatistics +// operation. +type GetUsageStatisticsAPIClient interface { + GetUsageStatistics(context.Context, *GetUsageStatisticsInput, ...func(*Options)) (*GetUsageStatisticsOutput, error) +} + +var _ GetUsageStatisticsAPIClient = (*Client)(nil) + +// GetUsageStatisticsPaginatorOptions is the paginator options for +// GetUsageStatistics +type GetUsageStatisticsPaginatorOptions struct { + // The maximum number of results to return in the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetUsageStatisticsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/guardduty.GetUsageStatistics +type GetUsageStatisticsPaginator struct { + options GetUsageStatisticsPaginatorOptions + client GetUsageStatisticsAPIClient + params *GetUsageStatisticsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetUsageStatisticsPaginator returns a new GetUsageStatisticsPaginator +func NewGetUsageStatisticsPaginator(client GetUsageStatisticsAPIClient, params *GetUsageStatisticsInput, optFns ...func(*GetUsageStatisticsPaginatorOptions)) *GetUsageStatisticsPaginator { + options := GetUsageStatisticsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetUsageStatisticsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetUsageStatisticsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetUsageStatistics page. +func (p *GetUsageStatisticsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetUsageStatisticsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetUsageStatistics(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListPublishingDestinationsAPIClient is a client that implements the +// ListPublishingDestinations operation. +type ListPublishingDestinationsAPIClient interface { + ListPublishingDestinations(context.Context, *ListPublishingDestinationsInput, ...func(*Options)) (*ListPublishingDestinationsOutput, error) +} + +var _ ListPublishingDestinationsAPIClient = (*Client)(nil) + +// ListPublishingDestinationsPaginatorOptions is the paginator options for +// ListPublishingDestinations +type ListPublishingDestinationsPaginatorOptions struct { + // The maximum number of results to return in the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListPublishingDestinationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/guardduty.ListPublishingDestinations +type ListPublishingDestinationsPaginator struct { + options ListPublishingDestinationsPaginatorOptions + client ListPublishingDestinationsAPIClient + params *ListPublishingDestinationsInput + nextToken *string + firstPage bool + done bool +} + +// NewListPublishingDestinationsPaginator returns a new +// ListPublishingDestinationsPaginator +func NewListPublishingDestinationsPaginator(client ListPublishingDestinationsAPIClient, params *ListPublishingDestinationsInput, optFns ...func(*ListPublishingDestinationsPaginatorOptions)) *ListPublishingDestinationsPaginator { + options := ListPublishingDestinationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListPublishingDestinationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPublishingDestinationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListPublishingDestinations page. +func (p *ListPublishingDestinationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPublishingDestinationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListPublishingDestinations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListInvitationsAPIClient is a client that implements the ListInvitations +// operation. +type ListInvitationsAPIClient interface { + ListInvitations(context.Context, *ListInvitationsInput, ...func(*Options)) (*ListInvitationsOutput, error) +} + +var _ ListInvitationsAPIClient = (*Client)(nil) + +// ListInvitationsPaginatorOptions is the paginator options for ListInvitations +type ListInvitationsPaginatorOptions struct { + // You can use this parameter to indicate the maximum number of items that you want + // in the response. The default value is 50. The maximum value is 50. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListInvitationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/guardduty.ListInvitations +type ListInvitationsPaginator struct { + options ListInvitationsPaginatorOptions + client ListInvitationsAPIClient + params *ListInvitationsInput + nextToken *string + firstPage bool + done bool +} + +// NewListInvitationsPaginator returns a new ListInvitationsPaginator +func NewListInvitationsPaginator(client ListInvitationsAPIClient, params *ListInvitationsInput, optFns ...func(*ListInvitationsPaginatorOptions)) *ListInvitationsPaginator { + options := ListInvitationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListInvitationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListInvitationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListInvitations page. +func (p *ListInvitationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListInvitationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListInvitations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListThreatIntelSetsAPIClient is a client that implements the ListThreatIntelSets +// operation. +type ListThreatIntelSetsAPIClient interface { + ListThreatIntelSets(context.Context, *ListThreatIntelSetsInput, ...func(*Options)) (*ListThreatIntelSetsOutput, error) +} + +var _ ListThreatIntelSetsAPIClient = (*Client)(nil) + +// ListThreatIntelSetsPaginatorOptions is the paginator options for +// ListThreatIntelSets +type ListThreatIntelSetsPaginatorOptions struct { + // You can use this parameter to indicate the maximum number of items that you want + // in the response. The default value is 50. The maximum value is 50. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListThreatIntelSetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/guardduty.ListThreatIntelSets +type ListThreatIntelSetsPaginator struct { + options ListThreatIntelSetsPaginatorOptions + client ListThreatIntelSetsAPIClient + params *ListThreatIntelSetsInput + nextToken *string + firstPage bool + done bool +} + +// NewListThreatIntelSetsPaginator returns a new ListThreatIntelSetsPaginator +func NewListThreatIntelSetsPaginator(client ListThreatIntelSetsAPIClient, params *ListThreatIntelSetsInput, optFns ...func(*ListThreatIntelSetsPaginatorOptions)) *ListThreatIntelSetsPaginator { + options := ListThreatIntelSetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListThreatIntelSetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListThreatIntelSetsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListThreatIntelSets page. +func (p *ListThreatIntelSetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListThreatIntelSetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListThreatIntelSets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListIPSetsAPIClient is a client that implements the ListIPSets operation. +type ListIPSetsAPIClient interface { + ListIPSets(context.Context, *ListIPSetsInput, ...func(*Options)) (*ListIPSetsOutput, error) +} + +var _ ListIPSetsAPIClient = (*Client)(nil) + +// ListIPSetsPaginatorOptions is the paginator options for ListIPSets +type ListIPSetsPaginatorOptions struct { + // You can use this parameter to indicate the maximum number of items you want in + // the response. The default value is 50. The maximum value is 50. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListIPSetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/guardduty.ListIPSets +type ListIPSetsPaginator struct { + options ListIPSetsPaginatorOptions + client ListIPSetsAPIClient + params *ListIPSetsInput + nextToken *string + firstPage bool + done bool +} + +// NewListIPSetsPaginator returns a new ListIPSetsPaginator +func NewListIPSetsPaginator(client ListIPSetsAPIClient, params *ListIPSetsInput, optFns ...func(*ListIPSetsPaginatorOptions)) *ListIPSetsPaginator { + options := ListIPSetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListIPSetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListIPSetsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListIPSets page. +func (p *ListIPSetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListIPSetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListIPSets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/health/go.sum b/service/health/go.sum index c669e324b14..32595049f96 100644 --- a/service/health/go.sum +++ b/service/health/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/health/paginators.go b/service/health/paginators.go new file mode 100644 index 00000000000..a691044545e --- /dev/null +++ b/service/health/paginators.go @@ -0,0 +1,551 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package health + +import ( + "context" + "fmt" +) + +// DescribeAffectedAccountsForOrganizationAPIClient is a client that implements the +// DescribeAffectedAccountsForOrganization operation. +type DescribeAffectedAccountsForOrganizationAPIClient interface { + DescribeAffectedAccountsForOrganization(context.Context, *DescribeAffectedAccountsForOrganizationInput, ...func(*Options)) (*DescribeAffectedAccountsForOrganizationOutput, error) +} + +var _ DescribeAffectedAccountsForOrganizationAPIClient = (*Client)(nil) + +// DescribeAffectedAccountsForOrganizationPaginatorOptions is the paginator options +// for DescribeAffectedAccountsForOrganization +type DescribeAffectedAccountsForOrganizationPaginatorOptions struct { + // The maximum number of items to return in one batch, between 10 and 100, + // inclusive. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeAffectedAccountsForOrganizationPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/health.DescribeAffectedAccountsForOrganization +type DescribeAffectedAccountsForOrganizationPaginator struct { + options DescribeAffectedAccountsForOrganizationPaginatorOptions + client DescribeAffectedAccountsForOrganizationAPIClient + params *DescribeAffectedAccountsForOrganizationInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeAffectedAccountsForOrganizationPaginator returns a new +// DescribeAffectedAccountsForOrganizationPaginator +func NewDescribeAffectedAccountsForOrganizationPaginator(client DescribeAffectedAccountsForOrganizationAPIClient, params *DescribeAffectedAccountsForOrganizationInput, optFns ...func(*DescribeAffectedAccountsForOrganizationPaginatorOptions)) *DescribeAffectedAccountsForOrganizationPaginator { + options := DescribeAffectedAccountsForOrganizationPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeAffectedAccountsForOrganizationPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeAffectedAccountsForOrganizationPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeAffectedAccountsForOrganization page. +func (p *DescribeAffectedAccountsForOrganizationPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeAffectedAccountsForOrganizationOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeAffectedAccountsForOrganization(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeEventsForOrganizationAPIClient is a client that implements the +// DescribeEventsForOrganization operation. +type DescribeEventsForOrganizationAPIClient interface { + DescribeEventsForOrganization(context.Context, *DescribeEventsForOrganizationInput, ...func(*Options)) (*DescribeEventsForOrganizationOutput, error) +} + +var _ DescribeEventsForOrganizationAPIClient = (*Client)(nil) + +// DescribeEventsForOrganizationPaginatorOptions is the paginator options for +// DescribeEventsForOrganization +type DescribeEventsForOrganizationPaginatorOptions struct { + // The maximum number of items to return in one batch, between 10 and 100, + // inclusive. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeEventsForOrganizationPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/health.DescribeEventsForOrganization +type DescribeEventsForOrganizationPaginator struct { + options DescribeEventsForOrganizationPaginatorOptions + client DescribeEventsForOrganizationAPIClient + params *DescribeEventsForOrganizationInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeEventsForOrganizationPaginator returns a new +// DescribeEventsForOrganizationPaginator +func NewDescribeEventsForOrganizationPaginator(client DescribeEventsForOrganizationAPIClient, params *DescribeEventsForOrganizationInput, optFns ...func(*DescribeEventsForOrganizationPaginatorOptions)) *DescribeEventsForOrganizationPaginator { + options := DescribeEventsForOrganizationPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeEventsForOrganizationPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEventsForOrganizationPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeEventsForOrganization page. +func (p *DescribeEventsForOrganizationPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEventsForOrganizationOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeEventsForOrganization(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeAffectedEntitiesForOrganizationAPIClient is a client that implements the +// DescribeAffectedEntitiesForOrganization operation. +type DescribeAffectedEntitiesForOrganizationAPIClient interface { + DescribeAffectedEntitiesForOrganization(context.Context, *DescribeAffectedEntitiesForOrganizationInput, ...func(*Options)) (*DescribeAffectedEntitiesForOrganizationOutput, error) +} + +var _ DescribeAffectedEntitiesForOrganizationAPIClient = (*Client)(nil) + +// DescribeAffectedEntitiesForOrganizationPaginatorOptions is the paginator options +// for DescribeAffectedEntitiesForOrganization +type DescribeAffectedEntitiesForOrganizationPaginatorOptions struct { + // The maximum number of items to return in one batch, between 10 and 100, + // inclusive. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeAffectedEntitiesForOrganizationPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/health.DescribeAffectedEntitiesForOrganization +type DescribeAffectedEntitiesForOrganizationPaginator struct { + options DescribeAffectedEntitiesForOrganizationPaginatorOptions + client DescribeAffectedEntitiesForOrganizationAPIClient + params *DescribeAffectedEntitiesForOrganizationInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeAffectedEntitiesForOrganizationPaginator returns a new +// DescribeAffectedEntitiesForOrganizationPaginator +func NewDescribeAffectedEntitiesForOrganizationPaginator(client DescribeAffectedEntitiesForOrganizationAPIClient, params *DescribeAffectedEntitiesForOrganizationInput, optFns ...func(*DescribeAffectedEntitiesForOrganizationPaginatorOptions)) *DescribeAffectedEntitiesForOrganizationPaginator { + options := DescribeAffectedEntitiesForOrganizationPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeAffectedEntitiesForOrganizationPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeAffectedEntitiesForOrganizationPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeAffectedEntitiesForOrganization page. +func (p *DescribeAffectedEntitiesForOrganizationPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeAffectedEntitiesForOrganizationOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeAffectedEntitiesForOrganization(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeEventAggregatesAPIClient is a client that implements the +// DescribeEventAggregates operation. +type DescribeEventAggregatesAPIClient interface { + DescribeEventAggregates(context.Context, *DescribeEventAggregatesInput, ...func(*Options)) (*DescribeEventAggregatesOutput, error) +} + +var _ DescribeEventAggregatesAPIClient = (*Client)(nil) + +// DescribeEventAggregatesPaginatorOptions is the paginator options for +// DescribeEventAggregates +type DescribeEventAggregatesPaginatorOptions struct { + // The maximum number of items to return in one batch, between 10 and 100, + // inclusive. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeEventAggregatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/health.DescribeEventAggregates +type DescribeEventAggregatesPaginator struct { + options DescribeEventAggregatesPaginatorOptions + client DescribeEventAggregatesAPIClient + params *DescribeEventAggregatesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeEventAggregatesPaginator returns a new +// DescribeEventAggregatesPaginator +func NewDescribeEventAggregatesPaginator(client DescribeEventAggregatesAPIClient, params *DescribeEventAggregatesInput, optFns ...func(*DescribeEventAggregatesPaginatorOptions)) *DescribeEventAggregatesPaginator { + options := DescribeEventAggregatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeEventAggregatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEventAggregatesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeEventAggregates page. +func (p *DescribeEventAggregatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEventAggregatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeEventAggregates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeEventTypesAPIClient is a client that implements the DescribeEventTypes +// operation. +type DescribeEventTypesAPIClient interface { + DescribeEventTypes(context.Context, *DescribeEventTypesInput, ...func(*Options)) (*DescribeEventTypesOutput, error) +} + +var _ DescribeEventTypesAPIClient = (*Client)(nil) + +// DescribeEventTypesPaginatorOptions is the paginator options for +// DescribeEventTypes +type DescribeEventTypesPaginatorOptions struct { + // The maximum number of items to return in one batch, between 10 and 100, + // inclusive. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeEventTypesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/health.DescribeEventTypes +type DescribeEventTypesPaginator struct { + options DescribeEventTypesPaginatorOptions + client DescribeEventTypesAPIClient + params *DescribeEventTypesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeEventTypesPaginator returns a new DescribeEventTypesPaginator +func NewDescribeEventTypesPaginator(client DescribeEventTypesAPIClient, params *DescribeEventTypesInput, optFns ...func(*DescribeEventTypesPaginatorOptions)) *DescribeEventTypesPaginator { + options := DescribeEventTypesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeEventTypesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEventTypesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeEventTypes page. +func (p *DescribeEventTypesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEventTypesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeEventTypes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeAffectedEntitiesAPIClient is a client that implements the +// DescribeAffectedEntities operation. +type DescribeAffectedEntitiesAPIClient interface { + DescribeAffectedEntities(context.Context, *DescribeAffectedEntitiesInput, ...func(*Options)) (*DescribeAffectedEntitiesOutput, error) +} + +var _ DescribeAffectedEntitiesAPIClient = (*Client)(nil) + +// DescribeAffectedEntitiesPaginatorOptions is the paginator options for +// DescribeAffectedEntities +type DescribeAffectedEntitiesPaginatorOptions struct { + // The maximum number of items to return in one batch, between 10 and 100, + // inclusive. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeAffectedEntitiesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/health.DescribeAffectedEntities +type DescribeAffectedEntitiesPaginator struct { + options DescribeAffectedEntitiesPaginatorOptions + client DescribeAffectedEntitiesAPIClient + params *DescribeAffectedEntitiesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeAffectedEntitiesPaginator returns a new +// DescribeAffectedEntitiesPaginator +func NewDescribeAffectedEntitiesPaginator(client DescribeAffectedEntitiesAPIClient, params *DescribeAffectedEntitiesInput, optFns ...func(*DescribeAffectedEntitiesPaginatorOptions)) *DescribeAffectedEntitiesPaginator { + options := DescribeAffectedEntitiesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeAffectedEntitiesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeAffectedEntitiesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeAffectedEntities page. +func (p *DescribeAffectedEntitiesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeAffectedEntitiesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeAffectedEntities(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeEventsAPIClient is a client that implements the DescribeEvents +// operation. +type DescribeEventsAPIClient interface { + DescribeEvents(context.Context, *DescribeEventsInput, ...func(*Options)) (*DescribeEventsOutput, error) +} + +var _ DescribeEventsAPIClient = (*Client)(nil) + +// DescribeEventsPaginatorOptions is the paginator options for DescribeEvents +type DescribeEventsPaginatorOptions struct { + // The maximum number of items to return in one batch, between 10 and 100, + // inclusive. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeEventsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/health.DescribeEvents +type DescribeEventsPaginator struct { + options DescribeEventsPaginatorOptions + client DescribeEventsAPIClient + params *DescribeEventsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeEventsPaginator returns a new DescribeEventsPaginator +func NewDescribeEventsPaginator(client DescribeEventsAPIClient, params *DescribeEventsInput, optFns ...func(*DescribeEventsPaginatorOptions)) *DescribeEventsPaginator { + options := DescribeEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeEventsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEventsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeEvents page. +func (p *DescribeEventsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEventsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeEvents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/honeycode/go.sum b/service/honeycode/go.sum index c669e324b14..32595049f96 100644 --- a/service/honeycode/go.sum +++ b/service/honeycode/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/iam/go.sum b/service/iam/go.sum index c669e324b14..32595049f96 100644 --- a/service/iam/go.sum +++ b/service/iam/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/iam/paginators.go b/service/iam/paginators.go new file mode 100644 index 00000000000..6e3e71dd370 --- /dev/null +++ b/service/iam/paginators.go @@ -0,0 +1,2130 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iam + +import ( + "context" + "fmt" +) + +// ListAttachedUserPoliciesAPIClient is a client that implements the +// ListAttachedUserPolicies operation. +type ListAttachedUserPoliciesAPIClient interface { + ListAttachedUserPolicies(context.Context, *ListAttachedUserPoliciesInput, ...func(*Options)) (*ListAttachedUserPoliciesOutput, error) +} + +var _ ListAttachedUserPoliciesAPIClient = (*Client)(nil) + +// ListAttachedUserPoliciesPaginatorOptions is the paginator options for +// ListAttachedUserPolicies +type ListAttachedUserPoliciesPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAttachedUserPoliciesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.ListAttachedUserPolicies +type ListAttachedUserPoliciesPaginator struct { + options ListAttachedUserPoliciesPaginatorOptions + client ListAttachedUserPoliciesAPIClient + params *ListAttachedUserPoliciesInput + nextToken *string + firstPage bool + done bool +} + +// NewListAttachedUserPoliciesPaginator returns a new +// ListAttachedUserPoliciesPaginator +func NewListAttachedUserPoliciesPaginator(client ListAttachedUserPoliciesAPIClient, params *ListAttachedUserPoliciesInput, optFns ...func(*ListAttachedUserPoliciesPaginatorOptions)) *ListAttachedUserPoliciesPaginator { + options := ListAttachedUserPoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAttachedUserPoliciesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAttachedUserPoliciesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAttachedUserPolicies page. +func (p *ListAttachedUserPoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAttachedUserPoliciesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxItems = p.options.Limit + result, err := p.client.ListAttachedUserPolicies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListInstanceProfilesForRoleAPIClient is a client that implements the +// ListInstanceProfilesForRole operation. +type ListInstanceProfilesForRoleAPIClient interface { + ListInstanceProfilesForRole(context.Context, *ListInstanceProfilesForRoleInput, ...func(*Options)) (*ListInstanceProfilesForRoleOutput, error) +} + +var _ ListInstanceProfilesForRoleAPIClient = (*Client)(nil) + +// ListInstanceProfilesForRolePaginatorOptions is the paginator options for +// ListInstanceProfilesForRole +type ListInstanceProfilesForRolePaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListInstanceProfilesForRolePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.ListInstanceProfilesForRole +type ListInstanceProfilesForRolePaginator struct { + options ListInstanceProfilesForRolePaginatorOptions + client ListInstanceProfilesForRoleAPIClient + params *ListInstanceProfilesForRoleInput + nextToken *string + firstPage bool + done bool +} + +// NewListInstanceProfilesForRolePaginator returns a new +// ListInstanceProfilesForRolePaginator +func NewListInstanceProfilesForRolePaginator(client ListInstanceProfilesForRoleAPIClient, params *ListInstanceProfilesForRoleInput, optFns ...func(*ListInstanceProfilesForRolePaginatorOptions)) *ListInstanceProfilesForRolePaginator { + options := ListInstanceProfilesForRolePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListInstanceProfilesForRolePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListInstanceProfilesForRolePaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListInstanceProfilesForRole page. +func (p *ListInstanceProfilesForRolePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListInstanceProfilesForRoleOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxItems = p.options.Limit + result, err := p.client.ListInstanceProfilesForRole(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetAccountAuthorizationDetailsAPIClient is a client that implements the +// GetAccountAuthorizationDetails operation. +type GetAccountAuthorizationDetailsAPIClient interface { + GetAccountAuthorizationDetails(context.Context, *GetAccountAuthorizationDetailsInput, ...func(*Options)) (*GetAccountAuthorizationDetailsOutput, error) +} + +var _ GetAccountAuthorizationDetailsAPIClient = (*Client)(nil) + +// GetAccountAuthorizationDetailsPaginatorOptions is the paginator options for +// GetAccountAuthorizationDetails +type GetAccountAuthorizationDetailsPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetAccountAuthorizationDetailsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.GetAccountAuthorizationDetails +type GetAccountAuthorizationDetailsPaginator struct { + options GetAccountAuthorizationDetailsPaginatorOptions + client GetAccountAuthorizationDetailsAPIClient + params *GetAccountAuthorizationDetailsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetAccountAuthorizationDetailsPaginator returns a new +// GetAccountAuthorizationDetailsPaginator +func NewGetAccountAuthorizationDetailsPaginator(client GetAccountAuthorizationDetailsAPIClient, params *GetAccountAuthorizationDetailsInput, optFns ...func(*GetAccountAuthorizationDetailsPaginatorOptions)) *GetAccountAuthorizationDetailsPaginator { + options := GetAccountAuthorizationDetailsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetAccountAuthorizationDetailsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetAccountAuthorizationDetailsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetAccountAuthorizationDetails page. +func (p *GetAccountAuthorizationDetailsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetAccountAuthorizationDetailsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxItems = p.options.Limit + result, err := p.client.GetAccountAuthorizationDetails(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListUserPoliciesAPIClient is a client that implements the ListUserPolicies +// operation. +type ListUserPoliciesAPIClient interface { + ListUserPolicies(context.Context, *ListUserPoliciesInput, ...func(*Options)) (*ListUserPoliciesOutput, error) +} + +var _ ListUserPoliciesAPIClient = (*Client)(nil) + +// ListUserPoliciesPaginatorOptions is the paginator options for ListUserPolicies +type ListUserPoliciesPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListUserPoliciesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.ListUserPolicies +type ListUserPoliciesPaginator struct { + options ListUserPoliciesPaginatorOptions + client ListUserPoliciesAPIClient + params *ListUserPoliciesInput + nextToken *string + firstPage bool + done bool +} + +// NewListUserPoliciesPaginator returns a new ListUserPoliciesPaginator +func NewListUserPoliciesPaginator(client ListUserPoliciesAPIClient, params *ListUserPoliciesInput, optFns ...func(*ListUserPoliciesPaginatorOptions)) *ListUserPoliciesPaginator { + options := ListUserPoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListUserPoliciesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListUserPoliciesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListUserPolicies page. +func (p *ListUserPoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListUserPoliciesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxItems = p.options.Limit + result, err := p.client.ListUserPolicies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListVirtualMFADevicesAPIClient is a client that implements the +// ListVirtualMFADevices operation. +type ListVirtualMFADevicesAPIClient interface { + ListVirtualMFADevices(context.Context, *ListVirtualMFADevicesInput, ...func(*Options)) (*ListVirtualMFADevicesOutput, error) +} + +var _ ListVirtualMFADevicesAPIClient = (*Client)(nil) + +// ListVirtualMFADevicesPaginatorOptions is the paginator options for +// ListVirtualMFADevices +type ListVirtualMFADevicesPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListVirtualMFADevicesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.ListVirtualMFADevices +type ListVirtualMFADevicesPaginator struct { + options ListVirtualMFADevicesPaginatorOptions + client ListVirtualMFADevicesAPIClient + params *ListVirtualMFADevicesInput + nextToken *string + firstPage bool + done bool +} + +// NewListVirtualMFADevicesPaginator returns a new ListVirtualMFADevicesPaginator +func NewListVirtualMFADevicesPaginator(client ListVirtualMFADevicesAPIClient, params *ListVirtualMFADevicesInput, optFns ...func(*ListVirtualMFADevicesPaginatorOptions)) *ListVirtualMFADevicesPaginator { + options := ListVirtualMFADevicesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListVirtualMFADevicesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListVirtualMFADevicesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListVirtualMFADevices page. +func (p *ListVirtualMFADevicesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListVirtualMFADevicesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxItems = p.options.Limit + result, err := p.client.ListVirtualMFADevices(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListServerCertificatesAPIClient is a client that implements the +// ListServerCertificates operation. +type ListServerCertificatesAPIClient interface { + ListServerCertificates(context.Context, *ListServerCertificatesInput, ...func(*Options)) (*ListServerCertificatesOutput, error) +} + +var _ ListServerCertificatesAPIClient = (*Client)(nil) + +// ListServerCertificatesPaginatorOptions is the paginator options for +// ListServerCertificates +type ListServerCertificatesPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListServerCertificatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.ListServerCertificates +type ListServerCertificatesPaginator struct { + options ListServerCertificatesPaginatorOptions + client ListServerCertificatesAPIClient + params *ListServerCertificatesInput + nextToken *string + firstPage bool + done bool +} + +// NewListServerCertificatesPaginator returns a new ListServerCertificatesPaginator +func NewListServerCertificatesPaginator(client ListServerCertificatesAPIClient, params *ListServerCertificatesInput, optFns ...func(*ListServerCertificatesPaginatorOptions)) *ListServerCertificatesPaginator { + options := ListServerCertificatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListServerCertificatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListServerCertificatesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListServerCertificates page. +func (p *ListServerCertificatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListServerCertificatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxItems = p.options.Limit + result, err := p.client.ListServerCertificates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListAccountAliasesAPIClient is a client that implements the ListAccountAliases +// operation. +type ListAccountAliasesAPIClient interface { + ListAccountAliases(context.Context, *ListAccountAliasesInput, ...func(*Options)) (*ListAccountAliasesOutput, error) +} + +var _ ListAccountAliasesAPIClient = (*Client)(nil) + +// ListAccountAliasesPaginatorOptions is the paginator options for +// ListAccountAliases +type ListAccountAliasesPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAccountAliasesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.ListAccountAliases +type ListAccountAliasesPaginator struct { + options ListAccountAliasesPaginatorOptions + client ListAccountAliasesAPIClient + params *ListAccountAliasesInput + nextToken *string + firstPage bool + done bool +} + +// NewListAccountAliasesPaginator returns a new ListAccountAliasesPaginator +func NewListAccountAliasesPaginator(client ListAccountAliasesAPIClient, params *ListAccountAliasesInput, optFns ...func(*ListAccountAliasesPaginatorOptions)) *ListAccountAliasesPaginator { + options := ListAccountAliasesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAccountAliasesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAccountAliasesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAccountAliases page. +func (p *ListAccountAliasesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccountAliasesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxItems = p.options.Limit + result, err := p.client.ListAccountAliases(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListSSHPublicKeysAPIClient is a client that implements the ListSSHPublicKeys +// operation. +type ListSSHPublicKeysAPIClient interface { + ListSSHPublicKeys(context.Context, *ListSSHPublicKeysInput, ...func(*Options)) (*ListSSHPublicKeysOutput, error) +} + +var _ ListSSHPublicKeysAPIClient = (*Client)(nil) + +// ListSSHPublicKeysPaginatorOptions is the paginator options for ListSSHPublicKeys +type ListSSHPublicKeysPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListSSHPublicKeysPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.ListSSHPublicKeys +type ListSSHPublicKeysPaginator struct { + options ListSSHPublicKeysPaginatorOptions + client ListSSHPublicKeysAPIClient + params *ListSSHPublicKeysInput + nextToken *string + firstPage bool + done bool +} + +// NewListSSHPublicKeysPaginator returns a new ListSSHPublicKeysPaginator +func NewListSSHPublicKeysPaginator(client ListSSHPublicKeysAPIClient, params *ListSSHPublicKeysInput, optFns ...func(*ListSSHPublicKeysPaginatorOptions)) *ListSSHPublicKeysPaginator { + options := ListSSHPublicKeysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListSSHPublicKeysPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSSHPublicKeysPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListSSHPublicKeys page. +func (p *ListSSHPublicKeysPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSSHPublicKeysOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxItems = p.options.Limit + result, err := p.client.ListSSHPublicKeys(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// SimulateCustomPolicyAPIClient is a client that implements the +// SimulateCustomPolicy operation. +type SimulateCustomPolicyAPIClient interface { + SimulateCustomPolicy(context.Context, *SimulateCustomPolicyInput, ...func(*Options)) (*SimulateCustomPolicyOutput, error) +} + +var _ SimulateCustomPolicyAPIClient = (*Client)(nil) + +// SimulateCustomPolicyPaginatorOptions is the paginator options for +// SimulateCustomPolicy +type SimulateCustomPolicyPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// SimulateCustomPolicyPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.SimulateCustomPolicy +type SimulateCustomPolicyPaginator struct { + options SimulateCustomPolicyPaginatorOptions + client SimulateCustomPolicyAPIClient + params *SimulateCustomPolicyInput + nextToken *string + firstPage bool + done bool +} + +// NewSimulateCustomPolicyPaginator returns a new SimulateCustomPolicyPaginator +func NewSimulateCustomPolicyPaginator(client SimulateCustomPolicyAPIClient, params *SimulateCustomPolicyInput, optFns ...func(*SimulateCustomPolicyPaginatorOptions)) *SimulateCustomPolicyPaginator { + options := SimulateCustomPolicyPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &SimulateCustomPolicyPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SimulateCustomPolicyPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next SimulateCustomPolicy page. +func (p *SimulateCustomPolicyPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SimulateCustomPolicyOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxItems = p.options.Limit + result, err := p.client.SimulateCustomPolicy(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// SimulatePrincipalPolicyAPIClient is a client that implements the +// SimulatePrincipalPolicy operation. +type SimulatePrincipalPolicyAPIClient interface { + SimulatePrincipalPolicy(context.Context, *SimulatePrincipalPolicyInput, ...func(*Options)) (*SimulatePrincipalPolicyOutput, error) +} + +var _ SimulatePrincipalPolicyAPIClient = (*Client)(nil) + +// SimulatePrincipalPolicyPaginatorOptions is the paginator options for +// SimulatePrincipalPolicy +type SimulatePrincipalPolicyPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// SimulatePrincipalPolicyPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.SimulatePrincipalPolicy +type SimulatePrincipalPolicyPaginator struct { + options SimulatePrincipalPolicyPaginatorOptions + client SimulatePrincipalPolicyAPIClient + params *SimulatePrincipalPolicyInput + nextToken *string + firstPage bool + done bool +} + +// NewSimulatePrincipalPolicyPaginator returns a new +// SimulatePrincipalPolicyPaginator +func NewSimulatePrincipalPolicyPaginator(client SimulatePrincipalPolicyAPIClient, params *SimulatePrincipalPolicyInput, optFns ...func(*SimulatePrincipalPolicyPaginatorOptions)) *SimulatePrincipalPolicyPaginator { + options := SimulatePrincipalPolicyPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &SimulatePrincipalPolicyPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SimulatePrincipalPolicyPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next SimulatePrincipalPolicy page. +func (p *SimulatePrincipalPolicyPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SimulatePrincipalPolicyOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxItems = p.options.Limit + result, err := p.client.SimulatePrincipalPolicy(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListAccessKeysAPIClient is a client that implements the ListAccessKeys +// operation. +type ListAccessKeysAPIClient interface { + ListAccessKeys(context.Context, *ListAccessKeysInput, ...func(*Options)) (*ListAccessKeysOutput, error) +} + +var _ ListAccessKeysAPIClient = (*Client)(nil) + +// ListAccessKeysPaginatorOptions is the paginator options for ListAccessKeys +type ListAccessKeysPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAccessKeysPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.ListAccessKeys +type ListAccessKeysPaginator struct { + options ListAccessKeysPaginatorOptions + client ListAccessKeysAPIClient + params *ListAccessKeysInput + nextToken *string + firstPage bool + done bool +} + +// NewListAccessKeysPaginator returns a new ListAccessKeysPaginator +func NewListAccessKeysPaginator(client ListAccessKeysAPIClient, params *ListAccessKeysInput, optFns ...func(*ListAccessKeysPaginatorOptions)) *ListAccessKeysPaginator { + options := ListAccessKeysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAccessKeysPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAccessKeysPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAccessKeys page. +func (p *ListAccessKeysPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccessKeysOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxItems = p.options.Limit + result, err := p.client.ListAccessKeys(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListGroupPoliciesAPIClient is a client that implements the ListGroupPolicies +// operation. +type ListGroupPoliciesAPIClient interface { + ListGroupPolicies(context.Context, *ListGroupPoliciesInput, ...func(*Options)) (*ListGroupPoliciesOutput, error) +} + +var _ ListGroupPoliciesAPIClient = (*Client)(nil) + +// ListGroupPoliciesPaginatorOptions is the paginator options for ListGroupPolicies +type ListGroupPoliciesPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListGroupPoliciesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.ListGroupPolicies +type ListGroupPoliciesPaginator struct { + options ListGroupPoliciesPaginatorOptions + client ListGroupPoliciesAPIClient + params *ListGroupPoliciesInput + nextToken *string + firstPage bool + done bool +} + +// NewListGroupPoliciesPaginator returns a new ListGroupPoliciesPaginator +func NewListGroupPoliciesPaginator(client ListGroupPoliciesAPIClient, params *ListGroupPoliciesInput, optFns ...func(*ListGroupPoliciesPaginatorOptions)) *ListGroupPoliciesPaginator { + options := ListGroupPoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListGroupPoliciesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListGroupPoliciesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListGroupPolicies page. +func (p *ListGroupPoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListGroupPoliciesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxItems = p.options.Limit + result, err := p.client.ListGroupPolicies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListSigningCertificatesAPIClient is a client that implements the +// ListSigningCertificates operation. +type ListSigningCertificatesAPIClient interface { + ListSigningCertificates(context.Context, *ListSigningCertificatesInput, ...func(*Options)) (*ListSigningCertificatesOutput, error) +} + +var _ ListSigningCertificatesAPIClient = (*Client)(nil) + +// ListSigningCertificatesPaginatorOptions is the paginator options for +// ListSigningCertificates +type ListSigningCertificatesPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListSigningCertificatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.ListSigningCertificates +type ListSigningCertificatesPaginator struct { + options ListSigningCertificatesPaginatorOptions + client ListSigningCertificatesAPIClient + params *ListSigningCertificatesInput + nextToken *string + firstPage bool + done bool +} + +// NewListSigningCertificatesPaginator returns a new +// ListSigningCertificatesPaginator +func NewListSigningCertificatesPaginator(client ListSigningCertificatesAPIClient, params *ListSigningCertificatesInput, optFns ...func(*ListSigningCertificatesPaginatorOptions)) *ListSigningCertificatesPaginator { + options := ListSigningCertificatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListSigningCertificatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSigningCertificatesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListSigningCertificates page. +func (p *ListSigningCertificatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSigningCertificatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxItems = p.options.Limit + result, err := p.client.ListSigningCertificates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListPoliciesAPIClient is a client that implements the ListPolicies operation. +type ListPoliciesAPIClient interface { + ListPolicies(context.Context, *ListPoliciesInput, ...func(*Options)) (*ListPoliciesOutput, error) +} + +var _ ListPoliciesAPIClient = (*Client)(nil) + +// ListPoliciesPaginatorOptions is the paginator options for ListPolicies +type ListPoliciesPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListPoliciesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.ListPolicies +type ListPoliciesPaginator struct { + options ListPoliciesPaginatorOptions + client ListPoliciesAPIClient + params *ListPoliciesInput + nextToken *string + firstPage bool + done bool +} + +// NewListPoliciesPaginator returns a new ListPoliciesPaginator +func NewListPoliciesPaginator(client ListPoliciesAPIClient, params *ListPoliciesInput, optFns ...func(*ListPoliciesPaginatorOptions)) *ListPoliciesPaginator { + options := ListPoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListPoliciesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPoliciesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListPolicies page. +func (p *ListPoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPoliciesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxItems = p.options.Limit + result, err := p.client.ListPolicies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetGroupAPIClient is a client that implements the GetGroup operation. +type GetGroupAPIClient interface { + GetGroup(context.Context, *GetGroupInput, ...func(*Options)) (*GetGroupOutput, error) +} + +var _ GetGroupAPIClient = (*Client)(nil) + +// GetGroupPaginatorOptions is the paginator options for GetGroup +type GetGroupPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetGroupPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.GetGroup +type GetGroupPaginator struct { + options GetGroupPaginatorOptions + client GetGroupAPIClient + params *GetGroupInput + nextToken *string + firstPage bool + done bool +} + +// NewGetGroupPaginator returns a new GetGroupPaginator +func NewGetGroupPaginator(client GetGroupAPIClient, params *GetGroupInput, optFns ...func(*GetGroupPaginatorOptions)) *GetGroupPaginator { + options := GetGroupPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetGroupPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetGroupPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetGroup page. +func (p *GetGroupPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetGroupOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxItems = p.options.Limit + result, err := p.client.GetGroup(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListRolesAPIClient is a client that implements the ListRoles operation. +type ListRolesAPIClient interface { + ListRoles(context.Context, *ListRolesInput, ...func(*Options)) (*ListRolesOutput, error) +} + +var _ ListRolesAPIClient = (*Client)(nil) + +// ListRolesPaginatorOptions is the paginator options for ListRoles +type ListRolesPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListRolesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.ListRoles +type ListRolesPaginator struct { + options ListRolesPaginatorOptions + client ListRolesAPIClient + params *ListRolesInput + nextToken *string + firstPage bool + done bool +} + +// NewListRolesPaginator returns a new ListRolesPaginator +func NewListRolesPaginator(client ListRolesAPIClient, params *ListRolesInput, optFns ...func(*ListRolesPaginatorOptions)) *ListRolesPaginator { + options := ListRolesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListRolesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRolesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListRoles page. +func (p *ListRolesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRolesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxItems = p.options.Limit + result, err := p.client.ListRoles(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListAttachedRolePoliciesAPIClient is a client that implements the +// ListAttachedRolePolicies operation. +type ListAttachedRolePoliciesAPIClient interface { + ListAttachedRolePolicies(context.Context, *ListAttachedRolePoliciesInput, ...func(*Options)) (*ListAttachedRolePoliciesOutput, error) +} + +var _ ListAttachedRolePoliciesAPIClient = (*Client)(nil) + +// ListAttachedRolePoliciesPaginatorOptions is the paginator options for +// ListAttachedRolePolicies +type ListAttachedRolePoliciesPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAttachedRolePoliciesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.ListAttachedRolePolicies +type ListAttachedRolePoliciesPaginator struct { + options ListAttachedRolePoliciesPaginatorOptions + client ListAttachedRolePoliciesAPIClient + params *ListAttachedRolePoliciesInput + nextToken *string + firstPage bool + done bool +} + +// NewListAttachedRolePoliciesPaginator returns a new +// ListAttachedRolePoliciesPaginator +func NewListAttachedRolePoliciesPaginator(client ListAttachedRolePoliciesAPIClient, params *ListAttachedRolePoliciesInput, optFns ...func(*ListAttachedRolePoliciesPaginatorOptions)) *ListAttachedRolePoliciesPaginator { + options := ListAttachedRolePoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAttachedRolePoliciesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAttachedRolePoliciesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAttachedRolePolicies page. +func (p *ListAttachedRolePoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAttachedRolePoliciesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxItems = p.options.Limit + result, err := p.client.ListAttachedRolePolicies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListPolicyVersionsAPIClient is a client that implements the ListPolicyVersions +// operation. +type ListPolicyVersionsAPIClient interface { + ListPolicyVersions(context.Context, *ListPolicyVersionsInput, ...func(*Options)) (*ListPolicyVersionsOutput, error) +} + +var _ ListPolicyVersionsAPIClient = (*Client)(nil) + +// ListPolicyVersionsPaginatorOptions is the paginator options for +// ListPolicyVersions +type ListPolicyVersionsPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListPolicyVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.ListPolicyVersions +type ListPolicyVersionsPaginator struct { + options ListPolicyVersionsPaginatorOptions + client ListPolicyVersionsAPIClient + params *ListPolicyVersionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListPolicyVersionsPaginator returns a new ListPolicyVersionsPaginator +func NewListPolicyVersionsPaginator(client ListPolicyVersionsAPIClient, params *ListPolicyVersionsInput, optFns ...func(*ListPolicyVersionsPaginatorOptions)) *ListPolicyVersionsPaginator { + options := ListPolicyVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListPolicyVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPolicyVersionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListPolicyVersions page. +func (p *ListPolicyVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPolicyVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxItems = p.options.Limit + result, err := p.client.ListPolicyVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListGroupsAPIClient is a client that implements the ListGroups operation. +type ListGroupsAPIClient interface { + ListGroups(context.Context, *ListGroupsInput, ...func(*Options)) (*ListGroupsOutput, error) +} + +var _ ListGroupsAPIClient = (*Client)(nil) + +// ListGroupsPaginatorOptions is the paginator options for ListGroups +type ListGroupsPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.ListGroups +type ListGroupsPaginator struct { + options ListGroupsPaginatorOptions + client ListGroupsAPIClient + params *ListGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewListGroupsPaginator returns a new ListGroupsPaginator +func NewListGroupsPaginator(client ListGroupsAPIClient, params *ListGroupsInput, optFns ...func(*ListGroupsPaginatorOptions)) *ListGroupsPaginator { + options := ListGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListGroups page. +func (p *ListGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxItems = p.options.Limit + result, err := p.client.ListGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListRolePoliciesAPIClient is a client that implements the ListRolePolicies +// operation. +type ListRolePoliciesAPIClient interface { + ListRolePolicies(context.Context, *ListRolePoliciesInput, ...func(*Options)) (*ListRolePoliciesOutput, error) +} + +var _ ListRolePoliciesAPIClient = (*Client)(nil) + +// ListRolePoliciesPaginatorOptions is the paginator options for ListRolePolicies +type ListRolePoliciesPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListRolePoliciesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.ListRolePolicies +type ListRolePoliciesPaginator struct { + options ListRolePoliciesPaginatorOptions + client ListRolePoliciesAPIClient + params *ListRolePoliciesInput + nextToken *string + firstPage bool + done bool +} + +// NewListRolePoliciesPaginator returns a new ListRolePoliciesPaginator +func NewListRolePoliciesPaginator(client ListRolePoliciesAPIClient, params *ListRolePoliciesInput, optFns ...func(*ListRolePoliciesPaginatorOptions)) *ListRolePoliciesPaginator { + options := ListRolePoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListRolePoliciesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRolePoliciesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListRolePolicies page. +func (p *ListRolePoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRolePoliciesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxItems = p.options.Limit + result, err := p.client.ListRolePolicies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListAttachedGroupPoliciesAPIClient is a client that implements the +// ListAttachedGroupPolicies operation. +type ListAttachedGroupPoliciesAPIClient interface { + ListAttachedGroupPolicies(context.Context, *ListAttachedGroupPoliciesInput, ...func(*Options)) (*ListAttachedGroupPoliciesOutput, error) +} + +var _ ListAttachedGroupPoliciesAPIClient = (*Client)(nil) + +// ListAttachedGroupPoliciesPaginatorOptions is the paginator options for +// ListAttachedGroupPolicies +type ListAttachedGroupPoliciesPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAttachedGroupPoliciesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.ListAttachedGroupPolicies +type ListAttachedGroupPoliciesPaginator struct { + options ListAttachedGroupPoliciesPaginatorOptions + client ListAttachedGroupPoliciesAPIClient + params *ListAttachedGroupPoliciesInput + nextToken *string + firstPage bool + done bool +} + +// NewListAttachedGroupPoliciesPaginator returns a new +// ListAttachedGroupPoliciesPaginator +func NewListAttachedGroupPoliciesPaginator(client ListAttachedGroupPoliciesAPIClient, params *ListAttachedGroupPoliciesInput, optFns ...func(*ListAttachedGroupPoliciesPaginatorOptions)) *ListAttachedGroupPoliciesPaginator { + options := ListAttachedGroupPoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAttachedGroupPoliciesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAttachedGroupPoliciesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAttachedGroupPolicies page. +func (p *ListAttachedGroupPoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAttachedGroupPoliciesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxItems = p.options.Limit + result, err := p.client.ListAttachedGroupPolicies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListInstanceProfilesAPIClient is a client that implements the +// ListInstanceProfiles operation. +type ListInstanceProfilesAPIClient interface { + ListInstanceProfiles(context.Context, *ListInstanceProfilesInput, ...func(*Options)) (*ListInstanceProfilesOutput, error) +} + +var _ ListInstanceProfilesAPIClient = (*Client)(nil) + +// ListInstanceProfilesPaginatorOptions is the paginator options for +// ListInstanceProfiles +type ListInstanceProfilesPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListInstanceProfilesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.ListInstanceProfiles +type ListInstanceProfilesPaginator struct { + options ListInstanceProfilesPaginatorOptions + client ListInstanceProfilesAPIClient + params *ListInstanceProfilesInput + nextToken *string + firstPage bool + done bool +} + +// NewListInstanceProfilesPaginator returns a new ListInstanceProfilesPaginator +func NewListInstanceProfilesPaginator(client ListInstanceProfilesAPIClient, params *ListInstanceProfilesInput, optFns ...func(*ListInstanceProfilesPaginatorOptions)) *ListInstanceProfilesPaginator { + options := ListInstanceProfilesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListInstanceProfilesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListInstanceProfilesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListInstanceProfiles page. +func (p *ListInstanceProfilesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListInstanceProfilesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxItems = p.options.Limit + result, err := p.client.ListInstanceProfiles(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListMFADevicesAPIClient is a client that implements the ListMFADevices +// operation. +type ListMFADevicesAPIClient interface { + ListMFADevices(context.Context, *ListMFADevicesInput, ...func(*Options)) (*ListMFADevicesOutput, error) +} + +var _ ListMFADevicesAPIClient = (*Client)(nil) + +// ListMFADevicesPaginatorOptions is the paginator options for ListMFADevices +type ListMFADevicesPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListMFADevicesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.ListMFADevices +type ListMFADevicesPaginator struct { + options ListMFADevicesPaginatorOptions + client ListMFADevicesAPIClient + params *ListMFADevicesInput + nextToken *string + firstPage bool + done bool +} + +// NewListMFADevicesPaginator returns a new ListMFADevicesPaginator +func NewListMFADevicesPaginator(client ListMFADevicesAPIClient, params *ListMFADevicesInput, optFns ...func(*ListMFADevicesPaginatorOptions)) *ListMFADevicesPaginator { + options := ListMFADevicesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListMFADevicesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMFADevicesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListMFADevices page. +func (p *ListMFADevicesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMFADevicesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxItems = p.options.Limit + result, err := p.client.ListMFADevices(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListEntitiesForPolicyAPIClient is a client that implements the +// ListEntitiesForPolicy operation. +type ListEntitiesForPolicyAPIClient interface { + ListEntitiesForPolicy(context.Context, *ListEntitiesForPolicyInput, ...func(*Options)) (*ListEntitiesForPolicyOutput, error) +} + +var _ ListEntitiesForPolicyAPIClient = (*Client)(nil) + +// ListEntitiesForPolicyPaginatorOptions is the paginator options for +// ListEntitiesForPolicy +type ListEntitiesForPolicyPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListEntitiesForPolicyPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.ListEntitiesForPolicy +type ListEntitiesForPolicyPaginator struct { + options ListEntitiesForPolicyPaginatorOptions + client ListEntitiesForPolicyAPIClient + params *ListEntitiesForPolicyInput + nextToken *string + firstPage bool + done bool +} + +// NewListEntitiesForPolicyPaginator returns a new ListEntitiesForPolicyPaginator +func NewListEntitiesForPolicyPaginator(client ListEntitiesForPolicyAPIClient, params *ListEntitiesForPolicyInput, optFns ...func(*ListEntitiesForPolicyPaginatorOptions)) *ListEntitiesForPolicyPaginator { + options := ListEntitiesForPolicyPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListEntitiesForPolicyPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListEntitiesForPolicyPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListEntitiesForPolicy page. +func (p *ListEntitiesForPolicyPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEntitiesForPolicyOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxItems = p.options.Limit + result, err := p.client.ListEntitiesForPolicy(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListUsersAPIClient is a client that implements the ListUsers operation. +type ListUsersAPIClient interface { + ListUsers(context.Context, *ListUsersInput, ...func(*Options)) (*ListUsersOutput, error) +} + +var _ ListUsersAPIClient = (*Client)(nil) + +// ListUsersPaginatorOptions is the paginator options for ListUsers +type ListUsersPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListUsersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.ListUsers +type ListUsersPaginator struct { + options ListUsersPaginatorOptions + client ListUsersAPIClient + params *ListUsersInput + nextToken *string + firstPage bool + done bool +} + +// NewListUsersPaginator returns a new ListUsersPaginator +func NewListUsersPaginator(client ListUsersAPIClient, params *ListUsersInput, optFns ...func(*ListUsersPaginatorOptions)) *ListUsersPaginator { + options := ListUsersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListUsersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListUsersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListUsers page. +func (p *ListUsersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListUsersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxItems = p.options.Limit + result, err := p.client.ListUsers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListGroupsForUserAPIClient is a client that implements the ListGroupsForUser +// operation. +type ListGroupsForUserAPIClient interface { + ListGroupsForUser(context.Context, *ListGroupsForUserInput, ...func(*Options)) (*ListGroupsForUserOutput, error) +} + +var _ ListGroupsForUserAPIClient = (*Client)(nil) + +// ListGroupsForUserPaginatorOptions is the paginator options for ListGroupsForUser +type ListGroupsForUserPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListGroupsForUserPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.ListGroupsForUser +type ListGroupsForUserPaginator struct { + options ListGroupsForUserPaginatorOptions + client ListGroupsForUserAPIClient + params *ListGroupsForUserInput + nextToken *string + firstPage bool + done bool +} + +// NewListGroupsForUserPaginator returns a new ListGroupsForUserPaginator +func NewListGroupsForUserPaginator(client ListGroupsForUserAPIClient, params *ListGroupsForUserInput, optFns ...func(*ListGroupsForUserPaginatorOptions)) *ListGroupsForUserPaginator { + options := ListGroupsForUserPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListGroupsForUserPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListGroupsForUserPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListGroupsForUser page. +func (p *ListGroupsForUserPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListGroupsForUserOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxItems = p.options.Limit + result, err := p.client.ListGroupsForUser(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/identitystore/go.sum b/service/identitystore/go.sum index c669e324b14..32595049f96 100644 --- a/service/identitystore/go.sum +++ b/service/identitystore/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/identitystore/paginators.go b/service/identitystore/paginators.go new file mode 100644 index 00000000000..2c3febe4300 --- /dev/null +++ b/service/identitystore/paginators.go @@ -0,0 +1,160 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package identitystore + +import ( + "context" + "fmt" +) + +// ListUsersAPIClient is a client that implements the ListUsers operation. +type ListUsersAPIClient interface { + ListUsers(context.Context, *ListUsersInput, ...func(*Options)) (*ListUsersOutput, error) +} + +var _ ListUsersAPIClient = (*Client)(nil) + +// ListUsersPaginatorOptions is the paginator options for ListUsers +type ListUsersPaginatorOptions struct { + // The maximum number of results to be returned per request, which is used in the + // ListUsers and ListGroups request to specify how many results to return in one + // page. The length limit is 50 characters. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListUsersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/identitystore.ListUsers +type ListUsersPaginator struct { + options ListUsersPaginatorOptions + client ListUsersAPIClient + params *ListUsersInput + nextToken *string + firstPage bool + done bool +} + +// NewListUsersPaginator returns a new ListUsersPaginator +func NewListUsersPaginator(client ListUsersAPIClient, params *ListUsersInput, optFns ...func(*ListUsersPaginatorOptions)) *ListUsersPaginator { + options := ListUsersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListUsersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListUsersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListUsers page. +func (p *ListUsersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListUsersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListUsers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListGroupsAPIClient is a client that implements the ListGroups operation. +type ListGroupsAPIClient interface { + ListGroups(context.Context, *ListGroupsInput, ...func(*Options)) (*ListGroupsOutput, error) +} + +var _ ListGroupsAPIClient = (*Client)(nil) + +// ListGroupsPaginatorOptions is the paginator options for ListGroups +type ListGroupsPaginatorOptions struct { + // The maximum number of results to be returned per request, which is used in the + // ListUsers and ListGroups request to specify how many results to return in one + // page. The length limit is 50 characters. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/identitystore.ListGroups +type ListGroupsPaginator struct { + options ListGroupsPaginatorOptions + client ListGroupsAPIClient + params *ListGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewListGroupsPaginator returns a new ListGroupsPaginator +func NewListGroupsPaginator(client ListGroupsAPIClient, params *ListGroupsInput, optFns ...func(*ListGroupsPaginatorOptions)) *ListGroupsPaginator { + options := ListGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListGroups page. +func (p *ListGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/imagebuilder/go.sum b/service/imagebuilder/go.sum index c669e324b14..32595049f96 100644 --- a/service/imagebuilder/go.sum +++ b/service/imagebuilder/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/imagebuilder/paginators.go b/service/imagebuilder/paginators.go new file mode 100644 index 00000000000..2177b094fe2 --- /dev/null +++ b/service/imagebuilder/paginators.go @@ -0,0 +1,692 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package imagebuilder + +import ( + "context" + "fmt" +) + +// ListImagePipelinesAPIClient is a client that implements the ListImagePipelines +// operation. +type ListImagePipelinesAPIClient interface { + ListImagePipelines(context.Context, *ListImagePipelinesInput, ...func(*Options)) (*ListImagePipelinesOutput, error) +} + +var _ ListImagePipelinesAPIClient = (*Client)(nil) + +// ListImagePipelinesPaginatorOptions is the paginator options for +// ListImagePipelines +type ListImagePipelinesPaginatorOptions struct { + // The maximum items to return in a request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListImagePipelinesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/imagebuilder.ListImagePipelines +type ListImagePipelinesPaginator struct { + options ListImagePipelinesPaginatorOptions + client ListImagePipelinesAPIClient + params *ListImagePipelinesInput + nextToken *string + firstPage bool + done bool +} + +// NewListImagePipelinesPaginator returns a new ListImagePipelinesPaginator +func NewListImagePipelinesPaginator(client ListImagePipelinesAPIClient, params *ListImagePipelinesInput, optFns ...func(*ListImagePipelinesPaginatorOptions)) *ListImagePipelinesPaginator { + options := ListImagePipelinesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListImagePipelinesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListImagePipelinesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListImagePipelines page. +func (p *ListImagePipelinesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListImagePipelinesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListImagePipelines(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListComponentBuildVersionsAPIClient is a client that implements the +// ListComponentBuildVersions operation. +type ListComponentBuildVersionsAPIClient interface { + ListComponentBuildVersions(context.Context, *ListComponentBuildVersionsInput, ...func(*Options)) (*ListComponentBuildVersionsOutput, error) +} + +var _ ListComponentBuildVersionsAPIClient = (*Client)(nil) + +// ListComponentBuildVersionsPaginatorOptions is the paginator options for +// ListComponentBuildVersions +type ListComponentBuildVersionsPaginatorOptions struct { + // The maximum items to return in a request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListComponentBuildVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/imagebuilder.ListComponentBuildVersions +type ListComponentBuildVersionsPaginator struct { + options ListComponentBuildVersionsPaginatorOptions + client ListComponentBuildVersionsAPIClient + params *ListComponentBuildVersionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListComponentBuildVersionsPaginator returns a new +// ListComponentBuildVersionsPaginator +func NewListComponentBuildVersionsPaginator(client ListComponentBuildVersionsAPIClient, params *ListComponentBuildVersionsInput, optFns ...func(*ListComponentBuildVersionsPaginatorOptions)) *ListComponentBuildVersionsPaginator { + options := ListComponentBuildVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListComponentBuildVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListComponentBuildVersionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListComponentBuildVersions page. +func (p *ListComponentBuildVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListComponentBuildVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListComponentBuildVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListImagesAPIClient is a client that implements the ListImages operation. +type ListImagesAPIClient interface { + ListImages(context.Context, *ListImagesInput, ...func(*Options)) (*ListImagesOutput, error) +} + +var _ ListImagesAPIClient = (*Client)(nil) + +// ListImagesPaginatorOptions is the paginator options for ListImages +type ListImagesPaginatorOptions struct { + // The maximum items to return in a request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListImagesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/imagebuilder.ListImages +type ListImagesPaginator struct { + options ListImagesPaginatorOptions + client ListImagesAPIClient + params *ListImagesInput + nextToken *string + firstPage bool + done bool +} + +// NewListImagesPaginator returns a new ListImagesPaginator +func NewListImagesPaginator(client ListImagesAPIClient, params *ListImagesInput, optFns ...func(*ListImagesPaginatorOptions)) *ListImagesPaginator { + options := ListImagesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListImagesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListImagesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListImages page. +func (p *ListImagesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListImagesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListImages(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListInfrastructureConfigurationsAPIClient is a client that implements the +// ListInfrastructureConfigurations operation. +type ListInfrastructureConfigurationsAPIClient interface { + ListInfrastructureConfigurations(context.Context, *ListInfrastructureConfigurationsInput, ...func(*Options)) (*ListInfrastructureConfigurationsOutput, error) +} + +var _ ListInfrastructureConfigurationsAPIClient = (*Client)(nil) + +// ListInfrastructureConfigurationsPaginatorOptions is the paginator options for +// ListInfrastructureConfigurations +type ListInfrastructureConfigurationsPaginatorOptions struct { + // The maximum items to return in a request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListInfrastructureConfigurationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/imagebuilder.ListInfrastructureConfigurations +type ListInfrastructureConfigurationsPaginator struct { + options ListInfrastructureConfigurationsPaginatorOptions + client ListInfrastructureConfigurationsAPIClient + params *ListInfrastructureConfigurationsInput + nextToken *string + firstPage bool + done bool +} + +// NewListInfrastructureConfigurationsPaginator returns a new +// ListInfrastructureConfigurationsPaginator +func NewListInfrastructureConfigurationsPaginator(client ListInfrastructureConfigurationsAPIClient, params *ListInfrastructureConfigurationsInput, optFns ...func(*ListInfrastructureConfigurationsPaginatorOptions)) *ListInfrastructureConfigurationsPaginator { + options := ListInfrastructureConfigurationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListInfrastructureConfigurationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListInfrastructureConfigurationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListInfrastructureConfigurations page. +func (p *ListInfrastructureConfigurationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListInfrastructureConfigurationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListInfrastructureConfigurations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListImageRecipesAPIClient is a client that implements the ListImageRecipes +// operation. +type ListImageRecipesAPIClient interface { + ListImageRecipes(context.Context, *ListImageRecipesInput, ...func(*Options)) (*ListImageRecipesOutput, error) +} + +var _ ListImageRecipesAPIClient = (*Client)(nil) + +// ListImageRecipesPaginatorOptions is the paginator options for ListImageRecipes +type ListImageRecipesPaginatorOptions struct { + // The maximum items to return in a request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListImageRecipesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/imagebuilder.ListImageRecipes +type ListImageRecipesPaginator struct { + options ListImageRecipesPaginatorOptions + client ListImageRecipesAPIClient + params *ListImageRecipesInput + nextToken *string + firstPage bool + done bool +} + +// NewListImageRecipesPaginator returns a new ListImageRecipesPaginator +func NewListImageRecipesPaginator(client ListImageRecipesAPIClient, params *ListImageRecipesInput, optFns ...func(*ListImageRecipesPaginatorOptions)) *ListImageRecipesPaginator { + options := ListImageRecipesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListImageRecipesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListImageRecipesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListImageRecipes page. +func (p *ListImageRecipesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListImageRecipesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListImageRecipes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListImagePipelineImagesAPIClient is a client that implements the +// ListImagePipelineImages operation. +type ListImagePipelineImagesAPIClient interface { + ListImagePipelineImages(context.Context, *ListImagePipelineImagesInput, ...func(*Options)) (*ListImagePipelineImagesOutput, error) +} + +var _ ListImagePipelineImagesAPIClient = (*Client)(nil) + +// ListImagePipelineImagesPaginatorOptions is the paginator options for +// ListImagePipelineImages +type ListImagePipelineImagesPaginatorOptions struct { + // The maximum items to return in a request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListImagePipelineImagesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/imagebuilder.ListImagePipelineImages +type ListImagePipelineImagesPaginator struct { + options ListImagePipelineImagesPaginatorOptions + client ListImagePipelineImagesAPIClient + params *ListImagePipelineImagesInput + nextToken *string + firstPage bool + done bool +} + +// NewListImagePipelineImagesPaginator returns a new +// ListImagePipelineImagesPaginator +func NewListImagePipelineImagesPaginator(client ListImagePipelineImagesAPIClient, params *ListImagePipelineImagesInput, optFns ...func(*ListImagePipelineImagesPaginatorOptions)) *ListImagePipelineImagesPaginator { + options := ListImagePipelineImagesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListImagePipelineImagesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListImagePipelineImagesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListImagePipelineImages page. +func (p *ListImagePipelineImagesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListImagePipelineImagesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListImagePipelineImages(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDistributionConfigurationsAPIClient is a client that implements the +// ListDistributionConfigurations operation. +type ListDistributionConfigurationsAPIClient interface { + ListDistributionConfigurations(context.Context, *ListDistributionConfigurationsInput, ...func(*Options)) (*ListDistributionConfigurationsOutput, error) +} + +var _ ListDistributionConfigurationsAPIClient = (*Client)(nil) + +// ListDistributionConfigurationsPaginatorOptions is the paginator options for +// ListDistributionConfigurations +type ListDistributionConfigurationsPaginatorOptions struct { + // The maximum items to return in a request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDistributionConfigurationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/imagebuilder.ListDistributionConfigurations +type ListDistributionConfigurationsPaginator struct { + options ListDistributionConfigurationsPaginatorOptions + client ListDistributionConfigurationsAPIClient + params *ListDistributionConfigurationsInput + nextToken *string + firstPage bool + done bool +} + +// NewListDistributionConfigurationsPaginator returns a new +// ListDistributionConfigurationsPaginator +func NewListDistributionConfigurationsPaginator(client ListDistributionConfigurationsAPIClient, params *ListDistributionConfigurationsInput, optFns ...func(*ListDistributionConfigurationsPaginatorOptions)) *ListDistributionConfigurationsPaginator { + options := ListDistributionConfigurationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDistributionConfigurationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDistributionConfigurationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDistributionConfigurations page. +func (p *ListDistributionConfigurationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDistributionConfigurationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListDistributionConfigurations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListComponentsAPIClient is a client that implements the ListComponents +// operation. +type ListComponentsAPIClient interface { + ListComponents(context.Context, *ListComponentsInput, ...func(*Options)) (*ListComponentsOutput, error) +} + +var _ ListComponentsAPIClient = (*Client)(nil) + +// ListComponentsPaginatorOptions is the paginator options for ListComponents +type ListComponentsPaginatorOptions struct { + // The maximum items to return in a request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListComponentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/imagebuilder.ListComponents +type ListComponentsPaginator struct { + options ListComponentsPaginatorOptions + client ListComponentsAPIClient + params *ListComponentsInput + nextToken *string + firstPage bool + done bool +} + +// NewListComponentsPaginator returns a new ListComponentsPaginator +func NewListComponentsPaginator(client ListComponentsAPIClient, params *ListComponentsInput, optFns ...func(*ListComponentsPaginatorOptions)) *ListComponentsPaginator { + options := ListComponentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListComponentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListComponentsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListComponents page. +func (p *ListComponentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListComponentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListComponents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListImageBuildVersionsAPIClient is a client that implements the +// ListImageBuildVersions operation. +type ListImageBuildVersionsAPIClient interface { + ListImageBuildVersions(context.Context, *ListImageBuildVersionsInput, ...func(*Options)) (*ListImageBuildVersionsOutput, error) +} + +var _ ListImageBuildVersionsAPIClient = (*Client)(nil) + +// ListImageBuildVersionsPaginatorOptions is the paginator options for +// ListImageBuildVersions +type ListImageBuildVersionsPaginatorOptions struct { + // The maximum items to return in a request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListImageBuildVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/imagebuilder.ListImageBuildVersions +type ListImageBuildVersionsPaginator struct { + options ListImageBuildVersionsPaginatorOptions + client ListImageBuildVersionsAPIClient + params *ListImageBuildVersionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListImageBuildVersionsPaginator returns a new ListImageBuildVersionsPaginator +func NewListImageBuildVersionsPaginator(client ListImageBuildVersionsAPIClient, params *ListImageBuildVersionsInput, optFns ...func(*ListImageBuildVersionsPaginatorOptions)) *ListImageBuildVersionsPaginator { + options := ListImageBuildVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListImageBuildVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListImageBuildVersionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListImageBuildVersions page. +func (p *ListImageBuildVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListImageBuildVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListImageBuildVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/inspector/go.sum b/service/inspector/go.sum index c669e324b14..32595049f96 100644 --- a/service/inspector/go.sum +++ b/service/inspector/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/inspector/paginators.go b/service/inspector/paginators.go new file mode 100644 index 00000000000..294bf41fc47 --- /dev/null +++ b/service/inspector/paginators.go @@ -0,0 +1,774 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package inspector + +import ( + "context" + "fmt" +) + +// ListEventSubscriptionsAPIClient is a client that implements the +// ListEventSubscriptions operation. +type ListEventSubscriptionsAPIClient interface { + ListEventSubscriptions(context.Context, *ListEventSubscriptionsInput, ...func(*Options)) (*ListEventSubscriptionsOutput, error) +} + +var _ ListEventSubscriptionsAPIClient = (*Client)(nil) + +// ListEventSubscriptionsPaginatorOptions is the paginator options for +// ListEventSubscriptions +type ListEventSubscriptionsPaginatorOptions struct { + // You can use this parameter to indicate the maximum number of items you want in + // the response. The default value is 10. The maximum value is 500. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListEventSubscriptionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/inspector.ListEventSubscriptions +type ListEventSubscriptionsPaginator struct { + options ListEventSubscriptionsPaginatorOptions + client ListEventSubscriptionsAPIClient + params *ListEventSubscriptionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListEventSubscriptionsPaginator returns a new ListEventSubscriptionsPaginator +func NewListEventSubscriptionsPaginator(client ListEventSubscriptionsAPIClient, params *ListEventSubscriptionsInput, optFns ...func(*ListEventSubscriptionsPaginatorOptions)) *ListEventSubscriptionsPaginator { + options := ListEventSubscriptionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListEventSubscriptionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListEventSubscriptionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListEventSubscriptions page. +func (p *ListEventSubscriptionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEventSubscriptionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListEventSubscriptions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// PreviewAgentsAPIClient is a client that implements the PreviewAgents operation. +type PreviewAgentsAPIClient interface { + PreviewAgents(context.Context, *PreviewAgentsInput, ...func(*Options)) (*PreviewAgentsOutput, error) +} + +var _ PreviewAgentsAPIClient = (*Client)(nil) + +// PreviewAgentsPaginatorOptions is the paginator options for PreviewAgents +type PreviewAgentsPaginatorOptions struct { + // You can use this parameter to indicate the maximum number of items you want in + // the response. The default value is 10. The maximum value is 500. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// PreviewAgentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/inspector.PreviewAgents +type PreviewAgentsPaginator struct { + options PreviewAgentsPaginatorOptions + client PreviewAgentsAPIClient + params *PreviewAgentsInput + nextToken *string + firstPage bool + done bool +} + +// NewPreviewAgentsPaginator returns a new PreviewAgentsPaginator +func NewPreviewAgentsPaginator(client PreviewAgentsAPIClient, params *PreviewAgentsInput, optFns ...func(*PreviewAgentsPaginatorOptions)) *PreviewAgentsPaginator { + options := PreviewAgentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &PreviewAgentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *PreviewAgentsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next PreviewAgents page. +func (p *PreviewAgentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*PreviewAgentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.PreviewAgents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListRulesPackagesAPIClient is a client that implements the ListRulesPackages +// operation. +type ListRulesPackagesAPIClient interface { + ListRulesPackages(context.Context, *ListRulesPackagesInput, ...func(*Options)) (*ListRulesPackagesOutput, error) +} + +var _ ListRulesPackagesAPIClient = (*Client)(nil) + +// ListRulesPackagesPaginatorOptions is the paginator options for ListRulesPackages +type ListRulesPackagesPaginatorOptions struct { + // You can use this parameter to indicate the maximum number of items you want in + // the response. The default value is 10. The maximum value is 500. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListRulesPackagesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/inspector.ListRulesPackages +type ListRulesPackagesPaginator struct { + options ListRulesPackagesPaginatorOptions + client ListRulesPackagesAPIClient + params *ListRulesPackagesInput + nextToken *string + firstPage bool + done bool +} + +// NewListRulesPackagesPaginator returns a new ListRulesPackagesPaginator +func NewListRulesPackagesPaginator(client ListRulesPackagesAPIClient, params *ListRulesPackagesInput, optFns ...func(*ListRulesPackagesPaginatorOptions)) *ListRulesPackagesPaginator { + options := ListRulesPackagesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListRulesPackagesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRulesPackagesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListRulesPackages page. +func (p *ListRulesPackagesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRulesPackagesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListRulesPackages(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListAssessmentTemplatesAPIClient is a client that implements the +// ListAssessmentTemplates operation. +type ListAssessmentTemplatesAPIClient interface { + ListAssessmentTemplates(context.Context, *ListAssessmentTemplatesInput, ...func(*Options)) (*ListAssessmentTemplatesOutput, error) +} + +var _ ListAssessmentTemplatesAPIClient = (*Client)(nil) + +// ListAssessmentTemplatesPaginatorOptions is the paginator options for +// ListAssessmentTemplates +type ListAssessmentTemplatesPaginatorOptions struct { + // You can use this parameter to indicate the maximum number of items you want in + // the response. The default value is 10. The maximum value is 500. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAssessmentTemplatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/inspector.ListAssessmentTemplates +type ListAssessmentTemplatesPaginator struct { + options ListAssessmentTemplatesPaginatorOptions + client ListAssessmentTemplatesAPIClient + params *ListAssessmentTemplatesInput + nextToken *string + firstPage bool + done bool +} + +// NewListAssessmentTemplatesPaginator returns a new +// ListAssessmentTemplatesPaginator +func NewListAssessmentTemplatesPaginator(client ListAssessmentTemplatesAPIClient, params *ListAssessmentTemplatesInput, optFns ...func(*ListAssessmentTemplatesPaginatorOptions)) *ListAssessmentTemplatesPaginator { + options := ListAssessmentTemplatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAssessmentTemplatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAssessmentTemplatesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAssessmentTemplates page. +func (p *ListAssessmentTemplatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAssessmentTemplatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListAssessmentTemplates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListAssessmentTargetsAPIClient is a client that implements the +// ListAssessmentTargets operation. +type ListAssessmentTargetsAPIClient interface { + ListAssessmentTargets(context.Context, *ListAssessmentTargetsInput, ...func(*Options)) (*ListAssessmentTargetsOutput, error) +} + +var _ ListAssessmentTargetsAPIClient = (*Client)(nil) + +// ListAssessmentTargetsPaginatorOptions is the paginator options for +// ListAssessmentTargets +type ListAssessmentTargetsPaginatorOptions struct { + // You can use this parameter to indicate the maximum number of items you want in + // the response. The default value is 10. The maximum value is 500. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAssessmentTargetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/inspector.ListAssessmentTargets +type ListAssessmentTargetsPaginator struct { + options ListAssessmentTargetsPaginatorOptions + client ListAssessmentTargetsAPIClient + params *ListAssessmentTargetsInput + nextToken *string + firstPage bool + done bool +} + +// NewListAssessmentTargetsPaginator returns a new ListAssessmentTargetsPaginator +func NewListAssessmentTargetsPaginator(client ListAssessmentTargetsAPIClient, params *ListAssessmentTargetsInput, optFns ...func(*ListAssessmentTargetsPaginatorOptions)) *ListAssessmentTargetsPaginator { + options := ListAssessmentTargetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAssessmentTargetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAssessmentTargetsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAssessmentTargets page. +func (p *ListAssessmentTargetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAssessmentTargetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListAssessmentTargets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetExclusionsPreviewAPIClient is a client that implements the +// GetExclusionsPreview operation. +type GetExclusionsPreviewAPIClient interface { + GetExclusionsPreview(context.Context, *GetExclusionsPreviewInput, ...func(*Options)) (*GetExclusionsPreviewOutput, error) +} + +var _ GetExclusionsPreviewAPIClient = (*Client)(nil) + +// GetExclusionsPreviewPaginatorOptions is the paginator options for +// GetExclusionsPreview +type GetExclusionsPreviewPaginatorOptions struct { + // You can use this parameter to indicate the maximum number of items you want in + // the response. The default value is 100. The maximum value is 500. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetExclusionsPreviewPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/inspector.GetExclusionsPreview +type GetExclusionsPreviewPaginator struct { + options GetExclusionsPreviewPaginatorOptions + client GetExclusionsPreviewAPIClient + params *GetExclusionsPreviewInput + nextToken *string + firstPage bool + done bool +} + +// NewGetExclusionsPreviewPaginator returns a new GetExclusionsPreviewPaginator +func NewGetExclusionsPreviewPaginator(client GetExclusionsPreviewAPIClient, params *GetExclusionsPreviewInput, optFns ...func(*GetExclusionsPreviewPaginatorOptions)) *GetExclusionsPreviewPaginator { + options := GetExclusionsPreviewPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetExclusionsPreviewPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetExclusionsPreviewPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetExclusionsPreview page. +func (p *GetExclusionsPreviewPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetExclusionsPreviewOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetExclusionsPreview(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListExclusionsAPIClient is a client that implements the ListExclusions +// operation. +type ListExclusionsAPIClient interface { + ListExclusions(context.Context, *ListExclusionsInput, ...func(*Options)) (*ListExclusionsOutput, error) +} + +var _ ListExclusionsAPIClient = (*Client)(nil) + +// ListExclusionsPaginatorOptions is the paginator options for ListExclusions +type ListExclusionsPaginatorOptions struct { + // You can use this parameter to indicate the maximum number of items you want in + // the response. The default value is 100. The maximum value is 500. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListExclusionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/inspector.ListExclusions +type ListExclusionsPaginator struct { + options ListExclusionsPaginatorOptions + client ListExclusionsAPIClient + params *ListExclusionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListExclusionsPaginator returns a new ListExclusionsPaginator +func NewListExclusionsPaginator(client ListExclusionsAPIClient, params *ListExclusionsInput, optFns ...func(*ListExclusionsPaginatorOptions)) *ListExclusionsPaginator { + options := ListExclusionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListExclusionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListExclusionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListExclusions page. +func (p *ListExclusionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListExclusionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListExclusions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListAssessmentRunsAPIClient is a client that implements the ListAssessmentRuns +// operation. +type ListAssessmentRunsAPIClient interface { + ListAssessmentRuns(context.Context, *ListAssessmentRunsInput, ...func(*Options)) (*ListAssessmentRunsOutput, error) +} + +var _ ListAssessmentRunsAPIClient = (*Client)(nil) + +// ListAssessmentRunsPaginatorOptions is the paginator options for +// ListAssessmentRuns +type ListAssessmentRunsPaginatorOptions struct { + // You can use this parameter to indicate the maximum number of items that you want + // in the response. The default value is 10. The maximum value is 500. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAssessmentRunsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/inspector.ListAssessmentRuns +type ListAssessmentRunsPaginator struct { + options ListAssessmentRunsPaginatorOptions + client ListAssessmentRunsAPIClient + params *ListAssessmentRunsInput + nextToken *string + firstPage bool + done bool +} + +// NewListAssessmentRunsPaginator returns a new ListAssessmentRunsPaginator +func NewListAssessmentRunsPaginator(client ListAssessmentRunsAPIClient, params *ListAssessmentRunsInput, optFns ...func(*ListAssessmentRunsPaginatorOptions)) *ListAssessmentRunsPaginator { + options := ListAssessmentRunsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAssessmentRunsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAssessmentRunsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAssessmentRuns page. +func (p *ListAssessmentRunsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAssessmentRunsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListAssessmentRuns(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListAssessmentRunAgentsAPIClient is a client that implements the +// ListAssessmentRunAgents operation. +type ListAssessmentRunAgentsAPIClient interface { + ListAssessmentRunAgents(context.Context, *ListAssessmentRunAgentsInput, ...func(*Options)) (*ListAssessmentRunAgentsOutput, error) +} + +var _ ListAssessmentRunAgentsAPIClient = (*Client)(nil) + +// ListAssessmentRunAgentsPaginatorOptions is the paginator options for +// ListAssessmentRunAgents +type ListAssessmentRunAgentsPaginatorOptions struct { + // You can use this parameter to indicate the maximum number of items that you want + // in the response. The default value is 10. The maximum value is 500. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAssessmentRunAgentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/inspector.ListAssessmentRunAgents +type ListAssessmentRunAgentsPaginator struct { + options ListAssessmentRunAgentsPaginatorOptions + client ListAssessmentRunAgentsAPIClient + params *ListAssessmentRunAgentsInput + nextToken *string + firstPage bool + done bool +} + +// NewListAssessmentRunAgentsPaginator returns a new +// ListAssessmentRunAgentsPaginator +func NewListAssessmentRunAgentsPaginator(client ListAssessmentRunAgentsAPIClient, params *ListAssessmentRunAgentsInput, optFns ...func(*ListAssessmentRunAgentsPaginatorOptions)) *ListAssessmentRunAgentsPaginator { + options := ListAssessmentRunAgentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAssessmentRunAgentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAssessmentRunAgentsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAssessmentRunAgents page. +func (p *ListAssessmentRunAgentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAssessmentRunAgentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListAssessmentRunAgents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListFindingsAPIClient is a client that implements the ListFindings operation. +type ListFindingsAPIClient interface { + ListFindings(context.Context, *ListFindingsInput, ...func(*Options)) (*ListFindingsOutput, error) +} + +var _ ListFindingsAPIClient = (*Client)(nil) + +// ListFindingsPaginatorOptions is the paginator options for ListFindings +type ListFindingsPaginatorOptions struct { + // You can use this parameter to indicate the maximum number of items you want in + // the response. The default value is 10. The maximum value is 500. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListFindingsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/inspector.ListFindings +type ListFindingsPaginator struct { + options ListFindingsPaginatorOptions + client ListFindingsAPIClient + params *ListFindingsInput + nextToken *string + firstPage bool + done bool +} + +// NewListFindingsPaginator returns a new ListFindingsPaginator +func NewListFindingsPaginator(client ListFindingsAPIClient, params *ListFindingsInput, optFns ...func(*ListFindingsPaginatorOptions)) *ListFindingsPaginator { + options := ListFindingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListFindingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListFindingsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListFindings page. +func (p *ListFindingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFindingsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListFindings(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/internal/accept-encoding/go.sum b/service/internal/accept-encoding/go.sum index 210ab773fc5..3119236f3e6 100644 --- a/service/internal/accept-encoding/go.sum +++ b/service/internal/accept-encoding/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.0 h1:I1EQ1P+VtxpuNnGYymATewaKrlnaYQwFvO8lNTsafbs= +github.com/awslabs/smithy-go v0.3.0/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= diff --git a/service/internal/benchmark/go.sum b/service/internal/benchmark/go.sum index 94619ca5a12..9fe0b721617 100644 --- a/service/internal/benchmark/go.sum +++ b/service/internal/benchmark/go.sum @@ -1,5 +1,8 @@ github.com/aws/aws-sdk-go v1.34.33 h1:ymkFm0rNPEOlgjyX3ojEd4zqzW6kGICBkqWs7LqgHtU= github.com/aws/aws-sdk-go v1.34.33/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48= +github.com/awslabs/smithy-go v0.3.0/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= diff --git a/service/internal/integrationtest/go.sum b/service/internal/integrationtest/go.sum index 8a4986a5fc4..15f421e87a4 100644 --- a/service/internal/integrationtest/go.sum +++ b/service/internal/integrationtest/go.sum @@ -1,3 +1,6 @@ +github.com/awslabs/smithy-go v0.3.0/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/internal/presigned-url/go.mod b/service/internal/presigned-url/go.mod index 1fa09238e73..4e62f5cfdcc 100644 --- a/service/internal/presigned-url/go.mod +++ b/service/internal/presigned-url/go.mod @@ -4,7 +4,7 @@ go 1.15 require ( github.com/aws/aws-sdk-go-v2 v0.29.0 - github.com/awslabs/smithy-go v0.3.1-0.20201103180816-d4c6ec013e15 + github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 github.com/google/go-cmp v0.5.2 ) diff --git a/service/internal/presigned-url/go.sum b/service/internal/presigned-url/go.sum index 8a4986a5fc4..875bf37048a 100644 --- a/service/internal/presigned-url/go.sum +++ b/service/internal/presigned-url/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/internal/s3shared/go.mod b/service/internal/s3shared/go.mod index 04c7b3fa5f0..f0e964c551c 100644 --- a/service/internal/s3shared/go.mod +++ b/service/internal/s3shared/go.mod @@ -4,7 +4,7 @@ go 1.15 require ( github.com/aws/aws-sdk-go-v2 v0.29.0 - github.com/awslabs/smithy-go v0.3.1-0.20201103180816-d4c6ec013e15 + github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 ) replace github.com/aws/aws-sdk-go-v2 => ../../../ diff --git a/service/internal/s3shared/go.sum b/service/internal/s3shared/go.sum index fd672e20286..e91289bf27f 100644 --- a/service/internal/s3shared/go.sum +++ b/service/internal/s3shared/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/iot/go.sum b/service/iot/go.sum index c669e324b14..32595049f96 100644 --- a/service/iot/go.sum +++ b/service/iot/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/iot/paginators.go b/service/iot/paginators.go new file mode 100644 index 00000000000..744cf20b5d0 --- /dev/null +++ b/service/iot/paginators.go @@ -0,0 +1,3570 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iot + +import ( + "context" + "fmt" +) + +// ListTopicRuleDestinationsAPIClient is a client that implements the +// ListTopicRuleDestinations operation. +type ListTopicRuleDestinationsAPIClient interface { + ListTopicRuleDestinations(context.Context, *ListTopicRuleDestinationsInput, ...func(*Options)) (*ListTopicRuleDestinationsOutput, error) +} + +var _ ListTopicRuleDestinationsAPIClient = (*Client)(nil) + +// ListTopicRuleDestinationsPaginatorOptions is the paginator options for +// ListTopicRuleDestinations +type ListTopicRuleDestinationsPaginatorOptions struct { + // The maximum number of results to return at one time. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTopicRuleDestinationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListTopicRuleDestinations +type ListTopicRuleDestinationsPaginator struct { + options ListTopicRuleDestinationsPaginatorOptions + client ListTopicRuleDestinationsAPIClient + params *ListTopicRuleDestinationsInput + nextToken *string + firstPage bool + done bool +} + +// NewListTopicRuleDestinationsPaginator returns a new +// ListTopicRuleDestinationsPaginator +func NewListTopicRuleDestinationsPaginator(client ListTopicRuleDestinationsAPIClient, params *ListTopicRuleDestinationsInput, optFns ...func(*ListTopicRuleDestinationsPaginatorOptions)) *ListTopicRuleDestinationsPaginator { + options := ListTopicRuleDestinationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTopicRuleDestinationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTopicRuleDestinationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTopicRuleDestinations page. +func (p *ListTopicRuleDestinationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTopicRuleDestinationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListTopicRuleDestinations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListScheduledAuditsAPIClient is a client that implements the ListScheduledAudits +// operation. +type ListScheduledAuditsAPIClient interface { + ListScheduledAudits(context.Context, *ListScheduledAuditsInput, ...func(*Options)) (*ListScheduledAuditsOutput, error) +} + +var _ ListScheduledAuditsAPIClient = (*Client)(nil) + +// ListScheduledAuditsPaginatorOptions is the paginator options for +// ListScheduledAudits +type ListScheduledAuditsPaginatorOptions struct { + // The maximum number of results to return at one time. The default is 25. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListScheduledAuditsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListScheduledAudits +type ListScheduledAuditsPaginator struct { + options ListScheduledAuditsPaginatorOptions + client ListScheduledAuditsAPIClient + params *ListScheduledAuditsInput + nextToken *string + firstPage bool + done bool +} + +// NewListScheduledAuditsPaginator returns a new ListScheduledAuditsPaginator +func NewListScheduledAuditsPaginator(client ListScheduledAuditsAPIClient, params *ListScheduledAuditsInput, optFns ...func(*ListScheduledAuditsPaginatorOptions)) *ListScheduledAuditsPaginator { + options := ListScheduledAuditsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListScheduledAuditsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListScheduledAuditsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListScheduledAudits page. +func (p *ListScheduledAuditsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListScheduledAuditsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListScheduledAudits(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTagsForResourceAPIClient is a client that implements the ListTagsForResource +// operation. +type ListTagsForResourceAPIClient interface { + ListTagsForResource(context.Context, *ListTagsForResourceInput, ...func(*Options)) (*ListTagsForResourceOutput, error) +} + +var _ ListTagsForResourceAPIClient = (*Client)(nil) + +// ListTagsForResourcePaginatorOptions is the paginator options for +// ListTagsForResource +type ListTagsForResourcePaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTagsForResourcePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListTagsForResource +type ListTagsForResourcePaginator struct { + options ListTagsForResourcePaginatorOptions + client ListTagsForResourceAPIClient + params *ListTagsForResourceInput + nextToken *string + firstPage bool + done bool +} + +// NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator +func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator { + options := ListTagsForResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTagsForResourcePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTagsForResourcePaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTagsForResource page. +func (p *ListTagsForResourcePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListTagsForResource(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListProvisioningTemplatesAPIClient is a client that implements the +// ListProvisioningTemplates operation. +type ListProvisioningTemplatesAPIClient interface { + ListProvisioningTemplates(context.Context, *ListProvisioningTemplatesInput, ...func(*Options)) (*ListProvisioningTemplatesOutput, error) +} + +var _ ListProvisioningTemplatesAPIClient = (*Client)(nil) + +// ListProvisioningTemplatesPaginatorOptions is the paginator options for +// ListProvisioningTemplates +type ListProvisioningTemplatesPaginatorOptions struct { + // The maximum number of results to return at one time. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListProvisioningTemplatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListProvisioningTemplates +type ListProvisioningTemplatesPaginator struct { + options ListProvisioningTemplatesPaginatorOptions + client ListProvisioningTemplatesAPIClient + params *ListProvisioningTemplatesInput + nextToken *string + firstPage bool + done bool +} + +// NewListProvisioningTemplatesPaginator returns a new +// ListProvisioningTemplatesPaginator +func NewListProvisioningTemplatesPaginator(client ListProvisioningTemplatesAPIClient, params *ListProvisioningTemplatesInput, optFns ...func(*ListProvisioningTemplatesPaginatorOptions)) *ListProvisioningTemplatesPaginator { + options := ListProvisioningTemplatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListProvisioningTemplatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListProvisioningTemplatesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListProvisioningTemplates page. +func (p *ListProvisioningTemplatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProvisioningTemplatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListProvisioningTemplates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListV2LoggingLevelsAPIClient is a client that implements the ListV2LoggingLevels +// operation. +type ListV2LoggingLevelsAPIClient interface { + ListV2LoggingLevels(context.Context, *ListV2LoggingLevelsInput, ...func(*Options)) (*ListV2LoggingLevelsOutput, error) +} + +var _ ListV2LoggingLevelsAPIClient = (*Client)(nil) + +// ListV2LoggingLevelsPaginatorOptions is the paginator options for +// ListV2LoggingLevels +type ListV2LoggingLevelsPaginatorOptions struct { + // The maximum number of results to return at one time. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListV2LoggingLevelsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListV2LoggingLevels +type ListV2LoggingLevelsPaginator struct { + options ListV2LoggingLevelsPaginatorOptions + client ListV2LoggingLevelsAPIClient + params *ListV2LoggingLevelsInput + nextToken *string + firstPage bool + done bool +} + +// NewListV2LoggingLevelsPaginator returns a new ListV2LoggingLevelsPaginator +func NewListV2LoggingLevelsPaginator(client ListV2LoggingLevelsAPIClient, params *ListV2LoggingLevelsInput, optFns ...func(*ListV2LoggingLevelsPaginatorOptions)) *ListV2LoggingLevelsPaginator { + options := ListV2LoggingLevelsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListV2LoggingLevelsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListV2LoggingLevelsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListV2LoggingLevels page. +func (p *ListV2LoggingLevelsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListV2LoggingLevelsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListV2LoggingLevels(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListPrincipalThingsAPIClient is a client that implements the ListPrincipalThings +// operation. +type ListPrincipalThingsAPIClient interface { + ListPrincipalThings(context.Context, *ListPrincipalThingsInput, ...func(*Options)) (*ListPrincipalThingsOutput, error) +} + +var _ ListPrincipalThingsAPIClient = (*Client)(nil) + +// ListPrincipalThingsPaginatorOptions is the paginator options for +// ListPrincipalThings +type ListPrincipalThingsPaginatorOptions struct { + // The maximum number of results to return in this operation. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListPrincipalThingsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListPrincipalThings +type ListPrincipalThingsPaginator struct { + options ListPrincipalThingsPaginatorOptions + client ListPrincipalThingsAPIClient + params *ListPrincipalThingsInput + nextToken *string + firstPage bool + done bool +} + +// NewListPrincipalThingsPaginator returns a new ListPrincipalThingsPaginator +func NewListPrincipalThingsPaginator(client ListPrincipalThingsAPIClient, params *ListPrincipalThingsInput, optFns ...func(*ListPrincipalThingsPaginatorOptions)) *ListPrincipalThingsPaginator { + options := ListPrincipalThingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListPrincipalThingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPrincipalThingsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListPrincipalThings page. +func (p *ListPrincipalThingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPrincipalThingsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListPrincipalThings(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListRoleAliasesAPIClient is a client that implements the ListRoleAliases +// operation. +type ListRoleAliasesAPIClient interface { + ListRoleAliases(context.Context, *ListRoleAliasesInput, ...func(*Options)) (*ListRoleAliasesOutput, error) +} + +var _ ListRoleAliasesAPIClient = (*Client)(nil) + +// ListRoleAliasesPaginatorOptions is the paginator options for ListRoleAliases +type ListRoleAliasesPaginatorOptions struct { + // The maximum number of results to return at one time. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListRoleAliasesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListRoleAliases +type ListRoleAliasesPaginator struct { + options ListRoleAliasesPaginatorOptions + client ListRoleAliasesAPIClient + params *ListRoleAliasesInput + nextToken *string + firstPage bool + done bool +} + +// NewListRoleAliasesPaginator returns a new ListRoleAliasesPaginator +func NewListRoleAliasesPaginator(client ListRoleAliasesAPIClient, params *ListRoleAliasesInput, optFns ...func(*ListRoleAliasesPaginatorOptions)) *ListRoleAliasesPaginator { + options := ListRoleAliasesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListRoleAliasesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRoleAliasesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListRoleAliases page. +func (p *ListRoleAliasesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRoleAliasesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.PageSize = p.options.Limit + result, err := p.client.ListRoleAliases(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListThingGroupsAPIClient is a client that implements the ListThingGroups +// operation. +type ListThingGroupsAPIClient interface { + ListThingGroups(context.Context, *ListThingGroupsInput, ...func(*Options)) (*ListThingGroupsOutput, error) +} + +var _ ListThingGroupsAPIClient = (*Client)(nil) + +// ListThingGroupsPaginatorOptions is the paginator options for ListThingGroups +type ListThingGroupsPaginatorOptions struct { + // The maximum number of results to return at one time. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListThingGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListThingGroups +type ListThingGroupsPaginator struct { + options ListThingGroupsPaginatorOptions + client ListThingGroupsAPIClient + params *ListThingGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewListThingGroupsPaginator returns a new ListThingGroupsPaginator +func NewListThingGroupsPaginator(client ListThingGroupsAPIClient, params *ListThingGroupsInput, optFns ...func(*ListThingGroupsPaginatorOptions)) *ListThingGroupsPaginator { + options := ListThingGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListThingGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListThingGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListThingGroups page. +func (p *ListThingGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListThingGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListThingGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListAuditSuppressionsAPIClient is a client that implements the +// ListAuditSuppressions operation. +type ListAuditSuppressionsAPIClient interface { + ListAuditSuppressions(context.Context, *ListAuditSuppressionsInput, ...func(*Options)) (*ListAuditSuppressionsOutput, error) +} + +var _ ListAuditSuppressionsAPIClient = (*Client)(nil) + +// ListAuditSuppressionsPaginatorOptions is the paginator options for +// ListAuditSuppressions +type ListAuditSuppressionsPaginatorOptions struct { + // The maximum number of results to return at one time. The default is 25. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAuditSuppressionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListAuditSuppressions +type ListAuditSuppressionsPaginator struct { + options ListAuditSuppressionsPaginatorOptions + client ListAuditSuppressionsAPIClient + params *ListAuditSuppressionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListAuditSuppressionsPaginator returns a new ListAuditSuppressionsPaginator +func NewListAuditSuppressionsPaginator(client ListAuditSuppressionsAPIClient, params *ListAuditSuppressionsInput, optFns ...func(*ListAuditSuppressionsPaginatorOptions)) *ListAuditSuppressionsPaginator { + options := ListAuditSuppressionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAuditSuppressionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAuditSuppressionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAuditSuppressions page. +func (p *ListAuditSuppressionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAuditSuppressionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListAuditSuppressions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListJobExecutionsForJobAPIClient is a client that implements the +// ListJobExecutionsForJob operation. +type ListJobExecutionsForJobAPIClient interface { + ListJobExecutionsForJob(context.Context, *ListJobExecutionsForJobInput, ...func(*Options)) (*ListJobExecutionsForJobOutput, error) +} + +var _ ListJobExecutionsForJobAPIClient = (*Client)(nil) + +// ListJobExecutionsForJobPaginatorOptions is the paginator options for +// ListJobExecutionsForJob +type ListJobExecutionsForJobPaginatorOptions struct { + // The maximum number of results to be returned per request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListJobExecutionsForJobPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListJobExecutionsForJob +type ListJobExecutionsForJobPaginator struct { + options ListJobExecutionsForJobPaginatorOptions + client ListJobExecutionsForJobAPIClient + params *ListJobExecutionsForJobInput + nextToken *string + firstPage bool + done bool +} + +// NewListJobExecutionsForJobPaginator returns a new +// ListJobExecutionsForJobPaginator +func NewListJobExecutionsForJobPaginator(client ListJobExecutionsForJobAPIClient, params *ListJobExecutionsForJobInput, optFns ...func(*ListJobExecutionsForJobPaginatorOptions)) *ListJobExecutionsForJobPaginator { + options := ListJobExecutionsForJobPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListJobExecutionsForJobPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListJobExecutionsForJobPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListJobExecutionsForJob page. +func (p *ListJobExecutionsForJobPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListJobExecutionsForJobOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListJobExecutionsForJob(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListIndicesAPIClient is a client that implements the ListIndices operation. +type ListIndicesAPIClient interface { + ListIndices(context.Context, *ListIndicesInput, ...func(*Options)) (*ListIndicesOutput, error) +} + +var _ ListIndicesAPIClient = (*Client)(nil) + +// ListIndicesPaginatorOptions is the paginator options for ListIndices +type ListIndicesPaginatorOptions struct { + // The maximum number of results to return at one time. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListIndicesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListIndices +type ListIndicesPaginator struct { + options ListIndicesPaginatorOptions + client ListIndicesAPIClient + params *ListIndicesInput + nextToken *string + firstPage bool + done bool +} + +// NewListIndicesPaginator returns a new ListIndicesPaginator +func NewListIndicesPaginator(client ListIndicesAPIClient, params *ListIndicesInput, optFns ...func(*ListIndicesPaginatorOptions)) *ListIndicesPaginator { + options := ListIndicesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListIndicesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListIndicesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListIndices page. +func (p *ListIndicesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListIndicesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListIndices(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListThingsInThingGroupAPIClient is a client that implements the +// ListThingsInThingGroup operation. +type ListThingsInThingGroupAPIClient interface { + ListThingsInThingGroup(context.Context, *ListThingsInThingGroupInput, ...func(*Options)) (*ListThingsInThingGroupOutput, error) +} + +var _ ListThingsInThingGroupAPIClient = (*Client)(nil) + +// ListThingsInThingGroupPaginatorOptions is the paginator options for +// ListThingsInThingGroup +type ListThingsInThingGroupPaginatorOptions struct { + // The maximum number of results to return at one time. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListThingsInThingGroupPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListThingsInThingGroup +type ListThingsInThingGroupPaginator struct { + options ListThingsInThingGroupPaginatorOptions + client ListThingsInThingGroupAPIClient + params *ListThingsInThingGroupInput + nextToken *string + firstPage bool + done bool +} + +// NewListThingsInThingGroupPaginator returns a new ListThingsInThingGroupPaginator +func NewListThingsInThingGroupPaginator(client ListThingsInThingGroupAPIClient, params *ListThingsInThingGroupInput, optFns ...func(*ListThingsInThingGroupPaginatorOptions)) *ListThingsInThingGroupPaginator { + options := ListThingsInThingGroupPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListThingsInThingGroupPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListThingsInThingGroupPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListThingsInThingGroup page. +func (p *ListThingsInThingGroupPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListThingsInThingGroupOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListThingsInThingGroup(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListThingsInBillingGroupAPIClient is a client that implements the +// ListThingsInBillingGroup operation. +type ListThingsInBillingGroupAPIClient interface { + ListThingsInBillingGroup(context.Context, *ListThingsInBillingGroupInput, ...func(*Options)) (*ListThingsInBillingGroupOutput, error) +} + +var _ ListThingsInBillingGroupAPIClient = (*Client)(nil) + +// ListThingsInBillingGroupPaginatorOptions is the paginator options for +// ListThingsInBillingGroup +type ListThingsInBillingGroupPaginatorOptions struct { + // The maximum number of results to return per request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListThingsInBillingGroupPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListThingsInBillingGroup +type ListThingsInBillingGroupPaginator struct { + options ListThingsInBillingGroupPaginatorOptions + client ListThingsInBillingGroupAPIClient + params *ListThingsInBillingGroupInput + nextToken *string + firstPage bool + done bool +} + +// NewListThingsInBillingGroupPaginator returns a new +// ListThingsInBillingGroupPaginator +func NewListThingsInBillingGroupPaginator(client ListThingsInBillingGroupAPIClient, params *ListThingsInBillingGroupInput, optFns ...func(*ListThingsInBillingGroupPaginatorOptions)) *ListThingsInBillingGroupPaginator { + options := ListThingsInBillingGroupPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListThingsInBillingGroupPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListThingsInBillingGroupPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListThingsInBillingGroup page. +func (p *ListThingsInBillingGroupPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListThingsInBillingGroupOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListThingsInBillingGroup(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListJobExecutionsForThingAPIClient is a client that implements the +// ListJobExecutionsForThing operation. +type ListJobExecutionsForThingAPIClient interface { + ListJobExecutionsForThing(context.Context, *ListJobExecutionsForThingInput, ...func(*Options)) (*ListJobExecutionsForThingOutput, error) +} + +var _ ListJobExecutionsForThingAPIClient = (*Client)(nil) + +// ListJobExecutionsForThingPaginatorOptions is the paginator options for +// ListJobExecutionsForThing +type ListJobExecutionsForThingPaginatorOptions struct { + // The maximum number of results to be returned per request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListJobExecutionsForThingPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListJobExecutionsForThing +type ListJobExecutionsForThingPaginator struct { + options ListJobExecutionsForThingPaginatorOptions + client ListJobExecutionsForThingAPIClient + params *ListJobExecutionsForThingInput + nextToken *string + firstPage bool + done bool +} + +// NewListJobExecutionsForThingPaginator returns a new +// ListJobExecutionsForThingPaginator +func NewListJobExecutionsForThingPaginator(client ListJobExecutionsForThingAPIClient, params *ListJobExecutionsForThingInput, optFns ...func(*ListJobExecutionsForThingPaginatorOptions)) *ListJobExecutionsForThingPaginator { + options := ListJobExecutionsForThingPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListJobExecutionsForThingPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListJobExecutionsForThingPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListJobExecutionsForThing page. +func (p *ListJobExecutionsForThingPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListJobExecutionsForThingOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListJobExecutionsForThing(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListCACertificatesAPIClient is a client that implements the ListCACertificates +// operation. +type ListCACertificatesAPIClient interface { + ListCACertificates(context.Context, *ListCACertificatesInput, ...func(*Options)) (*ListCACertificatesOutput, error) +} + +var _ ListCACertificatesAPIClient = (*Client)(nil) + +// ListCACertificatesPaginatorOptions is the paginator options for +// ListCACertificates +type ListCACertificatesPaginatorOptions struct { + // The result page size. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListCACertificatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListCACertificates +type ListCACertificatesPaginator struct { + options ListCACertificatesPaginatorOptions + client ListCACertificatesAPIClient + params *ListCACertificatesInput + nextToken *string + firstPage bool + done bool +} + +// NewListCACertificatesPaginator returns a new ListCACertificatesPaginator +func NewListCACertificatesPaginator(client ListCACertificatesAPIClient, params *ListCACertificatesInput, optFns ...func(*ListCACertificatesPaginatorOptions)) *ListCACertificatesPaginator { + options := ListCACertificatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListCACertificatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCACertificatesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListCACertificates page. +func (p *ListCACertificatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCACertificatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.PageSize = p.options.Limit + result, err := p.client.ListCACertificates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListMitigationActionsAPIClient is a client that implements the +// ListMitigationActions operation. +type ListMitigationActionsAPIClient interface { + ListMitigationActions(context.Context, *ListMitigationActionsInput, ...func(*Options)) (*ListMitigationActionsOutput, error) +} + +var _ ListMitigationActionsAPIClient = (*Client)(nil) + +// ListMitigationActionsPaginatorOptions is the paginator options for +// ListMitigationActions +type ListMitigationActionsPaginatorOptions struct { + // The maximum number of results to return at one time. The default is 25. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListMitigationActionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListMitigationActions +type ListMitigationActionsPaginator struct { + options ListMitigationActionsPaginatorOptions + client ListMitigationActionsAPIClient + params *ListMitigationActionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListMitigationActionsPaginator returns a new ListMitigationActionsPaginator +func NewListMitigationActionsPaginator(client ListMitigationActionsAPIClient, params *ListMitigationActionsInput, optFns ...func(*ListMitigationActionsPaginatorOptions)) *ListMitigationActionsPaginator { + options := ListMitigationActionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListMitigationActionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMitigationActionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListMitigationActions page. +func (p *ListMitigationActionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMitigationActionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListMitigationActions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListAuthorizersAPIClient is a client that implements the ListAuthorizers +// operation. +type ListAuthorizersAPIClient interface { + ListAuthorizers(context.Context, *ListAuthorizersInput, ...func(*Options)) (*ListAuthorizersOutput, error) +} + +var _ ListAuthorizersAPIClient = (*Client)(nil) + +// ListAuthorizersPaginatorOptions is the paginator options for ListAuthorizers +type ListAuthorizersPaginatorOptions struct { + // The maximum number of results to return at one time. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAuthorizersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListAuthorizers +type ListAuthorizersPaginator struct { + options ListAuthorizersPaginatorOptions + client ListAuthorizersAPIClient + params *ListAuthorizersInput + nextToken *string + firstPage bool + done bool +} + +// NewListAuthorizersPaginator returns a new ListAuthorizersPaginator +func NewListAuthorizersPaginator(client ListAuthorizersAPIClient, params *ListAuthorizersInput, optFns ...func(*ListAuthorizersPaginatorOptions)) *ListAuthorizersPaginator { + options := ListAuthorizersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAuthorizersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAuthorizersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAuthorizers page. +func (p *ListAuthorizersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAuthorizersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.PageSize = p.options.Limit + result, err := p.client.ListAuthorizers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListCertificatesByCAAPIClient is a client that implements the +// ListCertificatesByCA operation. +type ListCertificatesByCAAPIClient interface { + ListCertificatesByCA(context.Context, *ListCertificatesByCAInput, ...func(*Options)) (*ListCertificatesByCAOutput, error) +} + +var _ ListCertificatesByCAAPIClient = (*Client)(nil) + +// ListCertificatesByCAPaginatorOptions is the paginator options for +// ListCertificatesByCA +type ListCertificatesByCAPaginatorOptions struct { + // The result page size. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListCertificatesByCAPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListCertificatesByCA +type ListCertificatesByCAPaginator struct { + options ListCertificatesByCAPaginatorOptions + client ListCertificatesByCAAPIClient + params *ListCertificatesByCAInput + nextToken *string + firstPage bool + done bool +} + +// NewListCertificatesByCAPaginator returns a new ListCertificatesByCAPaginator +func NewListCertificatesByCAPaginator(client ListCertificatesByCAAPIClient, params *ListCertificatesByCAInput, optFns ...func(*ListCertificatesByCAPaginatorOptions)) *ListCertificatesByCAPaginator { + options := ListCertificatesByCAPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListCertificatesByCAPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCertificatesByCAPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListCertificatesByCA page. +func (p *ListCertificatesByCAPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCertificatesByCAOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.PageSize = p.options.Limit + result, err := p.client.ListCertificatesByCA(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListOutgoingCertificatesAPIClient is a client that implements the +// ListOutgoingCertificates operation. +type ListOutgoingCertificatesAPIClient interface { + ListOutgoingCertificates(context.Context, *ListOutgoingCertificatesInput, ...func(*Options)) (*ListOutgoingCertificatesOutput, error) +} + +var _ ListOutgoingCertificatesAPIClient = (*Client)(nil) + +// ListOutgoingCertificatesPaginatorOptions is the paginator options for +// ListOutgoingCertificates +type ListOutgoingCertificatesPaginatorOptions struct { + // The result page size. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListOutgoingCertificatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListOutgoingCertificates +type ListOutgoingCertificatesPaginator struct { + options ListOutgoingCertificatesPaginatorOptions + client ListOutgoingCertificatesAPIClient + params *ListOutgoingCertificatesInput + nextToken *string + firstPage bool + done bool +} + +// NewListOutgoingCertificatesPaginator returns a new +// ListOutgoingCertificatesPaginator +func NewListOutgoingCertificatesPaginator(client ListOutgoingCertificatesAPIClient, params *ListOutgoingCertificatesInput, optFns ...func(*ListOutgoingCertificatesPaginatorOptions)) *ListOutgoingCertificatesPaginator { + options := ListOutgoingCertificatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListOutgoingCertificatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListOutgoingCertificatesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListOutgoingCertificates page. +func (p *ListOutgoingCertificatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListOutgoingCertificatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.PageSize = p.options.Limit + result, err := p.client.ListOutgoingCertificates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListThingRegistrationTaskReportsAPIClient is a client that implements the +// ListThingRegistrationTaskReports operation. +type ListThingRegistrationTaskReportsAPIClient interface { + ListThingRegistrationTaskReports(context.Context, *ListThingRegistrationTaskReportsInput, ...func(*Options)) (*ListThingRegistrationTaskReportsOutput, error) +} + +var _ ListThingRegistrationTaskReportsAPIClient = (*Client)(nil) + +// ListThingRegistrationTaskReportsPaginatorOptions is the paginator options for +// ListThingRegistrationTaskReports +type ListThingRegistrationTaskReportsPaginatorOptions struct { + // The maximum number of results to return per request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListThingRegistrationTaskReportsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListThingRegistrationTaskReports +type ListThingRegistrationTaskReportsPaginator struct { + options ListThingRegistrationTaskReportsPaginatorOptions + client ListThingRegistrationTaskReportsAPIClient + params *ListThingRegistrationTaskReportsInput + nextToken *string + firstPage bool + done bool +} + +// NewListThingRegistrationTaskReportsPaginator returns a new +// ListThingRegistrationTaskReportsPaginator +func NewListThingRegistrationTaskReportsPaginator(client ListThingRegistrationTaskReportsAPIClient, params *ListThingRegistrationTaskReportsInput, optFns ...func(*ListThingRegistrationTaskReportsPaginatorOptions)) *ListThingRegistrationTaskReportsPaginator { + options := ListThingRegistrationTaskReportsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListThingRegistrationTaskReportsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListThingRegistrationTaskReportsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListThingRegistrationTaskReports page. +func (p *ListThingRegistrationTaskReportsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListThingRegistrationTaskReportsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListThingRegistrationTaskReports(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListStreamsAPIClient is a client that implements the ListStreams operation. +type ListStreamsAPIClient interface { + ListStreams(context.Context, *ListStreamsInput, ...func(*Options)) (*ListStreamsOutput, error) +} + +var _ ListStreamsAPIClient = (*Client)(nil) + +// ListStreamsPaginatorOptions is the paginator options for ListStreams +type ListStreamsPaginatorOptions struct { + // The maximum number of results to return at a time. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListStreamsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListStreams +type ListStreamsPaginator struct { + options ListStreamsPaginatorOptions + client ListStreamsAPIClient + params *ListStreamsInput + nextToken *string + firstPage bool + done bool +} + +// NewListStreamsPaginator returns a new ListStreamsPaginator +func NewListStreamsPaginator(client ListStreamsAPIClient, params *ListStreamsInput, optFns ...func(*ListStreamsPaginatorOptions)) *ListStreamsPaginator { + options := ListStreamsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListStreamsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListStreamsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListStreams page. +func (p *ListStreamsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListStreamsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListStreams(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListSecurityProfilesForTargetAPIClient is a client that implements the +// ListSecurityProfilesForTarget operation. +type ListSecurityProfilesForTargetAPIClient interface { + ListSecurityProfilesForTarget(context.Context, *ListSecurityProfilesForTargetInput, ...func(*Options)) (*ListSecurityProfilesForTargetOutput, error) +} + +var _ ListSecurityProfilesForTargetAPIClient = (*Client)(nil) + +// ListSecurityProfilesForTargetPaginatorOptions is the paginator options for +// ListSecurityProfilesForTarget +type ListSecurityProfilesForTargetPaginatorOptions struct { + // The maximum number of results to return at one time. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListSecurityProfilesForTargetPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListSecurityProfilesForTarget +type ListSecurityProfilesForTargetPaginator struct { + options ListSecurityProfilesForTargetPaginatorOptions + client ListSecurityProfilesForTargetAPIClient + params *ListSecurityProfilesForTargetInput + nextToken *string + firstPage bool + done bool +} + +// NewListSecurityProfilesForTargetPaginator returns a new +// ListSecurityProfilesForTargetPaginator +func NewListSecurityProfilesForTargetPaginator(client ListSecurityProfilesForTargetAPIClient, params *ListSecurityProfilesForTargetInput, optFns ...func(*ListSecurityProfilesForTargetPaginatorOptions)) *ListSecurityProfilesForTargetPaginator { + options := ListSecurityProfilesForTargetPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListSecurityProfilesForTargetPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSecurityProfilesForTargetPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListSecurityProfilesForTarget page. +func (p *ListSecurityProfilesForTargetPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSecurityProfilesForTargetOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListSecurityProfilesForTarget(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListPrincipalPoliciesAPIClient is a client that implements the +// ListPrincipalPolicies operation. +type ListPrincipalPoliciesAPIClient interface { + ListPrincipalPolicies(context.Context, *ListPrincipalPoliciesInput, ...func(*Options)) (*ListPrincipalPoliciesOutput, error) +} + +var _ ListPrincipalPoliciesAPIClient = (*Client)(nil) + +// ListPrincipalPoliciesPaginatorOptions is the paginator options for +// ListPrincipalPolicies +type ListPrincipalPoliciesPaginatorOptions struct { + // The result page size. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListPrincipalPoliciesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListPrincipalPolicies +type ListPrincipalPoliciesPaginator struct { + options ListPrincipalPoliciesPaginatorOptions + client ListPrincipalPoliciesAPIClient + params *ListPrincipalPoliciesInput + nextToken *string + firstPage bool + done bool +} + +// NewListPrincipalPoliciesPaginator returns a new ListPrincipalPoliciesPaginator +func NewListPrincipalPoliciesPaginator(client ListPrincipalPoliciesAPIClient, params *ListPrincipalPoliciesInput, optFns ...func(*ListPrincipalPoliciesPaginatorOptions)) *ListPrincipalPoliciesPaginator { + options := ListPrincipalPoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListPrincipalPoliciesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPrincipalPoliciesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListPrincipalPolicies page. +func (p *ListPrincipalPoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPrincipalPoliciesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.PageSize = p.options.Limit + result, err := p.client.ListPrincipalPolicies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListBillingGroupsAPIClient is a client that implements the ListBillingGroups +// operation. +type ListBillingGroupsAPIClient interface { + ListBillingGroups(context.Context, *ListBillingGroupsInput, ...func(*Options)) (*ListBillingGroupsOutput, error) +} + +var _ ListBillingGroupsAPIClient = (*Client)(nil) + +// ListBillingGroupsPaginatorOptions is the paginator options for ListBillingGroups +type ListBillingGroupsPaginatorOptions struct { + // The maximum number of results to return per request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListBillingGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListBillingGroups +type ListBillingGroupsPaginator struct { + options ListBillingGroupsPaginatorOptions + client ListBillingGroupsAPIClient + params *ListBillingGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewListBillingGroupsPaginator returns a new ListBillingGroupsPaginator +func NewListBillingGroupsPaginator(client ListBillingGroupsAPIClient, params *ListBillingGroupsInput, optFns ...func(*ListBillingGroupsPaginatorOptions)) *ListBillingGroupsPaginator { + options := ListBillingGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListBillingGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListBillingGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListBillingGroups page. +func (p *ListBillingGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBillingGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListBillingGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListCertificatesAPIClient is a client that implements the ListCertificates +// operation. +type ListCertificatesAPIClient interface { + ListCertificates(context.Context, *ListCertificatesInput, ...func(*Options)) (*ListCertificatesOutput, error) +} + +var _ ListCertificatesAPIClient = (*Client)(nil) + +// ListCertificatesPaginatorOptions is the paginator options for ListCertificates +type ListCertificatesPaginatorOptions struct { + // The result page size. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListCertificatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListCertificates +type ListCertificatesPaginator struct { + options ListCertificatesPaginatorOptions + client ListCertificatesAPIClient + params *ListCertificatesInput + nextToken *string + firstPage bool + done bool +} + +// NewListCertificatesPaginator returns a new ListCertificatesPaginator +func NewListCertificatesPaginator(client ListCertificatesAPIClient, params *ListCertificatesInput, optFns ...func(*ListCertificatesPaginatorOptions)) *ListCertificatesPaginator { + options := ListCertificatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListCertificatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCertificatesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListCertificates page. +func (p *ListCertificatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCertificatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.PageSize = p.options.Limit + result, err := p.client.ListCertificates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListSecurityProfilesAPIClient is a client that implements the +// ListSecurityProfiles operation. +type ListSecurityProfilesAPIClient interface { + ListSecurityProfiles(context.Context, *ListSecurityProfilesInput, ...func(*Options)) (*ListSecurityProfilesOutput, error) +} + +var _ ListSecurityProfilesAPIClient = (*Client)(nil) + +// ListSecurityProfilesPaginatorOptions is the paginator options for +// ListSecurityProfiles +type ListSecurityProfilesPaginatorOptions struct { + // The maximum number of results to return at one time. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListSecurityProfilesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListSecurityProfiles +type ListSecurityProfilesPaginator struct { + options ListSecurityProfilesPaginatorOptions + client ListSecurityProfilesAPIClient + params *ListSecurityProfilesInput + nextToken *string + firstPage bool + done bool +} + +// NewListSecurityProfilesPaginator returns a new ListSecurityProfilesPaginator +func NewListSecurityProfilesPaginator(client ListSecurityProfilesAPIClient, params *ListSecurityProfilesInput, optFns ...func(*ListSecurityProfilesPaginatorOptions)) *ListSecurityProfilesPaginator { + options := ListSecurityProfilesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListSecurityProfilesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSecurityProfilesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListSecurityProfiles page. +func (p *ListSecurityProfilesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSecurityProfilesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListSecurityProfiles(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListJobsAPIClient is a client that implements the ListJobs operation. +type ListJobsAPIClient interface { + ListJobs(context.Context, *ListJobsInput, ...func(*Options)) (*ListJobsOutput, error) +} + +var _ ListJobsAPIClient = (*Client)(nil) + +// ListJobsPaginatorOptions is the paginator options for ListJobs +type ListJobsPaginatorOptions struct { + // The maximum number of results to return per request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListJobs +type ListJobsPaginator struct { + options ListJobsPaginatorOptions + client ListJobsAPIClient + params *ListJobsInput + nextToken *string + firstPage bool + done bool +} + +// NewListJobsPaginator returns a new ListJobsPaginator +func NewListJobsPaginator(client ListJobsAPIClient, params *ListJobsInput, optFns ...func(*ListJobsPaginatorOptions)) *ListJobsPaginator { + options := ListJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListJobsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListJobs page. +func (p *ListJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListThingsAPIClient is a client that implements the ListThings operation. +type ListThingsAPIClient interface { + ListThings(context.Context, *ListThingsInput, ...func(*Options)) (*ListThingsOutput, error) +} + +var _ ListThingsAPIClient = (*Client)(nil) + +// ListThingsPaginatorOptions is the paginator options for ListThings +type ListThingsPaginatorOptions struct { + // The maximum number of results to return in this operation. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListThingsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListThings +type ListThingsPaginator struct { + options ListThingsPaginatorOptions + client ListThingsAPIClient + params *ListThingsInput + nextToken *string + firstPage bool + done bool +} + +// NewListThingsPaginator returns a new ListThingsPaginator +func NewListThingsPaginator(client ListThingsAPIClient, params *ListThingsInput, optFns ...func(*ListThingsPaginatorOptions)) *ListThingsPaginator { + options := ListThingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListThingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListThingsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListThings page. +func (p *ListThingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListThingsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListThings(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListProvisioningTemplateVersionsAPIClient is a client that implements the +// ListProvisioningTemplateVersions operation. +type ListProvisioningTemplateVersionsAPIClient interface { + ListProvisioningTemplateVersions(context.Context, *ListProvisioningTemplateVersionsInput, ...func(*Options)) (*ListProvisioningTemplateVersionsOutput, error) +} + +var _ ListProvisioningTemplateVersionsAPIClient = (*Client)(nil) + +// ListProvisioningTemplateVersionsPaginatorOptions is the paginator options for +// ListProvisioningTemplateVersions +type ListProvisioningTemplateVersionsPaginatorOptions struct { + // The maximum number of results to return at one time. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListProvisioningTemplateVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListProvisioningTemplateVersions +type ListProvisioningTemplateVersionsPaginator struct { + options ListProvisioningTemplateVersionsPaginatorOptions + client ListProvisioningTemplateVersionsAPIClient + params *ListProvisioningTemplateVersionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListProvisioningTemplateVersionsPaginator returns a new +// ListProvisioningTemplateVersionsPaginator +func NewListProvisioningTemplateVersionsPaginator(client ListProvisioningTemplateVersionsAPIClient, params *ListProvisioningTemplateVersionsInput, optFns ...func(*ListProvisioningTemplateVersionsPaginatorOptions)) *ListProvisioningTemplateVersionsPaginator { + options := ListProvisioningTemplateVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListProvisioningTemplateVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListProvisioningTemplateVersionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListProvisioningTemplateVersions page. +func (p *ListProvisioningTemplateVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProvisioningTemplateVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListProvisioningTemplateVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListOTAUpdatesAPIClient is a client that implements the ListOTAUpdates +// operation. +type ListOTAUpdatesAPIClient interface { + ListOTAUpdates(context.Context, *ListOTAUpdatesInput, ...func(*Options)) (*ListOTAUpdatesOutput, error) +} + +var _ ListOTAUpdatesAPIClient = (*Client)(nil) + +// ListOTAUpdatesPaginatorOptions is the paginator options for ListOTAUpdates +type ListOTAUpdatesPaginatorOptions struct { + // The maximum number of results to return at one time. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListOTAUpdatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListOTAUpdates +type ListOTAUpdatesPaginator struct { + options ListOTAUpdatesPaginatorOptions + client ListOTAUpdatesAPIClient + params *ListOTAUpdatesInput + nextToken *string + firstPage bool + done bool +} + +// NewListOTAUpdatesPaginator returns a new ListOTAUpdatesPaginator +func NewListOTAUpdatesPaginator(client ListOTAUpdatesAPIClient, params *ListOTAUpdatesInput, optFns ...func(*ListOTAUpdatesPaginatorOptions)) *ListOTAUpdatesPaginator { + options := ListOTAUpdatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListOTAUpdatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListOTAUpdatesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListOTAUpdates page. +func (p *ListOTAUpdatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListOTAUpdatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListOTAUpdates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListAuditTasksAPIClient is a client that implements the ListAuditTasks +// operation. +type ListAuditTasksAPIClient interface { + ListAuditTasks(context.Context, *ListAuditTasksInput, ...func(*Options)) (*ListAuditTasksOutput, error) +} + +var _ ListAuditTasksAPIClient = (*Client)(nil) + +// ListAuditTasksPaginatorOptions is the paginator options for ListAuditTasks +type ListAuditTasksPaginatorOptions struct { + // The maximum number of results to return at one time. The default is 25. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAuditTasksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListAuditTasks +type ListAuditTasksPaginator struct { + options ListAuditTasksPaginatorOptions + client ListAuditTasksAPIClient + params *ListAuditTasksInput + nextToken *string + firstPage bool + done bool +} + +// NewListAuditTasksPaginator returns a new ListAuditTasksPaginator +func NewListAuditTasksPaginator(client ListAuditTasksAPIClient, params *ListAuditTasksInput, optFns ...func(*ListAuditTasksPaginatorOptions)) *ListAuditTasksPaginator { + options := ListAuditTasksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAuditTasksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAuditTasksPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAuditTasks page. +func (p *ListAuditTasksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAuditTasksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListAuditTasks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListAttachedPoliciesAPIClient is a client that implements the +// ListAttachedPolicies operation. +type ListAttachedPoliciesAPIClient interface { + ListAttachedPolicies(context.Context, *ListAttachedPoliciesInput, ...func(*Options)) (*ListAttachedPoliciesOutput, error) +} + +var _ ListAttachedPoliciesAPIClient = (*Client)(nil) + +// ListAttachedPoliciesPaginatorOptions is the paginator options for +// ListAttachedPolicies +type ListAttachedPoliciesPaginatorOptions struct { + // The maximum number of results to be returned per request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAttachedPoliciesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListAttachedPolicies +type ListAttachedPoliciesPaginator struct { + options ListAttachedPoliciesPaginatorOptions + client ListAttachedPoliciesAPIClient + params *ListAttachedPoliciesInput + nextToken *string + firstPage bool + done bool +} + +// NewListAttachedPoliciesPaginator returns a new ListAttachedPoliciesPaginator +func NewListAttachedPoliciesPaginator(client ListAttachedPoliciesAPIClient, params *ListAttachedPoliciesInput, optFns ...func(*ListAttachedPoliciesPaginatorOptions)) *ListAttachedPoliciesPaginator { + options := ListAttachedPoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAttachedPoliciesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAttachedPoliciesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAttachedPolicies page. +func (p *ListAttachedPoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAttachedPoliciesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.PageSize = p.options.Limit + result, err := p.client.ListAttachedPolicies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListThingGroupsForThingAPIClient is a client that implements the +// ListThingGroupsForThing operation. +type ListThingGroupsForThingAPIClient interface { + ListThingGroupsForThing(context.Context, *ListThingGroupsForThingInput, ...func(*Options)) (*ListThingGroupsForThingOutput, error) +} + +var _ ListThingGroupsForThingAPIClient = (*Client)(nil) + +// ListThingGroupsForThingPaginatorOptions is the paginator options for +// ListThingGroupsForThing +type ListThingGroupsForThingPaginatorOptions struct { + // The maximum number of results to return at one time. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListThingGroupsForThingPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListThingGroupsForThing +type ListThingGroupsForThingPaginator struct { + options ListThingGroupsForThingPaginatorOptions + client ListThingGroupsForThingAPIClient + params *ListThingGroupsForThingInput + nextToken *string + firstPage bool + done bool +} + +// NewListThingGroupsForThingPaginator returns a new +// ListThingGroupsForThingPaginator +func NewListThingGroupsForThingPaginator(client ListThingGroupsForThingAPIClient, params *ListThingGroupsForThingInput, optFns ...func(*ListThingGroupsForThingPaginatorOptions)) *ListThingGroupsForThingPaginator { + options := ListThingGroupsForThingPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListThingGroupsForThingPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListThingGroupsForThingPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListThingGroupsForThing page. +func (p *ListThingGroupsForThingPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListThingGroupsForThingOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListThingGroupsForThing(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTargetsForPolicyAPIClient is a client that implements the +// ListTargetsForPolicy operation. +type ListTargetsForPolicyAPIClient interface { + ListTargetsForPolicy(context.Context, *ListTargetsForPolicyInput, ...func(*Options)) (*ListTargetsForPolicyOutput, error) +} + +var _ ListTargetsForPolicyAPIClient = (*Client)(nil) + +// ListTargetsForPolicyPaginatorOptions is the paginator options for +// ListTargetsForPolicy +type ListTargetsForPolicyPaginatorOptions struct { + // The maximum number of results to return at one time. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTargetsForPolicyPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListTargetsForPolicy +type ListTargetsForPolicyPaginator struct { + options ListTargetsForPolicyPaginatorOptions + client ListTargetsForPolicyAPIClient + params *ListTargetsForPolicyInput + nextToken *string + firstPage bool + done bool +} + +// NewListTargetsForPolicyPaginator returns a new ListTargetsForPolicyPaginator +func NewListTargetsForPolicyPaginator(client ListTargetsForPolicyAPIClient, params *ListTargetsForPolicyInput, optFns ...func(*ListTargetsForPolicyPaginatorOptions)) *ListTargetsForPolicyPaginator { + options := ListTargetsForPolicyPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTargetsForPolicyPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTargetsForPolicyPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTargetsForPolicy page. +func (p *ListTargetsForPolicyPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTargetsForPolicyOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.PageSize = p.options.Limit + result, err := p.client.ListTargetsForPolicy(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListActiveViolationsAPIClient is a client that implements the +// ListActiveViolations operation. +type ListActiveViolationsAPIClient interface { + ListActiveViolations(context.Context, *ListActiveViolationsInput, ...func(*Options)) (*ListActiveViolationsOutput, error) +} + +var _ ListActiveViolationsAPIClient = (*Client)(nil) + +// ListActiveViolationsPaginatorOptions is the paginator options for +// ListActiveViolations +type ListActiveViolationsPaginatorOptions struct { + // The maximum number of results to return at one time. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListActiveViolationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListActiveViolations +type ListActiveViolationsPaginator struct { + options ListActiveViolationsPaginatorOptions + client ListActiveViolationsAPIClient + params *ListActiveViolationsInput + nextToken *string + firstPage bool + done bool +} + +// NewListActiveViolationsPaginator returns a new ListActiveViolationsPaginator +func NewListActiveViolationsPaginator(client ListActiveViolationsAPIClient, params *ListActiveViolationsInput, optFns ...func(*ListActiveViolationsPaginatorOptions)) *ListActiveViolationsPaginator { + options := ListActiveViolationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListActiveViolationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListActiveViolationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListActiveViolations page. +func (p *ListActiveViolationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListActiveViolationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListActiveViolations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTargetsForSecurityProfileAPIClient is a client that implements the +// ListTargetsForSecurityProfile operation. +type ListTargetsForSecurityProfileAPIClient interface { + ListTargetsForSecurityProfile(context.Context, *ListTargetsForSecurityProfileInput, ...func(*Options)) (*ListTargetsForSecurityProfileOutput, error) +} + +var _ ListTargetsForSecurityProfileAPIClient = (*Client)(nil) + +// ListTargetsForSecurityProfilePaginatorOptions is the paginator options for +// ListTargetsForSecurityProfile +type ListTargetsForSecurityProfilePaginatorOptions struct { + // The maximum number of results to return at one time. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTargetsForSecurityProfilePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListTargetsForSecurityProfile +type ListTargetsForSecurityProfilePaginator struct { + options ListTargetsForSecurityProfilePaginatorOptions + client ListTargetsForSecurityProfileAPIClient + params *ListTargetsForSecurityProfileInput + nextToken *string + firstPage bool + done bool +} + +// NewListTargetsForSecurityProfilePaginator returns a new +// ListTargetsForSecurityProfilePaginator +func NewListTargetsForSecurityProfilePaginator(client ListTargetsForSecurityProfileAPIClient, params *ListTargetsForSecurityProfileInput, optFns ...func(*ListTargetsForSecurityProfilePaginatorOptions)) *ListTargetsForSecurityProfilePaginator { + options := ListTargetsForSecurityProfilePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTargetsForSecurityProfilePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTargetsForSecurityProfilePaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTargetsForSecurityProfile page. +func (p *ListTargetsForSecurityProfilePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTargetsForSecurityProfileOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListTargetsForSecurityProfile(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListAuditMitigationActionsTasksAPIClient is a client that implements the +// ListAuditMitigationActionsTasks operation. +type ListAuditMitigationActionsTasksAPIClient interface { + ListAuditMitigationActionsTasks(context.Context, *ListAuditMitigationActionsTasksInput, ...func(*Options)) (*ListAuditMitigationActionsTasksOutput, error) +} + +var _ ListAuditMitigationActionsTasksAPIClient = (*Client)(nil) + +// ListAuditMitigationActionsTasksPaginatorOptions is the paginator options for +// ListAuditMitigationActionsTasks +type ListAuditMitigationActionsTasksPaginatorOptions struct { + // The maximum number of results to return at one time. The default is 25. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAuditMitigationActionsTasksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListAuditMitigationActionsTasks +type ListAuditMitigationActionsTasksPaginator struct { + options ListAuditMitigationActionsTasksPaginatorOptions + client ListAuditMitigationActionsTasksAPIClient + params *ListAuditMitigationActionsTasksInput + nextToken *string + firstPage bool + done bool +} + +// NewListAuditMitigationActionsTasksPaginator returns a new +// ListAuditMitigationActionsTasksPaginator +func NewListAuditMitigationActionsTasksPaginator(client ListAuditMitigationActionsTasksAPIClient, params *ListAuditMitigationActionsTasksInput, optFns ...func(*ListAuditMitigationActionsTasksPaginatorOptions)) *ListAuditMitigationActionsTasksPaginator { + options := ListAuditMitigationActionsTasksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAuditMitigationActionsTasksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAuditMitigationActionsTasksPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAuditMitigationActionsTasks page. +func (p *ListAuditMitigationActionsTasksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAuditMitigationActionsTasksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListAuditMitigationActionsTasks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDomainConfigurationsAPIClient is a client that implements the +// ListDomainConfigurations operation. +type ListDomainConfigurationsAPIClient interface { + ListDomainConfigurations(context.Context, *ListDomainConfigurationsInput, ...func(*Options)) (*ListDomainConfigurationsOutput, error) +} + +var _ ListDomainConfigurationsAPIClient = (*Client)(nil) + +// ListDomainConfigurationsPaginatorOptions is the paginator options for +// ListDomainConfigurations +type ListDomainConfigurationsPaginatorOptions struct { + // The result page size. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDomainConfigurationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListDomainConfigurations +type ListDomainConfigurationsPaginator struct { + options ListDomainConfigurationsPaginatorOptions + client ListDomainConfigurationsAPIClient + params *ListDomainConfigurationsInput + nextToken *string + firstPage bool + done bool +} + +// NewListDomainConfigurationsPaginator returns a new +// ListDomainConfigurationsPaginator +func NewListDomainConfigurationsPaginator(client ListDomainConfigurationsAPIClient, params *ListDomainConfigurationsInput, optFns ...func(*ListDomainConfigurationsPaginatorOptions)) *ListDomainConfigurationsPaginator { + options := ListDomainConfigurationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDomainConfigurationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDomainConfigurationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDomainConfigurations page. +func (p *ListDomainConfigurationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDomainConfigurationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.PageSize = p.options.Limit + result, err := p.client.ListDomainConfigurations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListAuditFindingsAPIClient is a client that implements the ListAuditFindings +// operation. +type ListAuditFindingsAPIClient interface { + ListAuditFindings(context.Context, *ListAuditFindingsInput, ...func(*Options)) (*ListAuditFindingsOutput, error) +} + +var _ ListAuditFindingsAPIClient = (*Client)(nil) + +// ListAuditFindingsPaginatorOptions is the paginator options for ListAuditFindings +type ListAuditFindingsPaginatorOptions struct { + // The maximum number of results to return at one time. The default is 25. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAuditFindingsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListAuditFindings +type ListAuditFindingsPaginator struct { + options ListAuditFindingsPaginatorOptions + client ListAuditFindingsAPIClient + params *ListAuditFindingsInput + nextToken *string + firstPage bool + done bool +} + +// NewListAuditFindingsPaginator returns a new ListAuditFindingsPaginator +func NewListAuditFindingsPaginator(client ListAuditFindingsAPIClient, params *ListAuditFindingsInput, optFns ...func(*ListAuditFindingsPaginatorOptions)) *ListAuditFindingsPaginator { + options := ListAuditFindingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAuditFindingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAuditFindingsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAuditFindings page. +func (p *ListAuditFindingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAuditFindingsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListAuditFindings(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListThingRegistrationTasksAPIClient is a client that implements the +// ListThingRegistrationTasks operation. +type ListThingRegistrationTasksAPIClient interface { + ListThingRegistrationTasks(context.Context, *ListThingRegistrationTasksInput, ...func(*Options)) (*ListThingRegistrationTasksOutput, error) +} + +var _ ListThingRegistrationTasksAPIClient = (*Client)(nil) + +// ListThingRegistrationTasksPaginatorOptions is the paginator options for +// ListThingRegistrationTasks +type ListThingRegistrationTasksPaginatorOptions struct { + // The maximum number of results to return at one time. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListThingRegistrationTasksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListThingRegistrationTasks +type ListThingRegistrationTasksPaginator struct { + options ListThingRegistrationTasksPaginatorOptions + client ListThingRegistrationTasksAPIClient + params *ListThingRegistrationTasksInput + nextToken *string + firstPage bool + done bool +} + +// NewListThingRegistrationTasksPaginator returns a new +// ListThingRegistrationTasksPaginator +func NewListThingRegistrationTasksPaginator(client ListThingRegistrationTasksAPIClient, params *ListThingRegistrationTasksInput, optFns ...func(*ListThingRegistrationTasksPaginatorOptions)) *ListThingRegistrationTasksPaginator { + options := ListThingRegistrationTasksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListThingRegistrationTasksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListThingRegistrationTasksPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListThingRegistrationTasks page. +func (p *ListThingRegistrationTasksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListThingRegistrationTasksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListThingRegistrationTasks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTopicRulesAPIClient is a client that implements the ListTopicRules +// operation. +type ListTopicRulesAPIClient interface { + ListTopicRules(context.Context, *ListTopicRulesInput, ...func(*Options)) (*ListTopicRulesOutput, error) +} + +var _ ListTopicRulesAPIClient = (*Client)(nil) + +// ListTopicRulesPaginatorOptions is the paginator options for ListTopicRules +type ListTopicRulesPaginatorOptions struct { + // The maximum number of results to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTopicRulesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListTopicRules +type ListTopicRulesPaginator struct { + options ListTopicRulesPaginatorOptions + client ListTopicRulesAPIClient + params *ListTopicRulesInput + nextToken *string + firstPage bool + done bool +} + +// NewListTopicRulesPaginator returns a new ListTopicRulesPaginator +func NewListTopicRulesPaginator(client ListTopicRulesAPIClient, params *ListTopicRulesInput, optFns ...func(*ListTopicRulesPaginatorOptions)) *ListTopicRulesPaginator { + options := ListTopicRulesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTopicRulesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTopicRulesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTopicRules page. +func (p *ListTopicRulesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTopicRulesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListTopicRules(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListPolicyPrincipalsAPIClient is a client that implements the +// ListPolicyPrincipals operation. +type ListPolicyPrincipalsAPIClient interface { + ListPolicyPrincipals(context.Context, *ListPolicyPrincipalsInput, ...func(*Options)) (*ListPolicyPrincipalsOutput, error) +} + +var _ ListPolicyPrincipalsAPIClient = (*Client)(nil) + +// ListPolicyPrincipalsPaginatorOptions is the paginator options for +// ListPolicyPrincipals +type ListPolicyPrincipalsPaginatorOptions struct { + // The result page size. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListPolicyPrincipalsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListPolicyPrincipals +type ListPolicyPrincipalsPaginator struct { + options ListPolicyPrincipalsPaginatorOptions + client ListPolicyPrincipalsAPIClient + params *ListPolicyPrincipalsInput + nextToken *string + firstPage bool + done bool +} + +// NewListPolicyPrincipalsPaginator returns a new ListPolicyPrincipalsPaginator +func NewListPolicyPrincipalsPaginator(client ListPolicyPrincipalsAPIClient, params *ListPolicyPrincipalsInput, optFns ...func(*ListPolicyPrincipalsPaginatorOptions)) *ListPolicyPrincipalsPaginator { + options := ListPolicyPrincipalsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListPolicyPrincipalsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPolicyPrincipalsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListPolicyPrincipals page. +func (p *ListPolicyPrincipalsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPolicyPrincipalsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.PageSize = p.options.Limit + result, err := p.client.ListPolicyPrincipals(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListViolationEventsAPIClient is a client that implements the ListViolationEvents +// operation. +type ListViolationEventsAPIClient interface { + ListViolationEvents(context.Context, *ListViolationEventsInput, ...func(*Options)) (*ListViolationEventsOutput, error) +} + +var _ ListViolationEventsAPIClient = (*Client)(nil) + +// ListViolationEventsPaginatorOptions is the paginator options for +// ListViolationEvents +type ListViolationEventsPaginatorOptions struct { + // The maximum number of results to return at one time. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListViolationEventsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListViolationEvents +type ListViolationEventsPaginator struct { + options ListViolationEventsPaginatorOptions + client ListViolationEventsAPIClient + params *ListViolationEventsInput + nextToken *string + firstPage bool + done bool +} + +// NewListViolationEventsPaginator returns a new ListViolationEventsPaginator +func NewListViolationEventsPaginator(client ListViolationEventsAPIClient, params *ListViolationEventsInput, optFns ...func(*ListViolationEventsPaginatorOptions)) *ListViolationEventsPaginator { + options := ListViolationEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListViolationEventsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListViolationEventsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListViolationEvents page. +func (p *ListViolationEventsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListViolationEventsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListViolationEvents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDimensionsAPIClient is a client that implements the ListDimensions +// operation. +type ListDimensionsAPIClient interface { + ListDimensions(context.Context, *ListDimensionsInput, ...func(*Options)) (*ListDimensionsOutput, error) +} + +var _ ListDimensionsAPIClient = (*Client)(nil) + +// ListDimensionsPaginatorOptions is the paginator options for ListDimensions +type ListDimensionsPaginatorOptions struct { + // The maximum number of results to retrieve at one time. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDimensionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListDimensions +type ListDimensionsPaginator struct { + options ListDimensionsPaginatorOptions + client ListDimensionsAPIClient + params *ListDimensionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListDimensionsPaginator returns a new ListDimensionsPaginator +func NewListDimensionsPaginator(client ListDimensionsAPIClient, params *ListDimensionsInput, optFns ...func(*ListDimensionsPaginatorOptions)) *ListDimensionsPaginator { + options := ListDimensionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDimensionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDimensionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDimensions page. +func (p *ListDimensionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDimensionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListDimensions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListAuditMitigationActionsExecutionsAPIClient is a client that implements the +// ListAuditMitigationActionsExecutions operation. +type ListAuditMitigationActionsExecutionsAPIClient interface { + ListAuditMitigationActionsExecutions(context.Context, *ListAuditMitigationActionsExecutionsInput, ...func(*Options)) (*ListAuditMitigationActionsExecutionsOutput, error) +} + +var _ ListAuditMitigationActionsExecutionsAPIClient = (*Client)(nil) + +// ListAuditMitigationActionsExecutionsPaginatorOptions is the paginator options +// for ListAuditMitigationActionsExecutions +type ListAuditMitigationActionsExecutionsPaginatorOptions struct { + // The maximum number of results to return at one time. The default is 25. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAuditMitigationActionsExecutionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListAuditMitigationActionsExecutions +type ListAuditMitigationActionsExecutionsPaginator struct { + options ListAuditMitigationActionsExecutionsPaginatorOptions + client ListAuditMitigationActionsExecutionsAPIClient + params *ListAuditMitigationActionsExecutionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListAuditMitigationActionsExecutionsPaginator returns a new +// ListAuditMitigationActionsExecutionsPaginator +func NewListAuditMitigationActionsExecutionsPaginator(client ListAuditMitigationActionsExecutionsAPIClient, params *ListAuditMitigationActionsExecutionsInput, optFns ...func(*ListAuditMitigationActionsExecutionsPaginatorOptions)) *ListAuditMitigationActionsExecutionsPaginator { + options := ListAuditMitigationActionsExecutionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAuditMitigationActionsExecutionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAuditMitigationActionsExecutionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAuditMitigationActionsExecutions page. +func (p *ListAuditMitigationActionsExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAuditMitigationActionsExecutionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListAuditMitigationActionsExecutions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListThingTypesAPIClient is a client that implements the ListThingTypes +// operation. +type ListThingTypesAPIClient interface { + ListThingTypes(context.Context, *ListThingTypesInput, ...func(*Options)) (*ListThingTypesOutput, error) +} + +var _ ListThingTypesAPIClient = (*Client)(nil) + +// ListThingTypesPaginatorOptions is the paginator options for ListThingTypes +type ListThingTypesPaginatorOptions struct { + // The maximum number of results to return in this operation. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListThingTypesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListThingTypes +type ListThingTypesPaginator struct { + options ListThingTypesPaginatorOptions + client ListThingTypesAPIClient + params *ListThingTypesInput + nextToken *string + firstPage bool + done bool +} + +// NewListThingTypesPaginator returns a new ListThingTypesPaginator +func NewListThingTypesPaginator(client ListThingTypesAPIClient, params *ListThingTypesInput, optFns ...func(*ListThingTypesPaginatorOptions)) *ListThingTypesPaginator { + options := ListThingTypesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListThingTypesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListThingTypesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListThingTypes page. +func (p *ListThingTypesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListThingTypesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListThingTypes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListPoliciesAPIClient is a client that implements the ListPolicies operation. +type ListPoliciesAPIClient interface { + ListPolicies(context.Context, *ListPoliciesInput, ...func(*Options)) (*ListPoliciesOutput, error) +} + +var _ ListPoliciesAPIClient = (*Client)(nil) + +// ListPoliciesPaginatorOptions is the paginator options for ListPolicies +type ListPoliciesPaginatorOptions struct { + // The result page size. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListPoliciesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListPolicies +type ListPoliciesPaginator struct { + options ListPoliciesPaginatorOptions + client ListPoliciesAPIClient + params *ListPoliciesInput + nextToken *string + firstPage bool + done bool +} + +// NewListPoliciesPaginator returns a new ListPoliciesPaginator +func NewListPoliciesPaginator(client ListPoliciesAPIClient, params *ListPoliciesInput, optFns ...func(*ListPoliciesPaginatorOptions)) *ListPoliciesPaginator { + options := ListPoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListPoliciesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPoliciesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListPolicies page. +func (p *ListPoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPoliciesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.PageSize = p.options.Limit + result, err := p.client.ListPolicies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/iot1clickdevicesservice/go.sum b/service/iot1clickdevicesservice/go.sum index c669e324b14..32595049f96 100644 --- a/service/iot1clickdevicesservice/go.sum +++ b/service/iot1clickdevicesservice/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/iot1clickprojects/go.sum b/service/iot1clickprojects/go.sum index c669e324b14..32595049f96 100644 --- a/service/iot1clickprojects/go.sum +++ b/service/iot1clickprojects/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/iot1clickprojects/paginators.go b/service/iot1clickprojects/paginators.go new file mode 100644 index 00000000000..47bd5d34500 --- /dev/null +++ b/service/iot1clickprojects/paginators.go @@ -0,0 +1,159 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iot1clickprojects + +import ( + "context" + "fmt" +) + +// ListProjectsAPIClient is a client that implements the ListProjects operation. +type ListProjectsAPIClient interface { + ListProjects(context.Context, *ListProjectsInput, ...func(*Options)) (*ListProjectsOutput, error) +} + +var _ ListProjectsAPIClient = (*Client)(nil) + +// ListProjectsPaginatorOptions is the paginator options for ListProjects +type ListProjectsPaginatorOptions struct { + // The maximum number of results to return per request. If not set, a default value + // of 100 is used. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListProjectsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot1clickprojects.ListProjects +type ListProjectsPaginator struct { + options ListProjectsPaginatorOptions + client ListProjectsAPIClient + params *ListProjectsInput + nextToken *string + firstPage bool + done bool +} + +// NewListProjectsPaginator returns a new ListProjectsPaginator +func NewListProjectsPaginator(client ListProjectsAPIClient, params *ListProjectsInput, optFns ...func(*ListProjectsPaginatorOptions)) *ListProjectsPaginator { + options := ListProjectsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListProjectsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListProjectsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListProjects page. +func (p *ListProjectsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProjectsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListProjects(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListPlacementsAPIClient is a client that implements the ListPlacements +// operation. +type ListPlacementsAPIClient interface { + ListPlacements(context.Context, *ListPlacementsInput, ...func(*Options)) (*ListPlacementsOutput, error) +} + +var _ ListPlacementsAPIClient = (*Client)(nil) + +// ListPlacementsPaginatorOptions is the paginator options for ListPlacements +type ListPlacementsPaginatorOptions struct { + // The maximum number of results to return per request. If not set, a default value + // of 100 is used. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListPlacementsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot1clickprojects.ListPlacements +type ListPlacementsPaginator struct { + options ListPlacementsPaginatorOptions + client ListPlacementsAPIClient + params *ListPlacementsInput + nextToken *string + firstPage bool + done bool +} + +// NewListPlacementsPaginator returns a new ListPlacementsPaginator +func NewListPlacementsPaginator(client ListPlacementsAPIClient, params *ListPlacementsInput, optFns ...func(*ListPlacementsPaginatorOptions)) *ListPlacementsPaginator { + options := ListPlacementsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListPlacementsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPlacementsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListPlacements page. +func (p *ListPlacementsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPlacementsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListPlacements(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/iotanalytics/go.sum b/service/iotanalytics/go.sum index c669e324b14..32595049f96 100644 --- a/service/iotanalytics/go.sum +++ b/service/iotanalytics/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/iotanalytics/paginators.go b/service/iotanalytics/paginators.go new file mode 100644 index 00000000000..a7137ce830f --- /dev/null +++ b/service/iotanalytics/paginators.go @@ -0,0 +1,385 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotanalytics + +import ( + "context" + "fmt" +) + +// ListDatastoresAPIClient is a client that implements the ListDatastores +// operation. +type ListDatastoresAPIClient interface { + ListDatastores(context.Context, *ListDatastoresInput, ...func(*Options)) (*ListDatastoresOutput, error) +} + +var _ ListDatastoresAPIClient = (*Client)(nil) + +// ListDatastoresPaginatorOptions is the paginator options for ListDatastores +type ListDatastoresPaginatorOptions struct { + // The maximum number of results to return in this request. The default value is + // 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDatastoresPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotanalytics.ListDatastores +type ListDatastoresPaginator struct { + options ListDatastoresPaginatorOptions + client ListDatastoresAPIClient + params *ListDatastoresInput + nextToken *string + firstPage bool + done bool +} + +// NewListDatastoresPaginator returns a new ListDatastoresPaginator +func NewListDatastoresPaginator(client ListDatastoresAPIClient, params *ListDatastoresInput, optFns ...func(*ListDatastoresPaginatorOptions)) *ListDatastoresPaginator { + options := ListDatastoresPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDatastoresPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDatastoresPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDatastores page. +func (p *ListDatastoresPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDatastoresOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListDatastores(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListChannelsAPIClient is a client that implements the ListChannels operation. +type ListChannelsAPIClient interface { + ListChannels(context.Context, *ListChannelsInput, ...func(*Options)) (*ListChannelsOutput, error) +} + +var _ ListChannelsAPIClient = (*Client)(nil) + +// ListChannelsPaginatorOptions is the paginator options for ListChannels +type ListChannelsPaginatorOptions struct { + // The maximum number of results to return in this request. The default value is + // 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListChannelsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotanalytics.ListChannels +type ListChannelsPaginator struct { + options ListChannelsPaginatorOptions + client ListChannelsAPIClient + params *ListChannelsInput + nextToken *string + firstPage bool + done bool +} + +// NewListChannelsPaginator returns a new ListChannelsPaginator +func NewListChannelsPaginator(client ListChannelsAPIClient, params *ListChannelsInput, optFns ...func(*ListChannelsPaginatorOptions)) *ListChannelsPaginator { + options := ListChannelsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListChannelsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListChannelsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListChannels page. +func (p *ListChannelsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListChannelsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListChannels(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDatasetsAPIClient is a client that implements the ListDatasets operation. +type ListDatasetsAPIClient interface { + ListDatasets(context.Context, *ListDatasetsInput, ...func(*Options)) (*ListDatasetsOutput, error) +} + +var _ ListDatasetsAPIClient = (*Client)(nil) + +// ListDatasetsPaginatorOptions is the paginator options for ListDatasets +type ListDatasetsPaginatorOptions struct { + // The maximum number of results to return in this request. The default value is + // 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDatasetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotanalytics.ListDatasets +type ListDatasetsPaginator struct { + options ListDatasetsPaginatorOptions + client ListDatasetsAPIClient + params *ListDatasetsInput + nextToken *string + firstPage bool + done bool +} + +// NewListDatasetsPaginator returns a new ListDatasetsPaginator +func NewListDatasetsPaginator(client ListDatasetsAPIClient, params *ListDatasetsInput, optFns ...func(*ListDatasetsPaginatorOptions)) *ListDatasetsPaginator { + options := ListDatasetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDatasetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDatasetsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDatasets page. +func (p *ListDatasetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDatasetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListDatasets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListPipelinesAPIClient is a client that implements the ListPipelines operation. +type ListPipelinesAPIClient interface { + ListPipelines(context.Context, *ListPipelinesInput, ...func(*Options)) (*ListPipelinesOutput, error) +} + +var _ ListPipelinesAPIClient = (*Client)(nil) + +// ListPipelinesPaginatorOptions is the paginator options for ListPipelines +type ListPipelinesPaginatorOptions struct { + // The maximum number of results to return in this request. The default value is + // 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListPipelinesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotanalytics.ListPipelines +type ListPipelinesPaginator struct { + options ListPipelinesPaginatorOptions + client ListPipelinesAPIClient + params *ListPipelinesInput + nextToken *string + firstPage bool + done bool +} + +// NewListPipelinesPaginator returns a new ListPipelinesPaginator +func NewListPipelinesPaginator(client ListPipelinesAPIClient, params *ListPipelinesInput, optFns ...func(*ListPipelinesPaginatorOptions)) *ListPipelinesPaginator { + options := ListPipelinesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListPipelinesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPipelinesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListPipelines page. +func (p *ListPipelinesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPipelinesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListPipelines(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDatasetContentsAPIClient is a client that implements the ListDatasetContents +// operation. +type ListDatasetContentsAPIClient interface { + ListDatasetContents(context.Context, *ListDatasetContentsInput, ...func(*Options)) (*ListDatasetContentsOutput, error) +} + +var _ ListDatasetContentsAPIClient = (*Client)(nil) + +// ListDatasetContentsPaginatorOptions is the paginator options for +// ListDatasetContents +type ListDatasetContentsPaginatorOptions struct { + // The maximum number of results to return in this request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDatasetContentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotanalytics.ListDatasetContents +type ListDatasetContentsPaginator struct { + options ListDatasetContentsPaginatorOptions + client ListDatasetContentsAPIClient + params *ListDatasetContentsInput + nextToken *string + firstPage bool + done bool +} + +// NewListDatasetContentsPaginator returns a new ListDatasetContentsPaginator +func NewListDatasetContentsPaginator(client ListDatasetContentsAPIClient, params *ListDatasetContentsInput, optFns ...func(*ListDatasetContentsPaginatorOptions)) *ListDatasetContentsPaginator { + options := ListDatasetContentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDatasetContentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDatasetContentsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDatasetContents page. +func (p *ListDatasetContentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDatasetContentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListDatasetContents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/iotdataplane/go.sum b/service/iotdataplane/go.sum index c669e324b14..32595049f96 100644 --- a/service/iotdataplane/go.sum +++ b/service/iotdataplane/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/iotevents/go.sum b/service/iotevents/go.sum index c669e324b14..32595049f96 100644 --- a/service/iotevents/go.sum +++ b/service/iotevents/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/ioteventsdata/go.sum b/service/ioteventsdata/go.sum index c669e324b14..32595049f96 100644 --- a/service/ioteventsdata/go.sum +++ b/service/ioteventsdata/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/iotjobsdataplane/go.sum b/service/iotjobsdataplane/go.sum index c669e324b14..32595049f96 100644 --- a/service/iotjobsdataplane/go.sum +++ b/service/iotjobsdataplane/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/iotsecuretunneling/go.sum b/service/iotsecuretunneling/go.sum index c669e324b14..32595049f96 100644 --- a/service/iotsecuretunneling/go.sum +++ b/service/iotsecuretunneling/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/iotsecuretunneling/paginators.go b/service/iotsecuretunneling/paginators.go new file mode 100644 index 00000000000..12293e88b10 --- /dev/null +++ b/service/iotsecuretunneling/paginators.go @@ -0,0 +1,82 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotsecuretunneling + +import ( + "context" + "fmt" +) + +// ListTunnelsAPIClient is a client that implements the ListTunnels operation. +type ListTunnelsAPIClient interface { + ListTunnels(context.Context, *ListTunnelsInput, ...func(*Options)) (*ListTunnelsOutput, error) +} + +var _ ListTunnelsAPIClient = (*Client)(nil) + +// ListTunnelsPaginatorOptions is the paginator options for ListTunnels +type ListTunnelsPaginatorOptions struct { + // The maximum number of results to return at once. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTunnelsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotsecuretunneling.ListTunnels +type ListTunnelsPaginator struct { + options ListTunnelsPaginatorOptions + client ListTunnelsAPIClient + params *ListTunnelsInput + nextToken *string + firstPage bool + done bool +} + +// NewListTunnelsPaginator returns a new ListTunnelsPaginator +func NewListTunnelsPaginator(client ListTunnelsAPIClient, params *ListTunnelsInput, optFns ...func(*ListTunnelsPaginatorOptions)) *ListTunnelsPaginator { + options := ListTunnelsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTunnelsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTunnelsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTunnels page. +func (p *ListTunnelsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTunnelsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListTunnels(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/iotsitewise/go.sum b/service/iotsitewise/go.sum index c669e324b14..32595049f96 100644 --- a/service/iotsitewise/go.sum +++ b/service/iotsitewise/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/iotsitewise/paginators.go b/service/iotsitewise/paginators.go new file mode 100644 index 00000000000..e0e9281350e --- /dev/null +++ b/service/iotsitewise/paginators.go @@ -0,0 +1,835 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotsitewise + +import ( + "context" + "fmt" +) + +// ListAccessPoliciesAPIClient is a client that implements the ListAccessPolicies +// operation. +type ListAccessPoliciesAPIClient interface { + ListAccessPolicies(context.Context, *ListAccessPoliciesInput, ...func(*Options)) (*ListAccessPoliciesOutput, error) +} + +var _ ListAccessPoliciesAPIClient = (*Client)(nil) + +// ListAccessPoliciesPaginatorOptions is the paginator options for +// ListAccessPolicies +type ListAccessPoliciesPaginatorOptions struct { + // The maximum number of results to be returned per paginated request. Default: 50 + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAccessPoliciesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotsitewise.ListAccessPolicies +type ListAccessPoliciesPaginator struct { + options ListAccessPoliciesPaginatorOptions + client ListAccessPoliciesAPIClient + params *ListAccessPoliciesInput + nextToken *string + firstPage bool + done bool +} + +// NewListAccessPoliciesPaginator returns a new ListAccessPoliciesPaginator +func NewListAccessPoliciesPaginator(client ListAccessPoliciesAPIClient, params *ListAccessPoliciesInput, optFns ...func(*ListAccessPoliciesPaginatorOptions)) *ListAccessPoliciesPaginator { + options := ListAccessPoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAccessPoliciesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAccessPoliciesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAccessPolicies page. +func (p *ListAccessPoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccessPoliciesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListAccessPolicies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDashboardsAPIClient is a client that implements the ListDashboards +// operation. +type ListDashboardsAPIClient interface { + ListDashboards(context.Context, *ListDashboardsInput, ...func(*Options)) (*ListDashboardsOutput, error) +} + +var _ ListDashboardsAPIClient = (*Client)(nil) + +// ListDashboardsPaginatorOptions is the paginator options for ListDashboards +type ListDashboardsPaginatorOptions struct { + // The maximum number of results to be returned per paginated request. Default: 50 + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDashboardsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotsitewise.ListDashboards +type ListDashboardsPaginator struct { + options ListDashboardsPaginatorOptions + client ListDashboardsAPIClient + params *ListDashboardsInput + nextToken *string + firstPage bool + done bool +} + +// NewListDashboardsPaginator returns a new ListDashboardsPaginator +func NewListDashboardsPaginator(client ListDashboardsAPIClient, params *ListDashboardsInput, optFns ...func(*ListDashboardsPaginatorOptions)) *ListDashboardsPaginator { + options := ListDashboardsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDashboardsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDashboardsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDashboards page. +func (p *ListDashboardsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDashboardsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListDashboards(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetAssetPropertyValueHistoryAPIClient is a client that implements the +// GetAssetPropertyValueHistory operation. +type GetAssetPropertyValueHistoryAPIClient interface { + GetAssetPropertyValueHistory(context.Context, *GetAssetPropertyValueHistoryInput, ...func(*Options)) (*GetAssetPropertyValueHistoryOutput, error) +} + +var _ GetAssetPropertyValueHistoryAPIClient = (*Client)(nil) + +// GetAssetPropertyValueHistoryPaginatorOptions is the paginator options for +// GetAssetPropertyValueHistory +type GetAssetPropertyValueHistoryPaginatorOptions struct { + // The maximum number of results to be returned per paginated request. Default: 100 + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetAssetPropertyValueHistoryPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotsitewise.GetAssetPropertyValueHistory +type GetAssetPropertyValueHistoryPaginator struct { + options GetAssetPropertyValueHistoryPaginatorOptions + client GetAssetPropertyValueHistoryAPIClient + params *GetAssetPropertyValueHistoryInput + nextToken *string + firstPage bool + done bool +} + +// NewGetAssetPropertyValueHistoryPaginator returns a new +// GetAssetPropertyValueHistoryPaginator +func NewGetAssetPropertyValueHistoryPaginator(client GetAssetPropertyValueHistoryAPIClient, params *GetAssetPropertyValueHistoryInput, optFns ...func(*GetAssetPropertyValueHistoryPaginatorOptions)) *GetAssetPropertyValueHistoryPaginator { + options := GetAssetPropertyValueHistoryPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetAssetPropertyValueHistoryPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetAssetPropertyValueHistoryPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetAssetPropertyValueHistory page. +func (p *GetAssetPropertyValueHistoryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetAssetPropertyValueHistoryOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetAssetPropertyValueHistory(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListProjectsAPIClient is a client that implements the ListProjects operation. +type ListProjectsAPIClient interface { + ListProjects(context.Context, *ListProjectsInput, ...func(*Options)) (*ListProjectsOutput, error) +} + +var _ ListProjectsAPIClient = (*Client)(nil) + +// ListProjectsPaginatorOptions is the paginator options for ListProjects +type ListProjectsPaginatorOptions struct { + // The maximum number of results to be returned per paginated request. Default: 50 + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListProjectsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotsitewise.ListProjects +type ListProjectsPaginator struct { + options ListProjectsPaginatorOptions + client ListProjectsAPIClient + params *ListProjectsInput + nextToken *string + firstPage bool + done bool +} + +// NewListProjectsPaginator returns a new ListProjectsPaginator +func NewListProjectsPaginator(client ListProjectsAPIClient, params *ListProjectsInput, optFns ...func(*ListProjectsPaginatorOptions)) *ListProjectsPaginator { + options := ListProjectsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListProjectsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListProjectsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListProjects page. +func (p *ListProjectsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProjectsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListProjects(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListProjectAssetsAPIClient is a client that implements the ListProjectAssets +// operation. +type ListProjectAssetsAPIClient interface { + ListProjectAssets(context.Context, *ListProjectAssetsInput, ...func(*Options)) (*ListProjectAssetsOutput, error) +} + +var _ ListProjectAssetsAPIClient = (*Client)(nil) + +// ListProjectAssetsPaginatorOptions is the paginator options for ListProjectAssets +type ListProjectAssetsPaginatorOptions struct { + // The maximum number of results to be returned per paginated request. Default: 50 + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListProjectAssetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotsitewise.ListProjectAssets +type ListProjectAssetsPaginator struct { + options ListProjectAssetsPaginatorOptions + client ListProjectAssetsAPIClient + params *ListProjectAssetsInput + nextToken *string + firstPage bool + done bool +} + +// NewListProjectAssetsPaginator returns a new ListProjectAssetsPaginator +func NewListProjectAssetsPaginator(client ListProjectAssetsAPIClient, params *ListProjectAssetsInput, optFns ...func(*ListProjectAssetsPaginatorOptions)) *ListProjectAssetsPaginator { + options := ListProjectAssetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListProjectAssetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListProjectAssetsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListProjectAssets page. +func (p *ListProjectAssetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProjectAssetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListProjectAssets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetAssetPropertyAggregatesAPIClient is a client that implements the +// GetAssetPropertyAggregates operation. +type GetAssetPropertyAggregatesAPIClient interface { + GetAssetPropertyAggregates(context.Context, *GetAssetPropertyAggregatesInput, ...func(*Options)) (*GetAssetPropertyAggregatesOutput, error) +} + +var _ GetAssetPropertyAggregatesAPIClient = (*Client)(nil) + +// GetAssetPropertyAggregatesPaginatorOptions is the paginator options for +// GetAssetPropertyAggregates +type GetAssetPropertyAggregatesPaginatorOptions struct { + // The maximum number of results to be returned per paginated request. Default: 100 + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetAssetPropertyAggregatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotsitewise.GetAssetPropertyAggregates +type GetAssetPropertyAggregatesPaginator struct { + options GetAssetPropertyAggregatesPaginatorOptions + client GetAssetPropertyAggregatesAPIClient + params *GetAssetPropertyAggregatesInput + nextToken *string + firstPage bool + done bool +} + +// NewGetAssetPropertyAggregatesPaginator returns a new +// GetAssetPropertyAggregatesPaginator +func NewGetAssetPropertyAggregatesPaginator(client GetAssetPropertyAggregatesAPIClient, params *GetAssetPropertyAggregatesInput, optFns ...func(*GetAssetPropertyAggregatesPaginatorOptions)) *GetAssetPropertyAggregatesPaginator { + options := GetAssetPropertyAggregatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetAssetPropertyAggregatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetAssetPropertyAggregatesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetAssetPropertyAggregates page. +func (p *GetAssetPropertyAggregatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetAssetPropertyAggregatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetAssetPropertyAggregates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListGatewaysAPIClient is a client that implements the ListGateways operation. +type ListGatewaysAPIClient interface { + ListGateways(context.Context, *ListGatewaysInput, ...func(*Options)) (*ListGatewaysOutput, error) +} + +var _ ListGatewaysAPIClient = (*Client)(nil) + +// ListGatewaysPaginatorOptions is the paginator options for ListGateways +type ListGatewaysPaginatorOptions struct { + // The maximum number of results to be returned per paginated request. Default: 50 + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListGatewaysPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotsitewise.ListGateways +type ListGatewaysPaginator struct { + options ListGatewaysPaginatorOptions + client ListGatewaysAPIClient + params *ListGatewaysInput + nextToken *string + firstPage bool + done bool +} + +// NewListGatewaysPaginator returns a new ListGatewaysPaginator +func NewListGatewaysPaginator(client ListGatewaysAPIClient, params *ListGatewaysInput, optFns ...func(*ListGatewaysPaginatorOptions)) *ListGatewaysPaginator { + options := ListGatewaysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListGatewaysPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListGatewaysPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListGateways page. +func (p *ListGatewaysPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListGatewaysOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListGateways(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListAssetModelsAPIClient is a client that implements the ListAssetModels +// operation. +type ListAssetModelsAPIClient interface { + ListAssetModels(context.Context, *ListAssetModelsInput, ...func(*Options)) (*ListAssetModelsOutput, error) +} + +var _ ListAssetModelsAPIClient = (*Client)(nil) + +// ListAssetModelsPaginatorOptions is the paginator options for ListAssetModels +type ListAssetModelsPaginatorOptions struct { + // The maximum number of results to be returned per paginated request. Default: 50 + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAssetModelsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotsitewise.ListAssetModels +type ListAssetModelsPaginator struct { + options ListAssetModelsPaginatorOptions + client ListAssetModelsAPIClient + params *ListAssetModelsInput + nextToken *string + firstPage bool + done bool +} + +// NewListAssetModelsPaginator returns a new ListAssetModelsPaginator +func NewListAssetModelsPaginator(client ListAssetModelsAPIClient, params *ListAssetModelsInput, optFns ...func(*ListAssetModelsPaginatorOptions)) *ListAssetModelsPaginator { + options := ListAssetModelsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAssetModelsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAssetModelsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAssetModels page. +func (p *ListAssetModelsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAssetModelsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListAssetModels(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListAssetsAPIClient is a client that implements the ListAssets operation. +type ListAssetsAPIClient interface { + ListAssets(context.Context, *ListAssetsInput, ...func(*Options)) (*ListAssetsOutput, error) +} + +var _ ListAssetsAPIClient = (*Client)(nil) + +// ListAssetsPaginatorOptions is the paginator options for ListAssets +type ListAssetsPaginatorOptions struct { + // The maximum number of results to be returned per paginated request. Default: 50 + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAssetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotsitewise.ListAssets +type ListAssetsPaginator struct { + options ListAssetsPaginatorOptions + client ListAssetsAPIClient + params *ListAssetsInput + nextToken *string + firstPage bool + done bool +} + +// NewListAssetsPaginator returns a new ListAssetsPaginator +func NewListAssetsPaginator(client ListAssetsAPIClient, params *ListAssetsInput, optFns ...func(*ListAssetsPaginatorOptions)) *ListAssetsPaginator { + options := ListAssetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAssetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAssetsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAssets page. +func (p *ListAssetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAssetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListAssets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListPortalsAPIClient is a client that implements the ListPortals operation. +type ListPortalsAPIClient interface { + ListPortals(context.Context, *ListPortalsInput, ...func(*Options)) (*ListPortalsOutput, error) +} + +var _ ListPortalsAPIClient = (*Client)(nil) + +// ListPortalsPaginatorOptions is the paginator options for ListPortals +type ListPortalsPaginatorOptions struct { + // The maximum number of results to be returned per paginated request. Default: 50 + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListPortalsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotsitewise.ListPortals +type ListPortalsPaginator struct { + options ListPortalsPaginatorOptions + client ListPortalsAPIClient + params *ListPortalsInput + nextToken *string + firstPage bool + done bool +} + +// NewListPortalsPaginator returns a new ListPortalsPaginator +func NewListPortalsPaginator(client ListPortalsAPIClient, params *ListPortalsInput, optFns ...func(*ListPortalsPaginatorOptions)) *ListPortalsPaginator { + options := ListPortalsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListPortalsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPortalsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListPortals page. +func (p *ListPortalsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPortalsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListPortals(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListAssociatedAssetsAPIClient is a client that implements the +// ListAssociatedAssets operation. +type ListAssociatedAssetsAPIClient interface { + ListAssociatedAssets(context.Context, *ListAssociatedAssetsInput, ...func(*Options)) (*ListAssociatedAssetsOutput, error) +} + +var _ ListAssociatedAssetsAPIClient = (*Client)(nil) + +// ListAssociatedAssetsPaginatorOptions is the paginator options for +// ListAssociatedAssets +type ListAssociatedAssetsPaginatorOptions struct { + // The maximum number of results to be returned per paginated request. Default: 50 + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAssociatedAssetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotsitewise.ListAssociatedAssets +type ListAssociatedAssetsPaginator struct { + options ListAssociatedAssetsPaginatorOptions + client ListAssociatedAssetsAPIClient + params *ListAssociatedAssetsInput + nextToken *string + firstPage bool + done bool +} + +// NewListAssociatedAssetsPaginator returns a new ListAssociatedAssetsPaginator +func NewListAssociatedAssetsPaginator(client ListAssociatedAssetsAPIClient, params *ListAssociatedAssetsInput, optFns ...func(*ListAssociatedAssetsPaginatorOptions)) *ListAssociatedAssetsPaginator { + options := ListAssociatedAssetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAssociatedAssetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAssociatedAssetsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAssociatedAssets page. +func (p *ListAssociatedAssetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAssociatedAssetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListAssociatedAssets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/iotthingsgraph/go.sum b/service/iotthingsgraph/go.sum index c669e324b14..32595049f96 100644 --- a/service/iotthingsgraph/go.sum +++ b/service/iotthingsgraph/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/iotthingsgraph/paginators.go b/service/iotthingsgraph/paginators.go new file mode 100644 index 00000000000..f92aff904e2 --- /dev/null +++ b/service/iotthingsgraph/paginators.go @@ -0,0 +1,768 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotthingsgraph + +import ( + "context" + "fmt" +) + +// SearchFlowTemplatesAPIClient is a client that implements the SearchFlowTemplates +// operation. +type SearchFlowTemplatesAPIClient interface { + SearchFlowTemplates(context.Context, *SearchFlowTemplatesInput, ...func(*Options)) (*SearchFlowTemplatesOutput, error) +} + +var _ SearchFlowTemplatesAPIClient = (*Client)(nil) + +// SearchFlowTemplatesPaginatorOptions is the paginator options for +// SearchFlowTemplates +type SearchFlowTemplatesPaginatorOptions struct { + // The maximum number of results to return in the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// SearchFlowTemplatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotthingsgraph.SearchFlowTemplates +type SearchFlowTemplatesPaginator struct { + options SearchFlowTemplatesPaginatorOptions + client SearchFlowTemplatesAPIClient + params *SearchFlowTemplatesInput + nextToken *string + firstPage bool + done bool +} + +// NewSearchFlowTemplatesPaginator returns a new SearchFlowTemplatesPaginator +func NewSearchFlowTemplatesPaginator(client SearchFlowTemplatesAPIClient, params *SearchFlowTemplatesInput, optFns ...func(*SearchFlowTemplatesPaginatorOptions)) *SearchFlowTemplatesPaginator { + options := SearchFlowTemplatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &SearchFlowTemplatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchFlowTemplatesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next SearchFlowTemplates page. +func (p *SearchFlowTemplatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchFlowTemplatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.SearchFlowTemplates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// SearchFlowExecutionsAPIClient is a client that implements the +// SearchFlowExecutions operation. +type SearchFlowExecutionsAPIClient interface { + SearchFlowExecutions(context.Context, *SearchFlowExecutionsInput, ...func(*Options)) (*SearchFlowExecutionsOutput, error) +} + +var _ SearchFlowExecutionsAPIClient = (*Client)(nil) + +// SearchFlowExecutionsPaginatorOptions is the paginator options for +// SearchFlowExecutions +type SearchFlowExecutionsPaginatorOptions struct { + // The maximum number of results to return in the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// SearchFlowExecutionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotthingsgraph.SearchFlowExecutions +type SearchFlowExecutionsPaginator struct { + options SearchFlowExecutionsPaginatorOptions + client SearchFlowExecutionsAPIClient + params *SearchFlowExecutionsInput + nextToken *string + firstPage bool + done bool +} + +// NewSearchFlowExecutionsPaginator returns a new SearchFlowExecutionsPaginator +func NewSearchFlowExecutionsPaginator(client SearchFlowExecutionsAPIClient, params *SearchFlowExecutionsInput, optFns ...func(*SearchFlowExecutionsPaginatorOptions)) *SearchFlowExecutionsPaginator { + options := SearchFlowExecutionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &SearchFlowExecutionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchFlowExecutionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next SearchFlowExecutions page. +func (p *SearchFlowExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchFlowExecutionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.SearchFlowExecutions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListFlowExecutionMessagesAPIClient is a client that implements the +// ListFlowExecutionMessages operation. +type ListFlowExecutionMessagesAPIClient interface { + ListFlowExecutionMessages(context.Context, *ListFlowExecutionMessagesInput, ...func(*Options)) (*ListFlowExecutionMessagesOutput, error) +} + +var _ ListFlowExecutionMessagesAPIClient = (*Client)(nil) + +// ListFlowExecutionMessagesPaginatorOptions is the paginator options for +// ListFlowExecutionMessages +type ListFlowExecutionMessagesPaginatorOptions struct { + // The maximum number of results to return in the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListFlowExecutionMessagesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotthingsgraph.ListFlowExecutionMessages +type ListFlowExecutionMessagesPaginator struct { + options ListFlowExecutionMessagesPaginatorOptions + client ListFlowExecutionMessagesAPIClient + params *ListFlowExecutionMessagesInput + nextToken *string + firstPage bool + done bool +} + +// NewListFlowExecutionMessagesPaginator returns a new +// ListFlowExecutionMessagesPaginator +func NewListFlowExecutionMessagesPaginator(client ListFlowExecutionMessagesAPIClient, params *ListFlowExecutionMessagesInput, optFns ...func(*ListFlowExecutionMessagesPaginatorOptions)) *ListFlowExecutionMessagesPaginator { + options := ListFlowExecutionMessagesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListFlowExecutionMessagesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListFlowExecutionMessagesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListFlowExecutionMessages page. +func (p *ListFlowExecutionMessagesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFlowExecutionMessagesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListFlowExecutionMessages(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// SearchSystemTemplatesAPIClient is a client that implements the +// SearchSystemTemplates operation. +type SearchSystemTemplatesAPIClient interface { + SearchSystemTemplates(context.Context, *SearchSystemTemplatesInput, ...func(*Options)) (*SearchSystemTemplatesOutput, error) +} + +var _ SearchSystemTemplatesAPIClient = (*Client)(nil) + +// SearchSystemTemplatesPaginatorOptions is the paginator options for +// SearchSystemTemplates +type SearchSystemTemplatesPaginatorOptions struct { + // The maximum number of results to return in the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// SearchSystemTemplatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotthingsgraph.SearchSystemTemplates +type SearchSystemTemplatesPaginator struct { + options SearchSystemTemplatesPaginatorOptions + client SearchSystemTemplatesAPIClient + params *SearchSystemTemplatesInput + nextToken *string + firstPage bool + done bool +} + +// NewSearchSystemTemplatesPaginator returns a new SearchSystemTemplatesPaginator +func NewSearchSystemTemplatesPaginator(client SearchSystemTemplatesAPIClient, params *SearchSystemTemplatesInput, optFns ...func(*SearchSystemTemplatesPaginatorOptions)) *SearchSystemTemplatesPaginator { + options := SearchSystemTemplatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &SearchSystemTemplatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchSystemTemplatesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next SearchSystemTemplates page. +func (p *SearchSystemTemplatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchSystemTemplatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.SearchSystemTemplates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetFlowTemplateRevisionsAPIClient is a client that implements the +// GetFlowTemplateRevisions operation. +type GetFlowTemplateRevisionsAPIClient interface { + GetFlowTemplateRevisions(context.Context, *GetFlowTemplateRevisionsInput, ...func(*Options)) (*GetFlowTemplateRevisionsOutput, error) +} + +var _ GetFlowTemplateRevisionsAPIClient = (*Client)(nil) + +// GetFlowTemplateRevisionsPaginatorOptions is the paginator options for +// GetFlowTemplateRevisions +type GetFlowTemplateRevisionsPaginatorOptions struct { + // The maximum number of results to return in the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetFlowTemplateRevisionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotthingsgraph.GetFlowTemplateRevisions +type GetFlowTemplateRevisionsPaginator struct { + options GetFlowTemplateRevisionsPaginatorOptions + client GetFlowTemplateRevisionsAPIClient + params *GetFlowTemplateRevisionsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetFlowTemplateRevisionsPaginator returns a new +// GetFlowTemplateRevisionsPaginator +func NewGetFlowTemplateRevisionsPaginator(client GetFlowTemplateRevisionsAPIClient, params *GetFlowTemplateRevisionsInput, optFns ...func(*GetFlowTemplateRevisionsPaginatorOptions)) *GetFlowTemplateRevisionsPaginator { + options := GetFlowTemplateRevisionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetFlowTemplateRevisionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetFlowTemplateRevisionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetFlowTemplateRevisions page. +func (p *GetFlowTemplateRevisionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetFlowTemplateRevisionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetFlowTemplateRevisions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetSystemTemplateRevisionsAPIClient is a client that implements the +// GetSystemTemplateRevisions operation. +type GetSystemTemplateRevisionsAPIClient interface { + GetSystemTemplateRevisions(context.Context, *GetSystemTemplateRevisionsInput, ...func(*Options)) (*GetSystemTemplateRevisionsOutput, error) +} + +var _ GetSystemTemplateRevisionsAPIClient = (*Client)(nil) + +// GetSystemTemplateRevisionsPaginatorOptions is the paginator options for +// GetSystemTemplateRevisions +type GetSystemTemplateRevisionsPaginatorOptions struct { + // The maximum number of results to return in the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetSystemTemplateRevisionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotthingsgraph.GetSystemTemplateRevisions +type GetSystemTemplateRevisionsPaginator struct { + options GetSystemTemplateRevisionsPaginatorOptions + client GetSystemTemplateRevisionsAPIClient + params *GetSystemTemplateRevisionsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetSystemTemplateRevisionsPaginator returns a new +// GetSystemTemplateRevisionsPaginator +func NewGetSystemTemplateRevisionsPaginator(client GetSystemTemplateRevisionsAPIClient, params *GetSystemTemplateRevisionsInput, optFns ...func(*GetSystemTemplateRevisionsPaginatorOptions)) *GetSystemTemplateRevisionsPaginator { + options := GetSystemTemplateRevisionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetSystemTemplateRevisionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetSystemTemplateRevisionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetSystemTemplateRevisions page. +func (p *GetSystemTemplateRevisionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetSystemTemplateRevisionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetSystemTemplateRevisions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// SearchThingsAPIClient is a client that implements the SearchThings operation. +type SearchThingsAPIClient interface { + SearchThings(context.Context, *SearchThingsInput, ...func(*Options)) (*SearchThingsOutput, error) +} + +var _ SearchThingsAPIClient = (*Client)(nil) + +// SearchThingsPaginatorOptions is the paginator options for SearchThings +type SearchThingsPaginatorOptions struct { + // The maximum number of results to return in the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// SearchThingsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotthingsgraph.SearchThings +type SearchThingsPaginator struct { + options SearchThingsPaginatorOptions + client SearchThingsAPIClient + params *SearchThingsInput + nextToken *string + firstPage bool + done bool +} + +// NewSearchThingsPaginator returns a new SearchThingsPaginator +func NewSearchThingsPaginator(client SearchThingsAPIClient, params *SearchThingsInput, optFns ...func(*SearchThingsPaginatorOptions)) *SearchThingsPaginator { + options := SearchThingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &SearchThingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchThingsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next SearchThings page. +func (p *SearchThingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchThingsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.SearchThings(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// SearchSystemInstancesAPIClient is a client that implements the +// SearchSystemInstances operation. +type SearchSystemInstancesAPIClient interface { + SearchSystemInstances(context.Context, *SearchSystemInstancesInput, ...func(*Options)) (*SearchSystemInstancesOutput, error) +} + +var _ SearchSystemInstancesAPIClient = (*Client)(nil) + +// SearchSystemInstancesPaginatorOptions is the paginator options for +// SearchSystemInstances +type SearchSystemInstancesPaginatorOptions struct { + // The maximum number of results to return in the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// SearchSystemInstancesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotthingsgraph.SearchSystemInstances +type SearchSystemInstancesPaginator struct { + options SearchSystemInstancesPaginatorOptions + client SearchSystemInstancesAPIClient + params *SearchSystemInstancesInput + nextToken *string + firstPage bool + done bool +} + +// NewSearchSystemInstancesPaginator returns a new SearchSystemInstancesPaginator +func NewSearchSystemInstancesPaginator(client SearchSystemInstancesAPIClient, params *SearchSystemInstancesInput, optFns ...func(*SearchSystemInstancesPaginatorOptions)) *SearchSystemInstancesPaginator { + options := SearchSystemInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &SearchSystemInstancesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchSystemInstancesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next SearchSystemInstances page. +func (p *SearchSystemInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchSystemInstancesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.SearchSystemInstances(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTagsForResourceAPIClient is a client that implements the ListTagsForResource +// operation. +type ListTagsForResourceAPIClient interface { + ListTagsForResource(context.Context, *ListTagsForResourceInput, ...func(*Options)) (*ListTagsForResourceOutput, error) +} + +var _ ListTagsForResourceAPIClient = (*Client)(nil) + +// ListTagsForResourcePaginatorOptions is the paginator options for +// ListTagsForResource +type ListTagsForResourcePaginatorOptions struct { + // The maximum number of tags to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTagsForResourcePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotthingsgraph.ListTagsForResource +type ListTagsForResourcePaginator struct { + options ListTagsForResourcePaginatorOptions + client ListTagsForResourceAPIClient + params *ListTagsForResourceInput + nextToken *string + firstPage bool + done bool +} + +// NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator +func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator { + options := ListTagsForResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTagsForResourcePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTagsForResourcePaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTagsForResource page. +func (p *ListTagsForResourcePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListTagsForResource(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// SearchEntitiesAPIClient is a client that implements the SearchEntities +// operation. +type SearchEntitiesAPIClient interface { + SearchEntities(context.Context, *SearchEntitiesInput, ...func(*Options)) (*SearchEntitiesOutput, error) +} + +var _ SearchEntitiesAPIClient = (*Client)(nil) + +// SearchEntitiesPaginatorOptions is the paginator options for SearchEntities +type SearchEntitiesPaginatorOptions struct { + // The maximum number of results to return in the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// SearchEntitiesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotthingsgraph.SearchEntities +type SearchEntitiesPaginator struct { + options SearchEntitiesPaginatorOptions + client SearchEntitiesAPIClient + params *SearchEntitiesInput + nextToken *string + firstPage bool + done bool +} + +// NewSearchEntitiesPaginator returns a new SearchEntitiesPaginator +func NewSearchEntitiesPaginator(client SearchEntitiesAPIClient, params *SearchEntitiesInput, optFns ...func(*SearchEntitiesPaginatorOptions)) *SearchEntitiesPaginator { + options := SearchEntitiesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &SearchEntitiesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchEntitiesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next SearchEntities page. +func (p *SearchEntitiesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchEntitiesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.SearchEntities(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/ivs/go.sum b/service/ivs/go.sum index c669e324b14..32595049f96 100644 --- a/service/ivs/go.sum +++ b/service/ivs/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/ivs/paginators.go b/service/ivs/paginators.go new file mode 100644 index 00000000000..d6c964f89a3 --- /dev/null +++ b/service/ivs/paginators.go @@ -0,0 +1,384 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ivs + +import ( + "context" + "fmt" +) + +// ListTagsForResourceAPIClient is a client that implements the ListTagsForResource +// operation. +type ListTagsForResourceAPIClient interface { + ListTagsForResource(context.Context, *ListTagsForResourceInput, ...func(*Options)) (*ListTagsForResourceOutput, error) +} + +var _ ListTagsForResourceAPIClient = (*Client)(nil) + +// ListTagsForResourcePaginatorOptions is the paginator options for +// ListTagsForResource +type ListTagsForResourcePaginatorOptions struct { + // Maximum number of tags to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTagsForResourcePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ivs.ListTagsForResource +type ListTagsForResourcePaginator struct { + options ListTagsForResourcePaginatorOptions + client ListTagsForResourceAPIClient + params *ListTagsForResourceInput + nextToken *string + firstPage bool + done bool +} + +// NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator +func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator { + options := ListTagsForResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTagsForResourcePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTagsForResourcePaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTagsForResource page. +func (p *ListTagsForResourcePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListTagsForResource(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListStreamKeysAPIClient is a client that implements the ListStreamKeys +// operation. +type ListStreamKeysAPIClient interface { + ListStreamKeys(context.Context, *ListStreamKeysInput, ...func(*Options)) (*ListStreamKeysOutput, error) +} + +var _ ListStreamKeysAPIClient = (*Client)(nil) + +// ListStreamKeysPaginatorOptions is the paginator options for ListStreamKeys +type ListStreamKeysPaginatorOptions struct { + // Maximum number of streamKeys to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListStreamKeysPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ivs.ListStreamKeys +type ListStreamKeysPaginator struct { + options ListStreamKeysPaginatorOptions + client ListStreamKeysAPIClient + params *ListStreamKeysInput + nextToken *string + firstPage bool + done bool +} + +// NewListStreamKeysPaginator returns a new ListStreamKeysPaginator +func NewListStreamKeysPaginator(client ListStreamKeysAPIClient, params *ListStreamKeysInput, optFns ...func(*ListStreamKeysPaginatorOptions)) *ListStreamKeysPaginator { + options := ListStreamKeysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListStreamKeysPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListStreamKeysPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListStreamKeys page. +func (p *ListStreamKeysPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListStreamKeysOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListStreamKeys(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListStreamsAPIClient is a client that implements the ListStreams operation. +type ListStreamsAPIClient interface { + ListStreams(context.Context, *ListStreamsInput, ...func(*Options)) (*ListStreamsOutput, error) +} + +var _ ListStreamsAPIClient = (*Client)(nil) + +// ListStreamsPaginatorOptions is the paginator options for ListStreams +type ListStreamsPaginatorOptions struct { + // Maximum number of streams to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListStreamsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ivs.ListStreams +type ListStreamsPaginator struct { + options ListStreamsPaginatorOptions + client ListStreamsAPIClient + params *ListStreamsInput + nextToken *string + firstPage bool + done bool +} + +// NewListStreamsPaginator returns a new ListStreamsPaginator +func NewListStreamsPaginator(client ListStreamsAPIClient, params *ListStreamsInput, optFns ...func(*ListStreamsPaginatorOptions)) *ListStreamsPaginator { + options := ListStreamsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListStreamsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListStreamsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListStreams page. +func (p *ListStreamsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListStreamsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListStreams(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListChannelsAPIClient is a client that implements the ListChannels operation. +type ListChannelsAPIClient interface { + ListChannels(context.Context, *ListChannelsInput, ...func(*Options)) (*ListChannelsOutput, error) +} + +var _ ListChannelsAPIClient = (*Client)(nil) + +// ListChannelsPaginatorOptions is the paginator options for ListChannels +type ListChannelsPaginatorOptions struct { + // Maximum number of channels to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListChannelsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ivs.ListChannels +type ListChannelsPaginator struct { + options ListChannelsPaginatorOptions + client ListChannelsAPIClient + params *ListChannelsInput + nextToken *string + firstPage bool + done bool +} + +// NewListChannelsPaginator returns a new ListChannelsPaginator +func NewListChannelsPaginator(client ListChannelsAPIClient, params *ListChannelsInput, optFns ...func(*ListChannelsPaginatorOptions)) *ListChannelsPaginator { + options := ListChannelsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListChannelsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListChannelsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListChannels page. +func (p *ListChannelsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListChannelsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListChannels(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListPlaybackKeyPairsAPIClient is a client that implements the +// ListPlaybackKeyPairs operation. +type ListPlaybackKeyPairsAPIClient interface { + ListPlaybackKeyPairs(context.Context, *ListPlaybackKeyPairsInput, ...func(*Options)) (*ListPlaybackKeyPairsOutput, error) +} + +var _ ListPlaybackKeyPairsAPIClient = (*Client)(nil) + +// ListPlaybackKeyPairsPaginatorOptions is the paginator options for +// ListPlaybackKeyPairs +type ListPlaybackKeyPairsPaginatorOptions struct { + // The first key pair to retrieve. This is used for pagination; see the nextToken + // response field. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListPlaybackKeyPairsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ivs.ListPlaybackKeyPairs +type ListPlaybackKeyPairsPaginator struct { + options ListPlaybackKeyPairsPaginatorOptions + client ListPlaybackKeyPairsAPIClient + params *ListPlaybackKeyPairsInput + nextToken *string + firstPage bool + done bool +} + +// NewListPlaybackKeyPairsPaginator returns a new ListPlaybackKeyPairsPaginator +func NewListPlaybackKeyPairsPaginator(client ListPlaybackKeyPairsAPIClient, params *ListPlaybackKeyPairsInput, optFns ...func(*ListPlaybackKeyPairsPaginatorOptions)) *ListPlaybackKeyPairsPaginator { + options := ListPlaybackKeyPairsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListPlaybackKeyPairsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPlaybackKeyPairsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListPlaybackKeyPairs page. +func (p *ListPlaybackKeyPairsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPlaybackKeyPairsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListPlaybackKeyPairs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/kafka/go.sum b/service/kafka/go.sum index c669e324b14..32595049f96 100644 --- a/service/kafka/go.sum +++ b/service/kafka/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/kafka/paginators.go b/service/kafka/paginators.go new file mode 100644 index 00000000000..23e54e82a97 --- /dev/null +++ b/service/kafka/paginators.go @@ -0,0 +1,541 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package kafka + +import ( + "context" + "fmt" +) + +// ListNodesAPIClient is a client that implements the ListNodes operation. +type ListNodesAPIClient interface { + ListNodes(context.Context, *ListNodesInput, ...func(*Options)) (*ListNodesOutput, error) +} + +var _ ListNodesAPIClient = (*Client)(nil) + +// ListNodesPaginatorOptions is the paginator options for ListNodes +type ListNodesPaginatorOptions struct { + // The maximum number of results to return in the response. If there are more + // results, the response includes a NextToken parameter. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListNodesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/kafka.ListNodes +type ListNodesPaginator struct { + options ListNodesPaginatorOptions + client ListNodesAPIClient + params *ListNodesInput + nextToken *string + firstPage bool + done bool +} + +// NewListNodesPaginator returns a new ListNodesPaginator +func NewListNodesPaginator(client ListNodesAPIClient, params *ListNodesInput, optFns ...func(*ListNodesPaginatorOptions)) *ListNodesPaginator { + options := ListNodesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListNodesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListNodesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListNodes page. +func (p *ListNodesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListNodesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListNodes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListKafkaVersionsAPIClient is a client that implements the ListKafkaVersions +// operation. +type ListKafkaVersionsAPIClient interface { + ListKafkaVersions(context.Context, *ListKafkaVersionsInput, ...func(*Options)) (*ListKafkaVersionsOutput, error) +} + +var _ ListKafkaVersionsAPIClient = (*Client)(nil) + +// ListKafkaVersionsPaginatorOptions is the paginator options for ListKafkaVersions +type ListKafkaVersionsPaginatorOptions struct { + // The maximum number of results to return in the response. If there are more + // results, the response includes a NextToken parameter. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListKafkaVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/kafka.ListKafkaVersions +type ListKafkaVersionsPaginator struct { + options ListKafkaVersionsPaginatorOptions + client ListKafkaVersionsAPIClient + params *ListKafkaVersionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListKafkaVersionsPaginator returns a new ListKafkaVersionsPaginator +func NewListKafkaVersionsPaginator(client ListKafkaVersionsAPIClient, params *ListKafkaVersionsInput, optFns ...func(*ListKafkaVersionsPaginatorOptions)) *ListKafkaVersionsPaginator { + options := ListKafkaVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListKafkaVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListKafkaVersionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListKafkaVersions page. +func (p *ListKafkaVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListKafkaVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListKafkaVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListConfigurationsAPIClient is a client that implements the ListConfigurations +// operation. +type ListConfigurationsAPIClient interface { + ListConfigurations(context.Context, *ListConfigurationsInput, ...func(*Options)) (*ListConfigurationsOutput, error) +} + +var _ ListConfigurationsAPIClient = (*Client)(nil) + +// ListConfigurationsPaginatorOptions is the paginator options for +// ListConfigurations +type ListConfigurationsPaginatorOptions struct { + // The maximum number of results to return in the response. If there are more + // results, the response includes a NextToken parameter. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListConfigurationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/kafka.ListConfigurations +type ListConfigurationsPaginator struct { + options ListConfigurationsPaginatorOptions + client ListConfigurationsAPIClient + params *ListConfigurationsInput + nextToken *string + firstPage bool + done bool +} + +// NewListConfigurationsPaginator returns a new ListConfigurationsPaginator +func NewListConfigurationsPaginator(client ListConfigurationsAPIClient, params *ListConfigurationsInput, optFns ...func(*ListConfigurationsPaginatorOptions)) *ListConfigurationsPaginator { + options := ListConfigurationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListConfigurationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListConfigurationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListConfigurations page. +func (p *ListConfigurationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListConfigurationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListConfigurations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListConfigurationRevisionsAPIClient is a client that implements the +// ListConfigurationRevisions operation. +type ListConfigurationRevisionsAPIClient interface { + ListConfigurationRevisions(context.Context, *ListConfigurationRevisionsInput, ...func(*Options)) (*ListConfigurationRevisionsOutput, error) +} + +var _ ListConfigurationRevisionsAPIClient = (*Client)(nil) + +// ListConfigurationRevisionsPaginatorOptions is the paginator options for +// ListConfigurationRevisions +type ListConfigurationRevisionsPaginatorOptions struct { + // The maximum number of results to return in the response. If there are more + // results, the response includes a NextToken parameter. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListConfigurationRevisionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/kafka.ListConfigurationRevisions +type ListConfigurationRevisionsPaginator struct { + options ListConfigurationRevisionsPaginatorOptions + client ListConfigurationRevisionsAPIClient + params *ListConfigurationRevisionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListConfigurationRevisionsPaginator returns a new +// ListConfigurationRevisionsPaginator +func NewListConfigurationRevisionsPaginator(client ListConfigurationRevisionsAPIClient, params *ListConfigurationRevisionsInput, optFns ...func(*ListConfigurationRevisionsPaginatorOptions)) *ListConfigurationRevisionsPaginator { + options := ListConfigurationRevisionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListConfigurationRevisionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListConfigurationRevisionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListConfigurationRevisions page. +func (p *ListConfigurationRevisionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListConfigurationRevisionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListConfigurationRevisions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListClusterOperationsAPIClient is a client that implements the +// ListClusterOperations operation. +type ListClusterOperationsAPIClient interface { + ListClusterOperations(context.Context, *ListClusterOperationsInput, ...func(*Options)) (*ListClusterOperationsOutput, error) +} + +var _ ListClusterOperationsAPIClient = (*Client)(nil) + +// ListClusterOperationsPaginatorOptions is the paginator options for +// ListClusterOperations +type ListClusterOperationsPaginatorOptions struct { + // The maximum number of results to return in the response. If there are more + // results, the response includes a NextToken parameter. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListClusterOperationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/kafka.ListClusterOperations +type ListClusterOperationsPaginator struct { + options ListClusterOperationsPaginatorOptions + client ListClusterOperationsAPIClient + params *ListClusterOperationsInput + nextToken *string + firstPage bool + done bool +} + +// NewListClusterOperationsPaginator returns a new ListClusterOperationsPaginator +func NewListClusterOperationsPaginator(client ListClusterOperationsAPIClient, params *ListClusterOperationsInput, optFns ...func(*ListClusterOperationsPaginatorOptions)) *ListClusterOperationsPaginator { + options := ListClusterOperationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListClusterOperationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListClusterOperationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListClusterOperations page. +func (p *ListClusterOperationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListClusterOperationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListClusterOperations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListScramSecretsAPIClient is a client that implements the ListScramSecrets +// operation. +type ListScramSecretsAPIClient interface { + ListScramSecrets(context.Context, *ListScramSecretsInput, ...func(*Options)) (*ListScramSecretsOutput, error) +} + +var _ ListScramSecretsAPIClient = (*Client)(nil) + +// ListScramSecretsPaginatorOptions is the paginator options for ListScramSecrets +type ListScramSecretsPaginatorOptions struct { + // The maxResults of the query. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListScramSecretsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/kafka.ListScramSecrets +type ListScramSecretsPaginator struct { + options ListScramSecretsPaginatorOptions + client ListScramSecretsAPIClient + params *ListScramSecretsInput + nextToken *string + firstPage bool + done bool +} + +// NewListScramSecretsPaginator returns a new ListScramSecretsPaginator +func NewListScramSecretsPaginator(client ListScramSecretsAPIClient, params *ListScramSecretsInput, optFns ...func(*ListScramSecretsPaginatorOptions)) *ListScramSecretsPaginator { + options := ListScramSecretsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListScramSecretsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListScramSecretsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListScramSecrets page. +func (p *ListScramSecretsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListScramSecretsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListScramSecrets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListClustersAPIClient is a client that implements the ListClusters operation. +type ListClustersAPIClient interface { + ListClusters(context.Context, *ListClustersInput, ...func(*Options)) (*ListClustersOutput, error) +} + +var _ ListClustersAPIClient = (*Client)(nil) + +// ListClustersPaginatorOptions is the paginator options for ListClusters +type ListClustersPaginatorOptions struct { + // The maximum number of results to return in the response. If there are more + // results, the response includes a NextToken parameter. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListClustersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/kafka.ListClusters +type ListClustersPaginator struct { + options ListClustersPaginatorOptions + client ListClustersAPIClient + params *ListClustersInput + nextToken *string + firstPage bool + done bool +} + +// NewListClustersPaginator returns a new ListClustersPaginator +func NewListClustersPaginator(client ListClustersAPIClient, params *ListClustersInput, optFns ...func(*ListClustersPaginatorOptions)) *ListClustersPaginator { + options := ListClustersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListClustersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListClustersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListClusters page. +func (p *ListClustersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListClustersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListClusters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/kendra/go.sum b/service/kendra/go.sum index c669e324b14..32595049f96 100644 --- a/service/kendra/go.sum +++ b/service/kendra/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/kendra/paginators.go b/service/kendra/paginators.go new file mode 100644 index 00000000000..353a832596a --- /dev/null +++ b/service/kendra/paginators.go @@ -0,0 +1,234 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package kendra + +import ( + "context" + "fmt" +) + +// ListDataSourceSyncJobsAPIClient is a client that implements the +// ListDataSourceSyncJobs operation. +type ListDataSourceSyncJobsAPIClient interface { + ListDataSourceSyncJobs(context.Context, *ListDataSourceSyncJobsInput, ...func(*Options)) (*ListDataSourceSyncJobsOutput, error) +} + +var _ ListDataSourceSyncJobsAPIClient = (*Client)(nil) + +// ListDataSourceSyncJobsPaginatorOptions is the paginator options for +// ListDataSourceSyncJobs +type ListDataSourceSyncJobsPaginatorOptions struct { + // The maximum number of synchronization jobs to return in the response. If there + // are fewer results in the list, this response contains only the actual results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDataSourceSyncJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/kendra.ListDataSourceSyncJobs +type ListDataSourceSyncJobsPaginator struct { + options ListDataSourceSyncJobsPaginatorOptions + client ListDataSourceSyncJobsAPIClient + params *ListDataSourceSyncJobsInput + nextToken *string + firstPage bool + done bool +} + +// NewListDataSourceSyncJobsPaginator returns a new ListDataSourceSyncJobsPaginator +func NewListDataSourceSyncJobsPaginator(client ListDataSourceSyncJobsAPIClient, params *ListDataSourceSyncJobsInput, optFns ...func(*ListDataSourceSyncJobsPaginatorOptions)) *ListDataSourceSyncJobsPaginator { + options := ListDataSourceSyncJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDataSourceSyncJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDataSourceSyncJobsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDataSourceSyncJobs page. +func (p *ListDataSourceSyncJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDataSourceSyncJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListDataSourceSyncJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDataSourcesAPIClient is a client that implements the ListDataSources +// operation. +type ListDataSourcesAPIClient interface { + ListDataSources(context.Context, *ListDataSourcesInput, ...func(*Options)) (*ListDataSourcesOutput, error) +} + +var _ ListDataSourcesAPIClient = (*Client)(nil) + +// ListDataSourcesPaginatorOptions is the paginator options for ListDataSources +type ListDataSourcesPaginatorOptions struct { + // The maximum number of data sources to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDataSourcesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/kendra.ListDataSources +type ListDataSourcesPaginator struct { + options ListDataSourcesPaginatorOptions + client ListDataSourcesAPIClient + params *ListDataSourcesInput + nextToken *string + firstPage bool + done bool +} + +// NewListDataSourcesPaginator returns a new ListDataSourcesPaginator +func NewListDataSourcesPaginator(client ListDataSourcesAPIClient, params *ListDataSourcesInput, optFns ...func(*ListDataSourcesPaginatorOptions)) *ListDataSourcesPaginator { + options := ListDataSourcesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDataSourcesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDataSourcesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDataSources page. +func (p *ListDataSourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDataSourcesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListDataSources(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListIndicesAPIClient is a client that implements the ListIndices operation. +type ListIndicesAPIClient interface { + ListIndices(context.Context, *ListIndicesInput, ...func(*Options)) (*ListIndicesOutput, error) +} + +var _ ListIndicesAPIClient = (*Client)(nil) + +// ListIndicesPaginatorOptions is the paginator options for ListIndices +type ListIndicesPaginatorOptions struct { + // The maximum number of data sources to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListIndicesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/kendra.ListIndices +type ListIndicesPaginator struct { + options ListIndicesPaginatorOptions + client ListIndicesAPIClient + params *ListIndicesInput + nextToken *string + firstPage bool + done bool +} + +// NewListIndicesPaginator returns a new ListIndicesPaginator +func NewListIndicesPaginator(client ListIndicesAPIClient, params *ListIndicesInput, optFns ...func(*ListIndicesPaginatorOptions)) *ListIndicesPaginator { + options := ListIndicesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListIndicesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListIndicesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListIndices page. +func (p *ListIndicesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListIndicesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListIndices(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/kinesis/go.sum b/service/kinesis/go.sum index c669e324b14..32595049f96 100644 --- a/service/kinesis/go.sum +++ b/service/kinesis/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/kinesis/paginators.go b/service/kinesis/paginators.go new file mode 100644 index 00000000000..abf69ce2157 --- /dev/null +++ b/service/kinesis/paginators.go @@ -0,0 +1,85 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package kinesis + +import ( + "context" + "fmt" +) + +// ListStreamConsumersAPIClient is a client that implements the ListStreamConsumers +// operation. +type ListStreamConsumersAPIClient interface { + ListStreamConsumers(context.Context, *ListStreamConsumersInput, ...func(*Options)) (*ListStreamConsumersOutput, error) +} + +var _ ListStreamConsumersAPIClient = (*Client)(nil) + +// ListStreamConsumersPaginatorOptions is the paginator options for +// ListStreamConsumers +type ListStreamConsumersPaginatorOptions struct { + // The maximum number of consumers that you want a single call of + // ListStreamConsumers to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListStreamConsumersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/kinesis.ListStreamConsumers +type ListStreamConsumersPaginator struct { + options ListStreamConsumersPaginatorOptions + client ListStreamConsumersAPIClient + params *ListStreamConsumersInput + nextToken *string + firstPage bool + done bool +} + +// NewListStreamConsumersPaginator returns a new ListStreamConsumersPaginator +func NewListStreamConsumersPaginator(client ListStreamConsumersAPIClient, params *ListStreamConsumersInput, optFns ...func(*ListStreamConsumersPaginatorOptions)) *ListStreamConsumersPaginator { + options := ListStreamConsumersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListStreamConsumersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListStreamConsumersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListStreamConsumers page. +func (p *ListStreamConsumersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListStreamConsumersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListStreamConsumers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/kinesisanalytics/go.sum b/service/kinesisanalytics/go.sum index c669e324b14..32595049f96 100644 --- a/service/kinesisanalytics/go.sum +++ b/service/kinesisanalytics/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/kinesisanalyticsv2/go.sum b/service/kinesisanalyticsv2/go.sum index c669e324b14..32595049f96 100644 --- a/service/kinesisanalyticsv2/go.sum +++ b/service/kinesisanalyticsv2/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/kinesisvideo/go.sum b/service/kinesisvideo/go.sum index c669e324b14..32595049f96 100644 --- a/service/kinesisvideo/go.sum +++ b/service/kinesisvideo/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/kinesisvideo/paginators.go b/service/kinesisvideo/paginators.go new file mode 100644 index 00000000000..05c6b8fd802 --- /dev/null +++ b/service/kinesisvideo/paginators.go @@ -0,0 +1,158 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package kinesisvideo + +import ( + "context" + "fmt" +) + +// ListSignalingChannelsAPIClient is a client that implements the +// ListSignalingChannels operation. +type ListSignalingChannelsAPIClient interface { + ListSignalingChannels(context.Context, *ListSignalingChannelsInput, ...func(*Options)) (*ListSignalingChannelsOutput, error) +} + +var _ ListSignalingChannelsAPIClient = (*Client)(nil) + +// ListSignalingChannelsPaginatorOptions is the paginator options for +// ListSignalingChannels +type ListSignalingChannelsPaginatorOptions struct { + // The maximum number of channels to return in the response. The default is 500. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListSignalingChannelsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/kinesisvideo.ListSignalingChannels +type ListSignalingChannelsPaginator struct { + options ListSignalingChannelsPaginatorOptions + client ListSignalingChannelsAPIClient + params *ListSignalingChannelsInput + nextToken *string + firstPage bool + done bool +} + +// NewListSignalingChannelsPaginator returns a new ListSignalingChannelsPaginator +func NewListSignalingChannelsPaginator(client ListSignalingChannelsAPIClient, params *ListSignalingChannelsInput, optFns ...func(*ListSignalingChannelsPaginatorOptions)) *ListSignalingChannelsPaginator { + options := ListSignalingChannelsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListSignalingChannelsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSignalingChannelsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListSignalingChannels page. +func (p *ListSignalingChannelsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSignalingChannelsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListSignalingChannels(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListStreamsAPIClient is a client that implements the ListStreams operation. +type ListStreamsAPIClient interface { + ListStreams(context.Context, *ListStreamsInput, ...func(*Options)) (*ListStreamsOutput, error) +} + +var _ ListStreamsAPIClient = (*Client)(nil) + +// ListStreamsPaginatorOptions is the paginator options for ListStreams +type ListStreamsPaginatorOptions struct { + // The maximum number of streams to return in the response. The default is 10,000. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListStreamsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/kinesisvideo.ListStreams +type ListStreamsPaginator struct { + options ListStreamsPaginatorOptions + client ListStreamsAPIClient + params *ListStreamsInput + nextToken *string + firstPage bool + done bool +} + +// NewListStreamsPaginator returns a new ListStreamsPaginator +func NewListStreamsPaginator(client ListStreamsAPIClient, params *ListStreamsInput, optFns ...func(*ListStreamsPaginatorOptions)) *ListStreamsPaginator { + options := ListStreamsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListStreamsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListStreamsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListStreams page. +func (p *ListStreamsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListStreamsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListStreams(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/kinesisvideoarchivedmedia/go.sum b/service/kinesisvideoarchivedmedia/go.sum index c669e324b14..32595049f96 100644 --- a/service/kinesisvideoarchivedmedia/go.sum +++ b/service/kinesisvideoarchivedmedia/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/kinesisvideomedia/go.sum b/service/kinesisvideomedia/go.sum index c669e324b14..32595049f96 100644 --- a/service/kinesisvideomedia/go.sum +++ b/service/kinesisvideomedia/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/kinesisvideosignaling/go.sum b/service/kinesisvideosignaling/go.sum index c669e324b14..32595049f96 100644 --- a/service/kinesisvideosignaling/go.sum +++ b/service/kinesisvideosignaling/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/kms/go.sum b/service/kms/go.sum index c669e324b14..32595049f96 100644 --- a/service/kms/go.sum +++ b/service/kms/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/kms/paginators.go b/service/kms/paginators.go new file mode 100644 index 00000000000..d34bb61ef28 --- /dev/null +++ b/service/kms/paginators.go @@ -0,0 +1,321 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package kms + +import ( + "context" + "fmt" +) + +// ListKeysAPIClient is a client that implements the ListKeys operation. +type ListKeysAPIClient interface { + ListKeys(context.Context, *ListKeysInput, ...func(*Options)) (*ListKeysOutput, error) +} + +var _ ListKeysAPIClient = (*Client)(nil) + +// ListKeysPaginatorOptions is the paginator options for ListKeys +type ListKeysPaginatorOptions struct { + // Use this parameter to specify the maximum number of items to return. When this + // value is present, AWS KMS does not return more than the specified number of + // items, but it might return fewer. This value is optional. If you include a + // value, it must be between 1 and 1000, inclusive. If you do not include a value, + // it defaults to 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListKeysPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/kms.ListKeys +type ListKeysPaginator struct { + options ListKeysPaginatorOptions + client ListKeysAPIClient + params *ListKeysInput + nextToken *string + firstPage bool + done bool +} + +// NewListKeysPaginator returns a new ListKeysPaginator +func NewListKeysPaginator(client ListKeysAPIClient, params *ListKeysInput, optFns ...func(*ListKeysPaginatorOptions)) *ListKeysPaginator { + options := ListKeysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListKeysPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListKeysPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListKeys page. +func (p *ListKeysPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListKeysOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.ListKeys(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListAliasesAPIClient is a client that implements the ListAliases operation. +type ListAliasesAPIClient interface { + ListAliases(context.Context, *ListAliasesInput, ...func(*Options)) (*ListAliasesOutput, error) +} + +var _ ListAliasesAPIClient = (*Client)(nil) + +// ListAliasesPaginatorOptions is the paginator options for ListAliases +type ListAliasesPaginatorOptions struct { + // Use this parameter to specify the maximum number of items to return. When this + // value is present, AWS KMS does not return more than the specified number of + // items, but it might return fewer. This value is optional. If you include a + // value, it must be between 1 and 100, inclusive. If you do not include a value, + // it defaults to 50. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAliasesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/kms.ListAliases +type ListAliasesPaginator struct { + options ListAliasesPaginatorOptions + client ListAliasesAPIClient + params *ListAliasesInput + nextToken *string + firstPage bool + done bool +} + +// NewListAliasesPaginator returns a new ListAliasesPaginator +func NewListAliasesPaginator(client ListAliasesAPIClient, params *ListAliasesInput, optFns ...func(*ListAliasesPaginatorOptions)) *ListAliasesPaginator { + options := ListAliasesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAliasesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAliasesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAliases page. +func (p *ListAliasesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAliasesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.ListAliases(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListKeyPoliciesAPIClient is a client that implements the ListKeyPolicies +// operation. +type ListKeyPoliciesAPIClient interface { + ListKeyPolicies(context.Context, *ListKeyPoliciesInput, ...func(*Options)) (*ListKeyPoliciesOutput, error) +} + +var _ ListKeyPoliciesAPIClient = (*Client)(nil) + +// ListKeyPoliciesPaginatorOptions is the paginator options for ListKeyPolicies +type ListKeyPoliciesPaginatorOptions struct { + // Use this parameter to specify the maximum number of items to return. When this + // value is present, AWS KMS does not return more than the specified number of + // items, but it might return fewer. This value is optional. If you include a + // value, it must be between 1 and 1000, inclusive. If you do not include a value, + // it defaults to 100. Only one policy can be attached to a key. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListKeyPoliciesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/kms.ListKeyPolicies +type ListKeyPoliciesPaginator struct { + options ListKeyPoliciesPaginatorOptions + client ListKeyPoliciesAPIClient + params *ListKeyPoliciesInput + nextToken *string + firstPage bool + done bool +} + +// NewListKeyPoliciesPaginator returns a new ListKeyPoliciesPaginator +func NewListKeyPoliciesPaginator(client ListKeyPoliciesAPIClient, params *ListKeyPoliciesInput, optFns ...func(*ListKeyPoliciesPaginatorOptions)) *ListKeyPoliciesPaginator { + options := ListKeyPoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListKeyPoliciesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListKeyPoliciesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListKeyPolicies page. +func (p *ListKeyPoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListKeyPoliciesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.ListKeyPolicies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListGrantsAPIClient is a client that implements the ListGrants operation. +type ListGrantsAPIClient interface { + ListGrants(context.Context, *ListGrantsInput, ...func(*Options)) (*ListGrantsOutput, error) +} + +var _ ListGrantsAPIClient = (*Client)(nil) + +// ListGrantsPaginatorOptions is the paginator options for ListGrants +type ListGrantsPaginatorOptions struct { + // Use this parameter to specify the maximum number of items to return. When this + // value is present, AWS KMS does not return more than the specified number of + // items, but it might return fewer. This value is optional. If you include a + // value, it must be between 1 and 100, inclusive. If you do not include a value, + // it defaults to 50. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListGrantsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/kms.ListGrants +type ListGrantsPaginator struct { + options ListGrantsPaginatorOptions + client ListGrantsAPIClient + params *ListGrantsInput + nextToken *string + firstPage bool + done bool +} + +// NewListGrantsPaginator returns a new ListGrantsPaginator +func NewListGrantsPaginator(client ListGrantsAPIClient, params *ListGrantsInput, optFns ...func(*ListGrantsPaginatorOptions)) *ListGrantsPaginator { + options := ListGrantsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListGrantsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListGrantsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListGrants page. +func (p *ListGrantsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListGrantsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.ListGrants(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/lakeformation/go.sum b/service/lakeformation/go.sum index c669e324b14..32595049f96 100644 --- a/service/lakeformation/go.sum +++ b/service/lakeformation/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/lakeformation/paginators.go b/service/lakeformation/paginators.go new file mode 100644 index 00000000000..2ae6d49f609 --- /dev/null +++ b/service/lakeformation/paginators.go @@ -0,0 +1,234 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package lakeformation + +import ( + "context" + "fmt" +) + +// ListPermissionsAPIClient is a client that implements the ListPermissions +// operation. +type ListPermissionsAPIClient interface { + ListPermissions(context.Context, *ListPermissionsInput, ...func(*Options)) (*ListPermissionsOutput, error) +} + +var _ ListPermissionsAPIClient = (*Client)(nil) + +// ListPermissionsPaginatorOptions is the paginator options for ListPermissions +type ListPermissionsPaginatorOptions struct { + // The maximum number of results to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListPermissionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/lakeformation.ListPermissions +type ListPermissionsPaginator struct { + options ListPermissionsPaginatorOptions + client ListPermissionsAPIClient + params *ListPermissionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListPermissionsPaginator returns a new ListPermissionsPaginator +func NewListPermissionsPaginator(client ListPermissionsAPIClient, params *ListPermissionsInput, optFns ...func(*ListPermissionsPaginatorOptions)) *ListPermissionsPaginator { + options := ListPermissionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListPermissionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPermissionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListPermissions page. +func (p *ListPermissionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPermissionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListPermissions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListResourcesAPIClient is a client that implements the ListResources operation. +type ListResourcesAPIClient interface { + ListResources(context.Context, *ListResourcesInput, ...func(*Options)) (*ListResourcesOutput, error) +} + +var _ ListResourcesAPIClient = (*Client)(nil) + +// ListResourcesPaginatorOptions is the paginator options for ListResources +type ListResourcesPaginatorOptions struct { + // The maximum number of resource results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListResourcesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/lakeformation.ListResources +type ListResourcesPaginator struct { + options ListResourcesPaginatorOptions + client ListResourcesAPIClient + params *ListResourcesInput + nextToken *string + firstPage bool + done bool +} + +// NewListResourcesPaginator returns a new ListResourcesPaginator +func NewListResourcesPaginator(client ListResourcesAPIClient, params *ListResourcesInput, optFns ...func(*ListResourcesPaginatorOptions)) *ListResourcesPaginator { + options := ListResourcesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListResourcesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListResourcesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListResources page. +func (p *ListResourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListResourcesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListResources(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetEffectivePermissionsForPathAPIClient is a client that implements the +// GetEffectivePermissionsForPath operation. +type GetEffectivePermissionsForPathAPIClient interface { + GetEffectivePermissionsForPath(context.Context, *GetEffectivePermissionsForPathInput, ...func(*Options)) (*GetEffectivePermissionsForPathOutput, error) +} + +var _ GetEffectivePermissionsForPathAPIClient = (*Client)(nil) + +// GetEffectivePermissionsForPathPaginatorOptions is the paginator options for +// GetEffectivePermissionsForPath +type GetEffectivePermissionsForPathPaginatorOptions struct { + // The maximum number of results to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetEffectivePermissionsForPathPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/lakeformation.GetEffectivePermissionsForPath +type GetEffectivePermissionsForPathPaginator struct { + options GetEffectivePermissionsForPathPaginatorOptions + client GetEffectivePermissionsForPathAPIClient + params *GetEffectivePermissionsForPathInput + nextToken *string + firstPage bool + done bool +} + +// NewGetEffectivePermissionsForPathPaginator returns a new +// GetEffectivePermissionsForPathPaginator +func NewGetEffectivePermissionsForPathPaginator(client GetEffectivePermissionsForPathAPIClient, params *GetEffectivePermissionsForPathInput, optFns ...func(*GetEffectivePermissionsForPathPaginatorOptions)) *GetEffectivePermissionsForPathPaginator { + options := GetEffectivePermissionsForPathPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetEffectivePermissionsForPathPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetEffectivePermissionsForPathPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetEffectivePermissionsForPath page. +func (p *GetEffectivePermissionsForPathPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetEffectivePermissionsForPathOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetEffectivePermissionsForPath(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/lambda/go.sum b/service/lambda/go.sum index c669e324b14..32595049f96 100644 --- a/service/lambda/go.sum +++ b/service/lambda/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/lambda/paginators.go b/service/lambda/paginators.go new file mode 100644 index 00000000000..26bb183b2e0 --- /dev/null +++ b/service/lambda/paginators.go @@ -0,0 +1,612 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package lambda + +import ( + "context" + "fmt" +) + +// ListEventSourceMappingsAPIClient is a client that implements the +// ListEventSourceMappings operation. +type ListEventSourceMappingsAPIClient interface { + ListEventSourceMappings(context.Context, *ListEventSourceMappingsInput, ...func(*Options)) (*ListEventSourceMappingsOutput, error) +} + +var _ ListEventSourceMappingsAPIClient = (*Client)(nil) + +// ListEventSourceMappingsPaginatorOptions is the paginator options for +// ListEventSourceMappings +type ListEventSourceMappingsPaginatorOptions struct { + // The maximum number of event source mappings to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListEventSourceMappingsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/lambda.ListEventSourceMappings +type ListEventSourceMappingsPaginator struct { + options ListEventSourceMappingsPaginatorOptions + client ListEventSourceMappingsAPIClient + params *ListEventSourceMappingsInput + nextToken *string + firstPage bool + done bool +} + +// NewListEventSourceMappingsPaginator returns a new +// ListEventSourceMappingsPaginator +func NewListEventSourceMappingsPaginator(client ListEventSourceMappingsAPIClient, params *ListEventSourceMappingsInput, optFns ...func(*ListEventSourceMappingsPaginatorOptions)) *ListEventSourceMappingsPaginator { + options := ListEventSourceMappingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListEventSourceMappingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListEventSourceMappingsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListEventSourceMappings page. +func (p *ListEventSourceMappingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEventSourceMappingsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxItems = p.options.Limit + result, err := p.client.ListEventSourceMappings(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListFunctionsAPIClient is a client that implements the ListFunctions operation. +type ListFunctionsAPIClient interface { + ListFunctions(context.Context, *ListFunctionsInput, ...func(*Options)) (*ListFunctionsOutput, error) +} + +var _ ListFunctionsAPIClient = (*Client)(nil) + +// ListFunctionsPaginatorOptions is the paginator options for ListFunctions +type ListFunctionsPaginatorOptions struct { + // The maximum number of functions to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListFunctionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/lambda.ListFunctions +type ListFunctionsPaginator struct { + options ListFunctionsPaginatorOptions + client ListFunctionsAPIClient + params *ListFunctionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListFunctionsPaginator returns a new ListFunctionsPaginator +func NewListFunctionsPaginator(client ListFunctionsAPIClient, params *ListFunctionsInput, optFns ...func(*ListFunctionsPaginatorOptions)) *ListFunctionsPaginator { + options := ListFunctionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListFunctionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListFunctionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListFunctions page. +func (p *ListFunctionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFunctionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxItems = p.options.Limit + result, err := p.client.ListFunctions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListLayerVersionsAPIClient is a client that implements the ListLayerVersions +// operation. +type ListLayerVersionsAPIClient interface { + ListLayerVersions(context.Context, *ListLayerVersionsInput, ...func(*Options)) (*ListLayerVersionsOutput, error) +} + +var _ ListLayerVersionsAPIClient = (*Client)(nil) + +// ListLayerVersionsPaginatorOptions is the paginator options for ListLayerVersions +type ListLayerVersionsPaginatorOptions struct { + // The maximum number of versions to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListLayerVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/lambda.ListLayerVersions +type ListLayerVersionsPaginator struct { + options ListLayerVersionsPaginatorOptions + client ListLayerVersionsAPIClient + params *ListLayerVersionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListLayerVersionsPaginator returns a new ListLayerVersionsPaginator +func NewListLayerVersionsPaginator(client ListLayerVersionsAPIClient, params *ListLayerVersionsInput, optFns ...func(*ListLayerVersionsPaginatorOptions)) *ListLayerVersionsPaginator { + options := ListLayerVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListLayerVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListLayerVersionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListLayerVersions page. +func (p *ListLayerVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListLayerVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxItems = p.options.Limit + result, err := p.client.ListLayerVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListVersionsByFunctionAPIClient is a client that implements the +// ListVersionsByFunction operation. +type ListVersionsByFunctionAPIClient interface { + ListVersionsByFunction(context.Context, *ListVersionsByFunctionInput, ...func(*Options)) (*ListVersionsByFunctionOutput, error) +} + +var _ ListVersionsByFunctionAPIClient = (*Client)(nil) + +// ListVersionsByFunctionPaginatorOptions is the paginator options for +// ListVersionsByFunction +type ListVersionsByFunctionPaginatorOptions struct { + // The maximum number of versions to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListVersionsByFunctionPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/lambda.ListVersionsByFunction +type ListVersionsByFunctionPaginator struct { + options ListVersionsByFunctionPaginatorOptions + client ListVersionsByFunctionAPIClient + params *ListVersionsByFunctionInput + nextToken *string + firstPage bool + done bool +} + +// NewListVersionsByFunctionPaginator returns a new ListVersionsByFunctionPaginator +func NewListVersionsByFunctionPaginator(client ListVersionsByFunctionAPIClient, params *ListVersionsByFunctionInput, optFns ...func(*ListVersionsByFunctionPaginatorOptions)) *ListVersionsByFunctionPaginator { + options := ListVersionsByFunctionPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListVersionsByFunctionPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListVersionsByFunctionPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListVersionsByFunction page. +func (p *ListVersionsByFunctionPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListVersionsByFunctionOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxItems = p.options.Limit + result, err := p.client.ListVersionsByFunction(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListLayersAPIClient is a client that implements the ListLayers operation. +type ListLayersAPIClient interface { + ListLayers(context.Context, *ListLayersInput, ...func(*Options)) (*ListLayersOutput, error) +} + +var _ ListLayersAPIClient = (*Client)(nil) + +// ListLayersPaginatorOptions is the paginator options for ListLayers +type ListLayersPaginatorOptions struct { + // The maximum number of layers to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListLayersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/lambda.ListLayers +type ListLayersPaginator struct { + options ListLayersPaginatorOptions + client ListLayersAPIClient + params *ListLayersInput + nextToken *string + firstPage bool + done bool +} + +// NewListLayersPaginator returns a new ListLayersPaginator +func NewListLayersPaginator(client ListLayersAPIClient, params *ListLayersInput, optFns ...func(*ListLayersPaginatorOptions)) *ListLayersPaginator { + options := ListLayersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListLayersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListLayersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListLayers page. +func (p *ListLayersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListLayersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxItems = p.options.Limit + result, err := p.client.ListLayers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListProvisionedConcurrencyConfigsAPIClient is a client that implements the +// ListProvisionedConcurrencyConfigs operation. +type ListProvisionedConcurrencyConfigsAPIClient interface { + ListProvisionedConcurrencyConfigs(context.Context, *ListProvisionedConcurrencyConfigsInput, ...func(*Options)) (*ListProvisionedConcurrencyConfigsOutput, error) +} + +var _ ListProvisionedConcurrencyConfigsAPIClient = (*Client)(nil) + +// ListProvisionedConcurrencyConfigsPaginatorOptions is the paginator options for +// ListProvisionedConcurrencyConfigs +type ListProvisionedConcurrencyConfigsPaginatorOptions struct { + // Specify a number to limit the number of configurations returned. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListProvisionedConcurrencyConfigsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/lambda.ListProvisionedConcurrencyConfigs +type ListProvisionedConcurrencyConfigsPaginator struct { + options ListProvisionedConcurrencyConfigsPaginatorOptions + client ListProvisionedConcurrencyConfigsAPIClient + params *ListProvisionedConcurrencyConfigsInput + nextToken *string + firstPage bool + done bool +} + +// NewListProvisionedConcurrencyConfigsPaginator returns a new +// ListProvisionedConcurrencyConfigsPaginator +func NewListProvisionedConcurrencyConfigsPaginator(client ListProvisionedConcurrencyConfigsAPIClient, params *ListProvisionedConcurrencyConfigsInput, optFns ...func(*ListProvisionedConcurrencyConfigsPaginatorOptions)) *ListProvisionedConcurrencyConfigsPaginator { + options := ListProvisionedConcurrencyConfigsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListProvisionedConcurrencyConfigsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListProvisionedConcurrencyConfigsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListProvisionedConcurrencyConfigs page. +func (p *ListProvisionedConcurrencyConfigsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProvisionedConcurrencyConfigsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxItems = p.options.Limit + result, err := p.client.ListProvisionedConcurrencyConfigs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListFunctionEventInvokeConfigsAPIClient is a client that implements the +// ListFunctionEventInvokeConfigs operation. +type ListFunctionEventInvokeConfigsAPIClient interface { + ListFunctionEventInvokeConfigs(context.Context, *ListFunctionEventInvokeConfigsInput, ...func(*Options)) (*ListFunctionEventInvokeConfigsOutput, error) +} + +var _ ListFunctionEventInvokeConfigsAPIClient = (*Client)(nil) + +// ListFunctionEventInvokeConfigsPaginatorOptions is the paginator options for +// ListFunctionEventInvokeConfigs +type ListFunctionEventInvokeConfigsPaginatorOptions struct { + // The maximum number of configurations to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListFunctionEventInvokeConfigsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/lambda.ListFunctionEventInvokeConfigs +type ListFunctionEventInvokeConfigsPaginator struct { + options ListFunctionEventInvokeConfigsPaginatorOptions + client ListFunctionEventInvokeConfigsAPIClient + params *ListFunctionEventInvokeConfigsInput + nextToken *string + firstPage bool + done bool +} + +// NewListFunctionEventInvokeConfigsPaginator returns a new +// ListFunctionEventInvokeConfigsPaginator +func NewListFunctionEventInvokeConfigsPaginator(client ListFunctionEventInvokeConfigsAPIClient, params *ListFunctionEventInvokeConfigsInput, optFns ...func(*ListFunctionEventInvokeConfigsPaginatorOptions)) *ListFunctionEventInvokeConfigsPaginator { + options := ListFunctionEventInvokeConfigsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListFunctionEventInvokeConfigsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListFunctionEventInvokeConfigsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListFunctionEventInvokeConfigs page. +func (p *ListFunctionEventInvokeConfigsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFunctionEventInvokeConfigsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxItems = p.options.Limit + result, err := p.client.ListFunctionEventInvokeConfigs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListAliasesAPIClient is a client that implements the ListAliases operation. +type ListAliasesAPIClient interface { + ListAliases(context.Context, *ListAliasesInput, ...func(*Options)) (*ListAliasesOutput, error) +} + +var _ ListAliasesAPIClient = (*Client)(nil) + +// ListAliasesPaginatorOptions is the paginator options for ListAliases +type ListAliasesPaginatorOptions struct { + // Limit the number of aliases returned. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAliasesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/lambda.ListAliases +type ListAliasesPaginator struct { + options ListAliasesPaginatorOptions + client ListAliasesAPIClient + params *ListAliasesInput + nextToken *string + firstPage bool + done bool +} + +// NewListAliasesPaginator returns a new ListAliasesPaginator +func NewListAliasesPaginator(client ListAliasesAPIClient, params *ListAliasesInput, optFns ...func(*ListAliasesPaginatorOptions)) *ListAliasesPaginator { + options := ListAliasesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAliasesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAliasesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAliases page. +func (p *ListAliasesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAliasesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxItems = p.options.Limit + result, err := p.client.ListAliases(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/lexmodelbuildingservice/go.sum b/service/lexmodelbuildingservice/go.sum index c669e324b14..32595049f96 100644 --- a/service/lexmodelbuildingservice/go.sum +++ b/service/lexmodelbuildingservice/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/lexmodelbuildingservice/paginators.go b/service/lexmodelbuildingservice/paginators.go new file mode 100644 index 00000000000..116b6bda4ef --- /dev/null +++ b/service/lexmodelbuildingservice/paginators.go @@ -0,0 +1,761 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package lexmodelbuildingservice + +import ( + "context" + "fmt" +) + +// GetBotAliasesAPIClient is a client that implements the GetBotAliases operation. +type GetBotAliasesAPIClient interface { + GetBotAliases(context.Context, *GetBotAliasesInput, ...func(*Options)) (*GetBotAliasesOutput, error) +} + +var _ GetBotAliasesAPIClient = (*Client)(nil) + +// GetBotAliasesPaginatorOptions is the paginator options for GetBotAliases +type GetBotAliasesPaginatorOptions struct { + // The maximum number of aliases to return in the response. The default is 50. . + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetBotAliasesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/lexmodelbuildingservice.GetBotAliases +type GetBotAliasesPaginator struct { + options GetBotAliasesPaginatorOptions + client GetBotAliasesAPIClient + params *GetBotAliasesInput + nextToken *string + firstPage bool + done bool +} + +// NewGetBotAliasesPaginator returns a new GetBotAliasesPaginator +func NewGetBotAliasesPaginator(client GetBotAliasesAPIClient, params *GetBotAliasesInput, optFns ...func(*GetBotAliasesPaginatorOptions)) *GetBotAliasesPaginator { + options := GetBotAliasesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetBotAliasesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetBotAliasesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetBotAliases page. +func (p *GetBotAliasesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetBotAliasesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetBotAliases(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetBotChannelAssociationsAPIClient is a client that implements the +// GetBotChannelAssociations operation. +type GetBotChannelAssociationsAPIClient interface { + GetBotChannelAssociations(context.Context, *GetBotChannelAssociationsInput, ...func(*Options)) (*GetBotChannelAssociationsOutput, error) +} + +var _ GetBotChannelAssociationsAPIClient = (*Client)(nil) + +// GetBotChannelAssociationsPaginatorOptions is the paginator options for +// GetBotChannelAssociations +type GetBotChannelAssociationsPaginatorOptions struct { + // The maximum number of associations to return in the response. The default is 50. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetBotChannelAssociationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/lexmodelbuildingservice.GetBotChannelAssociations +type GetBotChannelAssociationsPaginator struct { + options GetBotChannelAssociationsPaginatorOptions + client GetBotChannelAssociationsAPIClient + params *GetBotChannelAssociationsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetBotChannelAssociationsPaginator returns a new +// GetBotChannelAssociationsPaginator +func NewGetBotChannelAssociationsPaginator(client GetBotChannelAssociationsAPIClient, params *GetBotChannelAssociationsInput, optFns ...func(*GetBotChannelAssociationsPaginatorOptions)) *GetBotChannelAssociationsPaginator { + options := GetBotChannelAssociationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetBotChannelAssociationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetBotChannelAssociationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetBotChannelAssociations page. +func (p *GetBotChannelAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetBotChannelAssociationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetBotChannelAssociations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetBuiltinIntentsAPIClient is a client that implements the GetBuiltinIntents +// operation. +type GetBuiltinIntentsAPIClient interface { + GetBuiltinIntents(context.Context, *GetBuiltinIntentsInput, ...func(*Options)) (*GetBuiltinIntentsOutput, error) +} + +var _ GetBuiltinIntentsAPIClient = (*Client)(nil) + +// GetBuiltinIntentsPaginatorOptions is the paginator options for GetBuiltinIntents +type GetBuiltinIntentsPaginatorOptions struct { + // The maximum number of intents to return in the response. The default is 10. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetBuiltinIntentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/lexmodelbuildingservice.GetBuiltinIntents +type GetBuiltinIntentsPaginator struct { + options GetBuiltinIntentsPaginatorOptions + client GetBuiltinIntentsAPIClient + params *GetBuiltinIntentsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetBuiltinIntentsPaginator returns a new GetBuiltinIntentsPaginator +func NewGetBuiltinIntentsPaginator(client GetBuiltinIntentsAPIClient, params *GetBuiltinIntentsInput, optFns ...func(*GetBuiltinIntentsPaginatorOptions)) *GetBuiltinIntentsPaginator { + options := GetBuiltinIntentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetBuiltinIntentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetBuiltinIntentsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetBuiltinIntents page. +func (p *GetBuiltinIntentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetBuiltinIntentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetBuiltinIntents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetSlotTypesAPIClient is a client that implements the GetSlotTypes operation. +type GetSlotTypesAPIClient interface { + GetSlotTypes(context.Context, *GetSlotTypesInput, ...func(*Options)) (*GetSlotTypesOutput, error) +} + +var _ GetSlotTypesAPIClient = (*Client)(nil) + +// GetSlotTypesPaginatorOptions is the paginator options for GetSlotTypes +type GetSlotTypesPaginatorOptions struct { + // The maximum number of slot types to return in the response. The default is 10. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetSlotTypesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/lexmodelbuildingservice.GetSlotTypes +type GetSlotTypesPaginator struct { + options GetSlotTypesPaginatorOptions + client GetSlotTypesAPIClient + params *GetSlotTypesInput + nextToken *string + firstPage bool + done bool +} + +// NewGetSlotTypesPaginator returns a new GetSlotTypesPaginator +func NewGetSlotTypesPaginator(client GetSlotTypesAPIClient, params *GetSlotTypesInput, optFns ...func(*GetSlotTypesPaginatorOptions)) *GetSlotTypesPaginator { + options := GetSlotTypesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetSlotTypesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetSlotTypesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetSlotTypes page. +func (p *GetSlotTypesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetSlotTypesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetSlotTypes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetBotsAPIClient is a client that implements the GetBots operation. +type GetBotsAPIClient interface { + GetBots(context.Context, *GetBotsInput, ...func(*Options)) (*GetBotsOutput, error) +} + +var _ GetBotsAPIClient = (*Client)(nil) + +// GetBotsPaginatorOptions is the paginator options for GetBots +type GetBotsPaginatorOptions struct { + // The maximum number of bots to return in the response that the request will + // return. The default is 10. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetBotsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/lexmodelbuildingservice.GetBots +type GetBotsPaginator struct { + options GetBotsPaginatorOptions + client GetBotsAPIClient + params *GetBotsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetBotsPaginator returns a new GetBotsPaginator +func NewGetBotsPaginator(client GetBotsAPIClient, params *GetBotsInput, optFns ...func(*GetBotsPaginatorOptions)) *GetBotsPaginator { + options := GetBotsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetBotsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetBotsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetBots page. +func (p *GetBotsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetBotsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetBots(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetBuiltinSlotTypesAPIClient is a client that implements the GetBuiltinSlotTypes +// operation. +type GetBuiltinSlotTypesAPIClient interface { + GetBuiltinSlotTypes(context.Context, *GetBuiltinSlotTypesInput, ...func(*Options)) (*GetBuiltinSlotTypesOutput, error) +} + +var _ GetBuiltinSlotTypesAPIClient = (*Client)(nil) + +// GetBuiltinSlotTypesPaginatorOptions is the paginator options for +// GetBuiltinSlotTypes +type GetBuiltinSlotTypesPaginatorOptions struct { + // The maximum number of slot types to return in the response. The default is 10. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetBuiltinSlotTypesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/lexmodelbuildingservice.GetBuiltinSlotTypes +type GetBuiltinSlotTypesPaginator struct { + options GetBuiltinSlotTypesPaginatorOptions + client GetBuiltinSlotTypesAPIClient + params *GetBuiltinSlotTypesInput + nextToken *string + firstPage bool + done bool +} + +// NewGetBuiltinSlotTypesPaginator returns a new GetBuiltinSlotTypesPaginator +func NewGetBuiltinSlotTypesPaginator(client GetBuiltinSlotTypesAPIClient, params *GetBuiltinSlotTypesInput, optFns ...func(*GetBuiltinSlotTypesPaginatorOptions)) *GetBuiltinSlotTypesPaginator { + options := GetBuiltinSlotTypesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetBuiltinSlotTypesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetBuiltinSlotTypesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetBuiltinSlotTypes page. +func (p *GetBuiltinSlotTypesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetBuiltinSlotTypesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetBuiltinSlotTypes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetSlotTypeVersionsAPIClient is a client that implements the GetSlotTypeVersions +// operation. +type GetSlotTypeVersionsAPIClient interface { + GetSlotTypeVersions(context.Context, *GetSlotTypeVersionsInput, ...func(*Options)) (*GetSlotTypeVersionsOutput, error) +} + +var _ GetSlotTypeVersionsAPIClient = (*Client)(nil) + +// GetSlotTypeVersionsPaginatorOptions is the paginator options for +// GetSlotTypeVersions +type GetSlotTypeVersionsPaginatorOptions struct { + // The maximum number of slot type versions to return in the response. The default + // is 10. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetSlotTypeVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/lexmodelbuildingservice.GetSlotTypeVersions +type GetSlotTypeVersionsPaginator struct { + options GetSlotTypeVersionsPaginatorOptions + client GetSlotTypeVersionsAPIClient + params *GetSlotTypeVersionsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetSlotTypeVersionsPaginator returns a new GetSlotTypeVersionsPaginator +func NewGetSlotTypeVersionsPaginator(client GetSlotTypeVersionsAPIClient, params *GetSlotTypeVersionsInput, optFns ...func(*GetSlotTypeVersionsPaginatorOptions)) *GetSlotTypeVersionsPaginator { + options := GetSlotTypeVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetSlotTypeVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetSlotTypeVersionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetSlotTypeVersions page. +func (p *GetSlotTypeVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetSlotTypeVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetSlotTypeVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetBotVersionsAPIClient is a client that implements the GetBotVersions +// operation. +type GetBotVersionsAPIClient interface { + GetBotVersions(context.Context, *GetBotVersionsInput, ...func(*Options)) (*GetBotVersionsOutput, error) +} + +var _ GetBotVersionsAPIClient = (*Client)(nil) + +// GetBotVersionsPaginatorOptions is the paginator options for GetBotVersions +type GetBotVersionsPaginatorOptions struct { + // The maximum number of bot versions to return in the response. The default is 10. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetBotVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/lexmodelbuildingservice.GetBotVersions +type GetBotVersionsPaginator struct { + options GetBotVersionsPaginatorOptions + client GetBotVersionsAPIClient + params *GetBotVersionsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetBotVersionsPaginator returns a new GetBotVersionsPaginator +func NewGetBotVersionsPaginator(client GetBotVersionsAPIClient, params *GetBotVersionsInput, optFns ...func(*GetBotVersionsPaginatorOptions)) *GetBotVersionsPaginator { + options := GetBotVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetBotVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetBotVersionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetBotVersions page. +func (p *GetBotVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetBotVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetBotVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetIntentsAPIClient is a client that implements the GetIntents operation. +type GetIntentsAPIClient interface { + GetIntents(context.Context, *GetIntentsInput, ...func(*Options)) (*GetIntentsOutput, error) +} + +var _ GetIntentsAPIClient = (*Client)(nil) + +// GetIntentsPaginatorOptions is the paginator options for GetIntents +type GetIntentsPaginatorOptions struct { + // The maximum number of intents to return in the response. The default is 10. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetIntentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/lexmodelbuildingservice.GetIntents +type GetIntentsPaginator struct { + options GetIntentsPaginatorOptions + client GetIntentsAPIClient + params *GetIntentsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetIntentsPaginator returns a new GetIntentsPaginator +func NewGetIntentsPaginator(client GetIntentsAPIClient, params *GetIntentsInput, optFns ...func(*GetIntentsPaginatorOptions)) *GetIntentsPaginator { + options := GetIntentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetIntentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetIntentsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetIntents page. +func (p *GetIntentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetIntentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetIntents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetIntentVersionsAPIClient is a client that implements the GetIntentVersions +// operation. +type GetIntentVersionsAPIClient interface { + GetIntentVersions(context.Context, *GetIntentVersionsInput, ...func(*Options)) (*GetIntentVersionsOutput, error) +} + +var _ GetIntentVersionsAPIClient = (*Client)(nil) + +// GetIntentVersionsPaginatorOptions is the paginator options for GetIntentVersions +type GetIntentVersionsPaginatorOptions struct { + // The maximum number of intent versions to return in the response. The default is + // 10. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetIntentVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/lexmodelbuildingservice.GetIntentVersions +type GetIntentVersionsPaginator struct { + options GetIntentVersionsPaginatorOptions + client GetIntentVersionsAPIClient + params *GetIntentVersionsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetIntentVersionsPaginator returns a new GetIntentVersionsPaginator +func NewGetIntentVersionsPaginator(client GetIntentVersionsAPIClient, params *GetIntentVersionsInput, optFns ...func(*GetIntentVersionsPaginatorOptions)) *GetIntentVersionsPaginator { + options := GetIntentVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetIntentVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetIntentVersionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetIntentVersions page. +func (p *GetIntentVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetIntentVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetIntentVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/lexruntimeservice/go.sum b/service/lexruntimeservice/go.sum index c669e324b14..32595049f96 100644 --- a/service/lexruntimeservice/go.sum +++ b/service/lexruntimeservice/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/licensemanager/go.sum b/service/licensemanager/go.sum index c669e324b14..32595049f96 100644 --- a/service/licensemanager/go.sum +++ b/service/licensemanager/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/lightsail/go.sum b/service/lightsail/go.sum index c669e324b14..32595049f96 100644 --- a/service/lightsail/go.sum +++ b/service/lightsail/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/machinelearning/go.sum b/service/machinelearning/go.sum index c669e324b14..32595049f96 100644 --- a/service/machinelearning/go.sum +++ b/service/machinelearning/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/machinelearning/paginators.go b/service/machinelearning/paginators.go new file mode 100644 index 00000000000..a58bc1ed43d --- /dev/null +++ b/service/machinelearning/paginators.go @@ -0,0 +1,314 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package machinelearning + +import ( + "context" + "fmt" +) + +// DescribeMLModelsAPIClient is a client that implements the DescribeMLModels +// operation. +type DescribeMLModelsAPIClient interface { + DescribeMLModels(context.Context, *DescribeMLModelsInput, ...func(*Options)) (*DescribeMLModelsOutput, error) +} + +var _ DescribeMLModelsAPIClient = (*Client)(nil) + +// DescribeMLModelsPaginatorOptions is the paginator options for DescribeMLModels +type DescribeMLModelsPaginatorOptions struct { + // The number of pages of information to include in the result. The range of + // acceptable values is 1 through 100. The default value is 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeMLModelsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/machinelearning.DescribeMLModels +type DescribeMLModelsPaginator struct { + options DescribeMLModelsPaginatorOptions + client DescribeMLModelsAPIClient + params *DescribeMLModelsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeMLModelsPaginator returns a new DescribeMLModelsPaginator +func NewDescribeMLModelsPaginator(client DescribeMLModelsAPIClient, params *DescribeMLModelsInput, optFns ...func(*DescribeMLModelsPaginatorOptions)) *DescribeMLModelsPaginator { + options := DescribeMLModelsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeMLModelsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeMLModelsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeMLModels page. +func (p *DescribeMLModelsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeMLModelsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.DescribeMLModels(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeDataSourcesAPIClient is a client that implements the DescribeDataSources +// operation. +type DescribeDataSourcesAPIClient interface { + DescribeDataSources(context.Context, *DescribeDataSourcesInput, ...func(*Options)) (*DescribeDataSourcesOutput, error) +} + +var _ DescribeDataSourcesAPIClient = (*Client)(nil) + +// DescribeDataSourcesPaginatorOptions is the paginator options for +// DescribeDataSources +type DescribeDataSourcesPaginatorOptions struct { + // The maximum number of DataSource to include in the result. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeDataSourcesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/machinelearning.DescribeDataSources +type DescribeDataSourcesPaginator struct { + options DescribeDataSourcesPaginatorOptions + client DescribeDataSourcesAPIClient + params *DescribeDataSourcesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeDataSourcesPaginator returns a new DescribeDataSourcesPaginator +func NewDescribeDataSourcesPaginator(client DescribeDataSourcesAPIClient, params *DescribeDataSourcesInput, optFns ...func(*DescribeDataSourcesPaginatorOptions)) *DescribeDataSourcesPaginator { + options := DescribeDataSourcesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeDataSourcesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDataSourcesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeDataSources page. +func (p *DescribeDataSourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDataSourcesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.DescribeDataSources(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeEvaluationsAPIClient is a client that implements the DescribeEvaluations +// operation. +type DescribeEvaluationsAPIClient interface { + DescribeEvaluations(context.Context, *DescribeEvaluationsInput, ...func(*Options)) (*DescribeEvaluationsOutput, error) +} + +var _ DescribeEvaluationsAPIClient = (*Client)(nil) + +// DescribeEvaluationsPaginatorOptions is the paginator options for +// DescribeEvaluations +type DescribeEvaluationsPaginatorOptions struct { + // The maximum number of Evaluation to include in the result. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeEvaluationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/machinelearning.DescribeEvaluations +type DescribeEvaluationsPaginator struct { + options DescribeEvaluationsPaginatorOptions + client DescribeEvaluationsAPIClient + params *DescribeEvaluationsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeEvaluationsPaginator returns a new DescribeEvaluationsPaginator +func NewDescribeEvaluationsPaginator(client DescribeEvaluationsAPIClient, params *DescribeEvaluationsInput, optFns ...func(*DescribeEvaluationsPaginatorOptions)) *DescribeEvaluationsPaginator { + options := DescribeEvaluationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeEvaluationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEvaluationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeEvaluations page. +func (p *DescribeEvaluationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEvaluationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.DescribeEvaluations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeBatchPredictionsAPIClient is a client that implements the +// DescribeBatchPredictions operation. +type DescribeBatchPredictionsAPIClient interface { + DescribeBatchPredictions(context.Context, *DescribeBatchPredictionsInput, ...func(*Options)) (*DescribeBatchPredictionsOutput, error) +} + +var _ DescribeBatchPredictionsAPIClient = (*Client)(nil) + +// DescribeBatchPredictionsPaginatorOptions is the paginator options for +// DescribeBatchPredictions +type DescribeBatchPredictionsPaginatorOptions struct { + // The number of pages of information to include in the result. The range of + // acceptable values is 1 through 100. The default value is 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeBatchPredictionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/machinelearning.DescribeBatchPredictions +type DescribeBatchPredictionsPaginator struct { + options DescribeBatchPredictionsPaginatorOptions + client DescribeBatchPredictionsAPIClient + params *DescribeBatchPredictionsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeBatchPredictionsPaginator returns a new +// DescribeBatchPredictionsPaginator +func NewDescribeBatchPredictionsPaginator(client DescribeBatchPredictionsAPIClient, params *DescribeBatchPredictionsInput, optFns ...func(*DescribeBatchPredictionsPaginatorOptions)) *DescribeBatchPredictionsPaginator { + options := DescribeBatchPredictionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeBatchPredictionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeBatchPredictionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeBatchPredictions page. +func (p *DescribeBatchPredictionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeBatchPredictionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.DescribeBatchPredictions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/macie/go.sum b/service/macie/go.sum index c669e324b14..32595049f96 100644 --- a/service/macie/go.sum +++ b/service/macie/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/macie/paginators.go b/service/macie/paginators.go new file mode 100644 index 00000000000..7ad8d8d3375 --- /dev/null +++ b/service/macie/paginators.go @@ -0,0 +1,161 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package macie + +import ( + "context" + "fmt" +) + +// ListMemberAccountsAPIClient is a client that implements the ListMemberAccounts +// operation. +type ListMemberAccountsAPIClient interface { + ListMemberAccounts(context.Context, *ListMemberAccountsInput, ...func(*Options)) (*ListMemberAccountsOutput, error) +} + +var _ ListMemberAccountsAPIClient = (*Client)(nil) + +// ListMemberAccountsPaginatorOptions is the paginator options for +// ListMemberAccounts +type ListMemberAccountsPaginatorOptions struct { + // Use this parameter to indicate the maximum number of items that you want in the + // response. The default value is 250. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListMemberAccountsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/macie.ListMemberAccounts +type ListMemberAccountsPaginator struct { + options ListMemberAccountsPaginatorOptions + client ListMemberAccountsAPIClient + params *ListMemberAccountsInput + nextToken *string + firstPage bool + done bool +} + +// NewListMemberAccountsPaginator returns a new ListMemberAccountsPaginator +func NewListMemberAccountsPaginator(client ListMemberAccountsAPIClient, params *ListMemberAccountsInput, optFns ...func(*ListMemberAccountsPaginatorOptions)) *ListMemberAccountsPaginator { + options := ListMemberAccountsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListMemberAccountsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMemberAccountsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListMemberAccounts page. +func (p *ListMemberAccountsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMemberAccountsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListMemberAccounts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListS3ResourcesAPIClient is a client that implements the ListS3Resources +// operation. +type ListS3ResourcesAPIClient interface { + ListS3Resources(context.Context, *ListS3ResourcesInput, ...func(*Options)) (*ListS3ResourcesOutput, error) +} + +var _ ListS3ResourcesAPIClient = (*Client)(nil) + +// ListS3ResourcesPaginatorOptions is the paginator options for ListS3Resources +type ListS3ResourcesPaginatorOptions struct { + // Use this parameter to indicate the maximum number of items that you want in the + // response. The default value is 250. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListS3ResourcesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/macie.ListS3Resources +type ListS3ResourcesPaginator struct { + options ListS3ResourcesPaginatorOptions + client ListS3ResourcesAPIClient + params *ListS3ResourcesInput + nextToken *string + firstPage bool + done bool +} + +// NewListS3ResourcesPaginator returns a new ListS3ResourcesPaginator +func NewListS3ResourcesPaginator(client ListS3ResourcesAPIClient, params *ListS3ResourcesInput, optFns ...func(*ListS3ResourcesPaginatorOptions)) *ListS3ResourcesPaginator { + options := ListS3ResourcesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListS3ResourcesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListS3ResourcesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListS3Resources page. +func (p *ListS3ResourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListS3ResourcesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListS3Resources(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/macie2/go.sum b/service/macie2/go.sum index c669e324b14..32595049f96 100644 --- a/service/macie2/go.sum +++ b/service/macie2/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/macie2/paginators.go b/service/macie2/paginators.go new file mode 100644 index 00000000000..9bf9cf55f3b --- /dev/null +++ b/service/macie2/paginators.go @@ -0,0 +1,689 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package macie2 + +import ( + "context" + "fmt" +) + +// ListInvitationsAPIClient is a client that implements the ListInvitations +// operation. +type ListInvitationsAPIClient interface { + ListInvitations(context.Context, *ListInvitationsInput, ...func(*Options)) (*ListInvitationsOutput, error) +} + +var _ ListInvitationsAPIClient = (*Client)(nil) + +// ListInvitationsPaginatorOptions is the paginator options for ListInvitations +type ListInvitationsPaginatorOptions struct { + // The maximum number of items to include in each page of a paginated response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListInvitationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/macie2.ListInvitations +type ListInvitationsPaginator struct { + options ListInvitationsPaginatorOptions + client ListInvitationsAPIClient + params *ListInvitationsInput + nextToken *string + firstPage bool + done bool +} + +// NewListInvitationsPaginator returns a new ListInvitationsPaginator +func NewListInvitationsPaginator(client ListInvitationsAPIClient, params *ListInvitationsInput, optFns ...func(*ListInvitationsPaginatorOptions)) *ListInvitationsPaginator { + options := ListInvitationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListInvitationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListInvitationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListInvitations page. +func (p *ListInvitationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListInvitationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListInvitations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListMembersAPIClient is a client that implements the ListMembers operation. +type ListMembersAPIClient interface { + ListMembers(context.Context, *ListMembersInput, ...func(*Options)) (*ListMembersOutput, error) +} + +var _ ListMembersAPIClient = (*Client)(nil) + +// ListMembersPaginatorOptions is the paginator options for ListMembers +type ListMembersPaginatorOptions struct { + // The maximum number of items to include in each page of a paginated response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListMembersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/macie2.ListMembers +type ListMembersPaginator struct { + options ListMembersPaginatorOptions + client ListMembersAPIClient + params *ListMembersInput + nextToken *string + firstPage bool + done bool +} + +// NewListMembersPaginator returns a new ListMembersPaginator +func NewListMembersPaginator(client ListMembersAPIClient, params *ListMembersInput, optFns ...func(*ListMembersPaginatorOptions)) *ListMembersPaginator { + options := ListMembersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListMembersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMembersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListMembers page. +func (p *ListMembersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMembersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListMembers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetUsageStatisticsAPIClient is a client that implements the GetUsageStatistics +// operation. +type GetUsageStatisticsAPIClient interface { + GetUsageStatistics(context.Context, *GetUsageStatisticsInput, ...func(*Options)) (*GetUsageStatisticsOutput, error) +} + +var _ GetUsageStatisticsAPIClient = (*Client)(nil) + +// GetUsageStatisticsPaginatorOptions is the paginator options for +// GetUsageStatistics +type GetUsageStatisticsPaginatorOptions struct { + // The maximum number of items to include in each page of the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetUsageStatisticsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/macie2.GetUsageStatistics +type GetUsageStatisticsPaginator struct { + options GetUsageStatisticsPaginatorOptions + client GetUsageStatisticsAPIClient + params *GetUsageStatisticsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetUsageStatisticsPaginator returns a new GetUsageStatisticsPaginator +func NewGetUsageStatisticsPaginator(client GetUsageStatisticsAPIClient, params *GetUsageStatisticsInput, optFns ...func(*GetUsageStatisticsPaginatorOptions)) *GetUsageStatisticsPaginator { + options := GetUsageStatisticsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetUsageStatisticsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetUsageStatisticsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetUsageStatistics page. +func (p *GetUsageStatisticsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetUsageStatisticsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetUsageStatistics(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListFindingsFiltersAPIClient is a client that implements the ListFindingsFilters +// operation. +type ListFindingsFiltersAPIClient interface { + ListFindingsFilters(context.Context, *ListFindingsFiltersInput, ...func(*Options)) (*ListFindingsFiltersOutput, error) +} + +var _ ListFindingsFiltersAPIClient = (*Client)(nil) + +// ListFindingsFiltersPaginatorOptions is the paginator options for +// ListFindingsFilters +type ListFindingsFiltersPaginatorOptions struct { + // The maximum number of items to include in each page of a paginated response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListFindingsFiltersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/macie2.ListFindingsFilters +type ListFindingsFiltersPaginator struct { + options ListFindingsFiltersPaginatorOptions + client ListFindingsFiltersAPIClient + params *ListFindingsFiltersInput + nextToken *string + firstPage bool + done bool +} + +// NewListFindingsFiltersPaginator returns a new ListFindingsFiltersPaginator +func NewListFindingsFiltersPaginator(client ListFindingsFiltersAPIClient, params *ListFindingsFiltersInput, optFns ...func(*ListFindingsFiltersPaginatorOptions)) *ListFindingsFiltersPaginator { + options := ListFindingsFiltersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListFindingsFiltersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListFindingsFiltersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListFindingsFilters page. +func (p *ListFindingsFiltersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFindingsFiltersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListFindingsFilters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListFindingsAPIClient is a client that implements the ListFindings operation. +type ListFindingsAPIClient interface { + ListFindings(context.Context, *ListFindingsInput, ...func(*Options)) (*ListFindingsOutput, error) +} + +var _ ListFindingsAPIClient = (*Client)(nil) + +// ListFindingsPaginatorOptions is the paginator options for ListFindings +type ListFindingsPaginatorOptions struct { + // The maximum number of items to include in each page of the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListFindingsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/macie2.ListFindings +type ListFindingsPaginator struct { + options ListFindingsPaginatorOptions + client ListFindingsAPIClient + params *ListFindingsInput + nextToken *string + firstPage bool + done bool +} + +// NewListFindingsPaginator returns a new ListFindingsPaginator +func NewListFindingsPaginator(client ListFindingsAPIClient, params *ListFindingsInput, optFns ...func(*ListFindingsPaginatorOptions)) *ListFindingsPaginator { + options := ListFindingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListFindingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListFindingsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListFindings page. +func (p *ListFindingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFindingsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListFindings(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListCustomDataIdentifiersAPIClient is a client that implements the +// ListCustomDataIdentifiers operation. +type ListCustomDataIdentifiersAPIClient interface { + ListCustomDataIdentifiers(context.Context, *ListCustomDataIdentifiersInput, ...func(*Options)) (*ListCustomDataIdentifiersOutput, error) +} + +var _ ListCustomDataIdentifiersAPIClient = (*Client)(nil) + +// ListCustomDataIdentifiersPaginatorOptions is the paginator options for +// ListCustomDataIdentifiers +type ListCustomDataIdentifiersPaginatorOptions struct { + // The maximum number of items to include in each page of the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListCustomDataIdentifiersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/macie2.ListCustomDataIdentifiers +type ListCustomDataIdentifiersPaginator struct { + options ListCustomDataIdentifiersPaginatorOptions + client ListCustomDataIdentifiersAPIClient + params *ListCustomDataIdentifiersInput + nextToken *string + firstPage bool + done bool +} + +// NewListCustomDataIdentifiersPaginator returns a new +// ListCustomDataIdentifiersPaginator +func NewListCustomDataIdentifiersPaginator(client ListCustomDataIdentifiersAPIClient, params *ListCustomDataIdentifiersInput, optFns ...func(*ListCustomDataIdentifiersPaginatorOptions)) *ListCustomDataIdentifiersPaginator { + options := ListCustomDataIdentifiersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListCustomDataIdentifiersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCustomDataIdentifiersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListCustomDataIdentifiers page. +func (p *ListCustomDataIdentifiersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCustomDataIdentifiersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListCustomDataIdentifiers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListOrganizationAdminAccountsAPIClient is a client that implements the +// ListOrganizationAdminAccounts operation. +type ListOrganizationAdminAccountsAPIClient interface { + ListOrganizationAdminAccounts(context.Context, *ListOrganizationAdminAccountsInput, ...func(*Options)) (*ListOrganizationAdminAccountsOutput, error) +} + +var _ ListOrganizationAdminAccountsAPIClient = (*Client)(nil) + +// ListOrganizationAdminAccountsPaginatorOptions is the paginator options for +// ListOrganizationAdminAccounts +type ListOrganizationAdminAccountsPaginatorOptions struct { + // The maximum number of items to include in each page of a paginated response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListOrganizationAdminAccountsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/macie2.ListOrganizationAdminAccounts +type ListOrganizationAdminAccountsPaginator struct { + options ListOrganizationAdminAccountsPaginatorOptions + client ListOrganizationAdminAccountsAPIClient + params *ListOrganizationAdminAccountsInput + nextToken *string + firstPage bool + done bool +} + +// NewListOrganizationAdminAccountsPaginator returns a new +// ListOrganizationAdminAccountsPaginator +func NewListOrganizationAdminAccountsPaginator(client ListOrganizationAdminAccountsAPIClient, params *ListOrganizationAdminAccountsInput, optFns ...func(*ListOrganizationAdminAccountsPaginatorOptions)) *ListOrganizationAdminAccountsPaginator { + options := ListOrganizationAdminAccountsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListOrganizationAdminAccountsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListOrganizationAdminAccountsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListOrganizationAdminAccounts page. +func (p *ListOrganizationAdminAccountsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListOrganizationAdminAccountsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListOrganizationAdminAccounts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListClassificationJobsAPIClient is a client that implements the +// ListClassificationJobs operation. +type ListClassificationJobsAPIClient interface { + ListClassificationJobs(context.Context, *ListClassificationJobsInput, ...func(*Options)) (*ListClassificationJobsOutput, error) +} + +var _ ListClassificationJobsAPIClient = (*Client)(nil) + +// ListClassificationJobsPaginatorOptions is the paginator options for +// ListClassificationJobs +type ListClassificationJobsPaginatorOptions struct { + // The maximum number of items to include in each page of the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListClassificationJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/macie2.ListClassificationJobs +type ListClassificationJobsPaginator struct { + options ListClassificationJobsPaginatorOptions + client ListClassificationJobsAPIClient + params *ListClassificationJobsInput + nextToken *string + firstPage bool + done bool +} + +// NewListClassificationJobsPaginator returns a new ListClassificationJobsPaginator +func NewListClassificationJobsPaginator(client ListClassificationJobsAPIClient, params *ListClassificationJobsInput, optFns ...func(*ListClassificationJobsPaginatorOptions)) *ListClassificationJobsPaginator { + options := ListClassificationJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListClassificationJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListClassificationJobsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListClassificationJobs page. +func (p *ListClassificationJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListClassificationJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListClassificationJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeBucketsAPIClient is a client that implements the DescribeBuckets +// operation. +type DescribeBucketsAPIClient interface { + DescribeBuckets(context.Context, *DescribeBucketsInput, ...func(*Options)) (*DescribeBucketsOutput, error) +} + +var _ DescribeBucketsAPIClient = (*Client)(nil) + +// DescribeBucketsPaginatorOptions is the paginator options for DescribeBuckets +type DescribeBucketsPaginatorOptions struct { + // The maximum number of items to include in each page of the response. The default + // value is 50. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeBucketsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/macie2.DescribeBuckets +type DescribeBucketsPaginator struct { + options DescribeBucketsPaginatorOptions + client DescribeBucketsAPIClient + params *DescribeBucketsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeBucketsPaginator returns a new DescribeBucketsPaginator +func NewDescribeBucketsPaginator(client DescribeBucketsAPIClient, params *DescribeBucketsInput, optFns ...func(*DescribeBucketsPaginatorOptions)) *DescribeBucketsPaginator { + options := DescribeBucketsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeBucketsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeBucketsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeBuckets page. +func (p *DescribeBucketsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeBucketsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeBuckets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/managedblockchain/go.sum b/service/managedblockchain/go.sum index c669e324b14..32595049f96 100644 --- a/service/managedblockchain/go.sum +++ b/service/managedblockchain/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/managedblockchain/paginators.go b/service/managedblockchain/paginators.go new file mode 100644 index 00000000000..f5af00a053d --- /dev/null +++ b/service/managedblockchain/paginators.go @@ -0,0 +1,454 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package managedblockchain + +import ( + "context" + "fmt" +) + +// ListProposalVotesAPIClient is a client that implements the ListProposalVotes +// operation. +type ListProposalVotesAPIClient interface { + ListProposalVotes(context.Context, *ListProposalVotesInput, ...func(*Options)) (*ListProposalVotesOutput, error) +} + +var _ ListProposalVotesAPIClient = (*Client)(nil) + +// ListProposalVotesPaginatorOptions is the paginator options for ListProposalVotes +type ListProposalVotesPaginatorOptions struct { + // The maximum number of votes to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListProposalVotesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/managedblockchain.ListProposalVotes +type ListProposalVotesPaginator struct { + options ListProposalVotesPaginatorOptions + client ListProposalVotesAPIClient + params *ListProposalVotesInput + nextToken *string + firstPage bool + done bool +} + +// NewListProposalVotesPaginator returns a new ListProposalVotesPaginator +func NewListProposalVotesPaginator(client ListProposalVotesAPIClient, params *ListProposalVotesInput, optFns ...func(*ListProposalVotesPaginatorOptions)) *ListProposalVotesPaginator { + options := ListProposalVotesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListProposalVotesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListProposalVotesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListProposalVotes page. +func (p *ListProposalVotesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProposalVotesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListProposalVotes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListNodesAPIClient is a client that implements the ListNodes operation. +type ListNodesAPIClient interface { + ListNodes(context.Context, *ListNodesInput, ...func(*Options)) (*ListNodesOutput, error) +} + +var _ ListNodesAPIClient = (*Client)(nil) + +// ListNodesPaginatorOptions is the paginator options for ListNodes +type ListNodesPaginatorOptions struct { + // The maximum number of nodes to list. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListNodesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/managedblockchain.ListNodes +type ListNodesPaginator struct { + options ListNodesPaginatorOptions + client ListNodesAPIClient + params *ListNodesInput + nextToken *string + firstPage bool + done bool +} + +// NewListNodesPaginator returns a new ListNodesPaginator +func NewListNodesPaginator(client ListNodesAPIClient, params *ListNodesInput, optFns ...func(*ListNodesPaginatorOptions)) *ListNodesPaginator { + options := ListNodesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListNodesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListNodesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListNodes page. +func (p *ListNodesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListNodesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListNodes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListInvitationsAPIClient is a client that implements the ListInvitations +// operation. +type ListInvitationsAPIClient interface { + ListInvitations(context.Context, *ListInvitationsInput, ...func(*Options)) (*ListInvitationsOutput, error) +} + +var _ ListInvitationsAPIClient = (*Client)(nil) + +// ListInvitationsPaginatorOptions is the paginator options for ListInvitations +type ListInvitationsPaginatorOptions struct { + // The maximum number of invitations to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListInvitationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/managedblockchain.ListInvitations +type ListInvitationsPaginator struct { + options ListInvitationsPaginatorOptions + client ListInvitationsAPIClient + params *ListInvitationsInput + nextToken *string + firstPage bool + done bool +} + +// NewListInvitationsPaginator returns a new ListInvitationsPaginator +func NewListInvitationsPaginator(client ListInvitationsAPIClient, params *ListInvitationsInput, optFns ...func(*ListInvitationsPaginatorOptions)) *ListInvitationsPaginator { + options := ListInvitationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListInvitationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListInvitationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListInvitations page. +func (p *ListInvitationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListInvitationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListInvitations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListMembersAPIClient is a client that implements the ListMembers operation. +type ListMembersAPIClient interface { + ListMembers(context.Context, *ListMembersInput, ...func(*Options)) (*ListMembersOutput, error) +} + +var _ ListMembersAPIClient = (*Client)(nil) + +// ListMembersPaginatorOptions is the paginator options for ListMembers +type ListMembersPaginatorOptions struct { + // The maximum number of members to return in the request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListMembersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/managedblockchain.ListMembers +type ListMembersPaginator struct { + options ListMembersPaginatorOptions + client ListMembersAPIClient + params *ListMembersInput + nextToken *string + firstPage bool + done bool +} + +// NewListMembersPaginator returns a new ListMembersPaginator +func NewListMembersPaginator(client ListMembersAPIClient, params *ListMembersInput, optFns ...func(*ListMembersPaginatorOptions)) *ListMembersPaginator { + options := ListMembersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListMembersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMembersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListMembers page. +func (p *ListMembersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMembersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListMembers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListNetworksAPIClient is a client that implements the ListNetworks operation. +type ListNetworksAPIClient interface { + ListNetworks(context.Context, *ListNetworksInput, ...func(*Options)) (*ListNetworksOutput, error) +} + +var _ ListNetworksAPIClient = (*Client)(nil) + +// ListNetworksPaginatorOptions is the paginator options for ListNetworks +type ListNetworksPaginatorOptions struct { + // The maximum number of networks to list. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListNetworksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/managedblockchain.ListNetworks +type ListNetworksPaginator struct { + options ListNetworksPaginatorOptions + client ListNetworksAPIClient + params *ListNetworksInput + nextToken *string + firstPage bool + done bool +} + +// NewListNetworksPaginator returns a new ListNetworksPaginator +func NewListNetworksPaginator(client ListNetworksAPIClient, params *ListNetworksInput, optFns ...func(*ListNetworksPaginatorOptions)) *ListNetworksPaginator { + options := ListNetworksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListNetworksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListNetworksPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListNetworks page. +func (p *ListNetworksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListNetworksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListNetworks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListProposalsAPIClient is a client that implements the ListProposals operation. +type ListProposalsAPIClient interface { + ListProposals(context.Context, *ListProposalsInput, ...func(*Options)) (*ListProposalsOutput, error) +} + +var _ ListProposalsAPIClient = (*Client)(nil) + +// ListProposalsPaginatorOptions is the paginator options for ListProposals +type ListProposalsPaginatorOptions struct { + // The maximum number of proposals to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListProposalsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/managedblockchain.ListProposals +type ListProposalsPaginator struct { + options ListProposalsPaginatorOptions + client ListProposalsAPIClient + params *ListProposalsInput + nextToken *string + firstPage bool + done bool +} + +// NewListProposalsPaginator returns a new ListProposalsPaginator +func NewListProposalsPaginator(client ListProposalsAPIClient, params *ListProposalsInput, optFns ...func(*ListProposalsPaginatorOptions)) *ListProposalsPaginator { + options := ListProposalsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListProposalsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListProposalsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListProposals page. +func (p *ListProposalsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProposalsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListProposals(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/marketplacecatalog/go.sum b/service/marketplacecatalog/go.sum index c669e324b14..32595049f96 100644 --- a/service/marketplacecatalog/go.sum +++ b/service/marketplacecatalog/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/marketplacecatalog/paginators.go b/service/marketplacecatalog/paginators.go new file mode 100644 index 00000000000..9c9400e032c --- /dev/null +++ b/service/marketplacecatalog/paginators.go @@ -0,0 +1,160 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package marketplacecatalog + +import ( + "context" + "fmt" +) + +// ListChangeSetsAPIClient is a client that implements the ListChangeSets +// operation. +type ListChangeSetsAPIClient interface { + ListChangeSets(context.Context, *ListChangeSetsInput, ...func(*Options)) (*ListChangeSetsOutput, error) +} + +var _ ListChangeSetsAPIClient = (*Client)(nil) + +// ListChangeSetsPaginatorOptions is the paginator options for ListChangeSets +type ListChangeSetsPaginatorOptions struct { + // The maximum number of results returned by a single call. This value must be + // provided in the next call to retrieve the next set of results. By default, this + // value is 20. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListChangeSetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/marketplacecatalog.ListChangeSets +type ListChangeSetsPaginator struct { + options ListChangeSetsPaginatorOptions + client ListChangeSetsAPIClient + params *ListChangeSetsInput + nextToken *string + firstPage bool + done bool +} + +// NewListChangeSetsPaginator returns a new ListChangeSetsPaginator +func NewListChangeSetsPaginator(client ListChangeSetsAPIClient, params *ListChangeSetsInput, optFns ...func(*ListChangeSetsPaginatorOptions)) *ListChangeSetsPaginator { + options := ListChangeSetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListChangeSetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListChangeSetsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListChangeSets page. +func (p *ListChangeSetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListChangeSetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListChangeSets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListEntitiesAPIClient is a client that implements the ListEntities operation. +type ListEntitiesAPIClient interface { + ListEntities(context.Context, *ListEntitiesInput, ...func(*Options)) (*ListEntitiesOutput, error) +} + +var _ ListEntitiesAPIClient = (*Client)(nil) + +// ListEntitiesPaginatorOptions is the paginator options for ListEntities +type ListEntitiesPaginatorOptions struct { + // Specifies the upper limit of the elements on a single page. If a value isn't + // provided, the default value is 20. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListEntitiesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/marketplacecatalog.ListEntities +type ListEntitiesPaginator struct { + options ListEntitiesPaginatorOptions + client ListEntitiesAPIClient + params *ListEntitiesInput + nextToken *string + firstPage bool + done bool +} + +// NewListEntitiesPaginator returns a new ListEntitiesPaginator +func NewListEntitiesPaginator(client ListEntitiesAPIClient, params *ListEntitiesInput, optFns ...func(*ListEntitiesPaginatorOptions)) *ListEntitiesPaginator { + options := ListEntitiesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListEntitiesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListEntitiesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListEntities page. +func (p *ListEntitiesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEntitiesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListEntities(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/marketplacecommerceanalytics/go.sum b/service/marketplacecommerceanalytics/go.sum index c669e324b14..32595049f96 100644 --- a/service/marketplacecommerceanalytics/go.sum +++ b/service/marketplacecommerceanalytics/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/marketplaceentitlementservice/go.sum b/service/marketplaceentitlementservice/go.sum index c669e324b14..32595049f96 100644 --- a/service/marketplaceentitlementservice/go.sum +++ b/service/marketplaceentitlementservice/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/marketplacemetering/go.sum b/service/marketplacemetering/go.sum index c669e324b14..32595049f96 100644 --- a/service/marketplacemetering/go.sum +++ b/service/marketplacemetering/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/mediaconnect/go.sum b/service/mediaconnect/go.sum index c669e324b14..32595049f96 100644 --- a/service/mediaconnect/go.sum +++ b/service/mediaconnect/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/mediaconnect/paginators.go b/service/mediaconnect/paginators.go new file mode 100644 index 00000000000..e2ebce3f3fe --- /dev/null +++ b/service/mediaconnect/paginators.go @@ -0,0 +1,330 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package mediaconnect + +import ( + "context" + "fmt" +) + +// ListOfferingsAPIClient is a client that implements the ListOfferings operation. +type ListOfferingsAPIClient interface { + ListOfferings(context.Context, *ListOfferingsInput, ...func(*Options)) (*ListOfferingsOutput, error) +} + +var _ ListOfferingsAPIClient = (*Client)(nil) + +// ListOfferingsPaginatorOptions is the paginator options for ListOfferings +type ListOfferingsPaginatorOptions struct { + // The maximum number of results to return per API request. For example, you submit + // a ListOfferings request with MaxResults set at 5. Although 20 items match your + // request, the service returns no more than the first 5 items. (The service also + // returns a NextToken value that you can use to fetch the next batch of results.) + // The service might return fewer results than the MaxResults value. If MaxResults + // is not included in the request, the service defaults to pagination with a + // maximum of 10 results per page. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListOfferingsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mediaconnect.ListOfferings +type ListOfferingsPaginator struct { + options ListOfferingsPaginatorOptions + client ListOfferingsAPIClient + params *ListOfferingsInput + nextToken *string + firstPage bool + done bool +} + +// NewListOfferingsPaginator returns a new ListOfferingsPaginator +func NewListOfferingsPaginator(client ListOfferingsAPIClient, params *ListOfferingsInput, optFns ...func(*ListOfferingsPaginatorOptions)) *ListOfferingsPaginator { + options := ListOfferingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListOfferingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListOfferingsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListOfferings page. +func (p *ListOfferingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListOfferingsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListOfferings(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListReservationsAPIClient is a client that implements the ListReservations +// operation. +type ListReservationsAPIClient interface { + ListReservations(context.Context, *ListReservationsInput, ...func(*Options)) (*ListReservationsOutput, error) +} + +var _ ListReservationsAPIClient = (*Client)(nil) + +// ListReservationsPaginatorOptions is the paginator options for ListReservations +type ListReservationsPaginatorOptions struct { + // The maximum number of results to return per API request. For example, you submit + // a ListReservations request with MaxResults set at 5. Although 20 items match + // your request, the service returns no more than the first 5 items. (The service + // also returns a NextToken value that you can use to fetch the next batch of + // results.) The service might return fewer results than the MaxResults value. If + // MaxResults is not included in the request, the service defaults to pagination + // with a maximum of 10 results per page. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListReservationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mediaconnect.ListReservations +type ListReservationsPaginator struct { + options ListReservationsPaginatorOptions + client ListReservationsAPIClient + params *ListReservationsInput + nextToken *string + firstPage bool + done bool +} + +// NewListReservationsPaginator returns a new ListReservationsPaginator +func NewListReservationsPaginator(client ListReservationsAPIClient, params *ListReservationsInput, optFns ...func(*ListReservationsPaginatorOptions)) *ListReservationsPaginator { + options := ListReservationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListReservationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListReservationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListReservations page. +func (p *ListReservationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListReservationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListReservations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListFlowsAPIClient is a client that implements the ListFlows operation. +type ListFlowsAPIClient interface { + ListFlows(context.Context, *ListFlowsInput, ...func(*Options)) (*ListFlowsOutput, error) +} + +var _ ListFlowsAPIClient = (*Client)(nil) + +// ListFlowsPaginatorOptions is the paginator options for ListFlows +type ListFlowsPaginatorOptions struct { + // The maximum number of results to return per API request. For example, you submit + // a ListFlows request with MaxResults set at 5. Although 20 items match your + // request, the service returns no more than the first 5 items. (The service also + // returns a NextToken value that you can use to fetch the next batch of results.) + // The service might return fewer results than the MaxResults value. If MaxResults + // is not included in the request, the service defaults to pagination with a + // maximum of 10 results per page. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListFlowsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mediaconnect.ListFlows +type ListFlowsPaginator struct { + options ListFlowsPaginatorOptions + client ListFlowsAPIClient + params *ListFlowsInput + nextToken *string + firstPage bool + done bool +} + +// NewListFlowsPaginator returns a new ListFlowsPaginator +func NewListFlowsPaginator(client ListFlowsAPIClient, params *ListFlowsInput, optFns ...func(*ListFlowsPaginatorOptions)) *ListFlowsPaginator { + options := ListFlowsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListFlowsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListFlowsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListFlows page. +func (p *ListFlowsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFlowsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListFlows(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListEntitlementsAPIClient is a client that implements the ListEntitlements +// operation. +type ListEntitlementsAPIClient interface { + ListEntitlements(context.Context, *ListEntitlementsInput, ...func(*Options)) (*ListEntitlementsOutput, error) +} + +var _ ListEntitlementsAPIClient = (*Client)(nil) + +// ListEntitlementsPaginatorOptions is the paginator options for ListEntitlements +type ListEntitlementsPaginatorOptions struct { + // The maximum number of results to return per API request. For example, you submit + // a ListEntitlements request with MaxResults set at 5. Although 20 items match + // your request, the service returns no more than the first 5 items. (The service + // also returns a NextToken value that you can use to fetch the next batch of + // results.) The service might return fewer results than the MaxResults value. If + // MaxResults is not included in the request, the service defaults to pagination + // with a maximum of 20 results per page. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListEntitlementsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mediaconnect.ListEntitlements +type ListEntitlementsPaginator struct { + options ListEntitlementsPaginatorOptions + client ListEntitlementsAPIClient + params *ListEntitlementsInput + nextToken *string + firstPage bool + done bool +} + +// NewListEntitlementsPaginator returns a new ListEntitlementsPaginator +func NewListEntitlementsPaginator(client ListEntitlementsAPIClient, params *ListEntitlementsInput, optFns ...func(*ListEntitlementsPaginatorOptions)) *ListEntitlementsPaginator { + options := ListEntitlementsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListEntitlementsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListEntitlementsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListEntitlements page. +func (p *ListEntitlementsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEntitlementsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListEntitlements(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/mediaconvert/go.sum b/service/mediaconvert/go.sum index c669e324b14..32595049f96 100644 --- a/service/mediaconvert/go.sum +++ b/service/mediaconvert/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/mediaconvert/paginators.go b/service/mediaconvert/paginators.go new file mode 100644 index 00000000000..d9d17d1bc52 --- /dev/null +++ b/service/mediaconvert/paginators.go @@ -0,0 +1,382 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package mediaconvert + +import ( + "context" + "fmt" +) + +// ListJobsAPIClient is a client that implements the ListJobs operation. +type ListJobsAPIClient interface { + ListJobs(context.Context, *ListJobsInput, ...func(*Options)) (*ListJobsOutput, error) +} + +var _ ListJobsAPIClient = (*Client)(nil) + +// ListJobsPaginatorOptions is the paginator options for ListJobs +type ListJobsPaginatorOptions struct { + // Optional. Number of jobs, up to twenty, that will be returned at one time. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mediaconvert.ListJobs +type ListJobsPaginator struct { + options ListJobsPaginatorOptions + client ListJobsAPIClient + params *ListJobsInput + nextToken *string + firstPage bool + done bool +} + +// NewListJobsPaginator returns a new ListJobsPaginator +func NewListJobsPaginator(client ListJobsAPIClient, params *ListJobsInput, optFns ...func(*ListJobsPaginatorOptions)) *ListJobsPaginator { + options := ListJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListJobsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListJobs page. +func (p *ListJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListQueuesAPIClient is a client that implements the ListQueues operation. +type ListQueuesAPIClient interface { + ListQueues(context.Context, *ListQueuesInput, ...func(*Options)) (*ListQueuesOutput, error) +} + +var _ ListQueuesAPIClient = (*Client)(nil) + +// ListQueuesPaginatorOptions is the paginator options for ListQueues +type ListQueuesPaginatorOptions struct { + // Optional. Number of queues, up to twenty, that will be returned at one time. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListQueuesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mediaconvert.ListQueues +type ListQueuesPaginator struct { + options ListQueuesPaginatorOptions + client ListQueuesAPIClient + params *ListQueuesInput + nextToken *string + firstPage bool + done bool +} + +// NewListQueuesPaginator returns a new ListQueuesPaginator +func NewListQueuesPaginator(client ListQueuesAPIClient, params *ListQueuesInput, optFns ...func(*ListQueuesPaginatorOptions)) *ListQueuesPaginator { + options := ListQueuesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListQueuesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListQueuesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListQueues page. +func (p *ListQueuesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListQueuesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListQueues(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListPresetsAPIClient is a client that implements the ListPresets operation. +type ListPresetsAPIClient interface { + ListPresets(context.Context, *ListPresetsInput, ...func(*Options)) (*ListPresetsOutput, error) +} + +var _ ListPresetsAPIClient = (*Client)(nil) + +// ListPresetsPaginatorOptions is the paginator options for ListPresets +type ListPresetsPaginatorOptions struct { + // Optional. Number of presets, up to twenty, that will be returned at one time + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListPresetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mediaconvert.ListPresets +type ListPresetsPaginator struct { + options ListPresetsPaginatorOptions + client ListPresetsAPIClient + params *ListPresetsInput + nextToken *string + firstPage bool + done bool +} + +// NewListPresetsPaginator returns a new ListPresetsPaginator +func NewListPresetsPaginator(client ListPresetsAPIClient, params *ListPresetsInput, optFns ...func(*ListPresetsPaginatorOptions)) *ListPresetsPaginator { + options := ListPresetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListPresetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPresetsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListPresets page. +func (p *ListPresetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPresetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListPresets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeEndpointsAPIClient is a client that implements the DescribeEndpoints +// operation. +type DescribeEndpointsAPIClient interface { + DescribeEndpoints(context.Context, *DescribeEndpointsInput, ...func(*Options)) (*DescribeEndpointsOutput, error) +} + +var _ DescribeEndpointsAPIClient = (*Client)(nil) + +// DescribeEndpointsPaginatorOptions is the paginator options for DescribeEndpoints +type DescribeEndpointsPaginatorOptions struct { + // Optional. Max number of endpoints, up to twenty, that will be returned at one + // time. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeEndpointsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mediaconvert.DescribeEndpoints +type DescribeEndpointsPaginator struct { + options DescribeEndpointsPaginatorOptions + client DescribeEndpointsAPIClient + params *DescribeEndpointsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeEndpointsPaginator returns a new DescribeEndpointsPaginator +func NewDescribeEndpointsPaginator(client DescribeEndpointsAPIClient, params *DescribeEndpointsInput, optFns ...func(*DescribeEndpointsPaginatorOptions)) *DescribeEndpointsPaginator { + options := DescribeEndpointsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeEndpointsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEndpointsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeEndpoints page. +func (p *DescribeEndpointsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEndpointsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeEndpoints(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListJobTemplatesAPIClient is a client that implements the ListJobTemplates +// operation. +type ListJobTemplatesAPIClient interface { + ListJobTemplates(context.Context, *ListJobTemplatesInput, ...func(*Options)) (*ListJobTemplatesOutput, error) +} + +var _ ListJobTemplatesAPIClient = (*Client)(nil) + +// ListJobTemplatesPaginatorOptions is the paginator options for ListJobTemplates +type ListJobTemplatesPaginatorOptions struct { + // Optional. Number of job templates, up to twenty, that will be returned at one + // time. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListJobTemplatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mediaconvert.ListJobTemplates +type ListJobTemplatesPaginator struct { + options ListJobTemplatesPaginatorOptions + client ListJobTemplatesAPIClient + params *ListJobTemplatesInput + nextToken *string + firstPage bool + done bool +} + +// NewListJobTemplatesPaginator returns a new ListJobTemplatesPaginator +func NewListJobTemplatesPaginator(client ListJobTemplatesAPIClient, params *ListJobTemplatesInput, optFns ...func(*ListJobTemplatesPaginatorOptions)) *ListJobTemplatesPaginator { + options := ListJobTemplatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListJobTemplatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListJobTemplatesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListJobTemplates page. +func (p *ListJobTemplatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListJobTemplatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListJobTemplates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/medialive/go.sum b/service/medialive/go.sum index c669e324b14..32595049f96 100644 --- a/service/medialive/go.sum +++ b/service/medialive/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/medialive/paginators.go b/service/medialive/paginators.go new file mode 100644 index 00000000000..40d13a74df1 --- /dev/null +++ b/service/medialive/paginators.go @@ -0,0 +1,760 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package medialive + +import ( + "context" + "fmt" +) + +// ListReservationsAPIClient is a client that implements the ListReservations +// operation. +type ListReservationsAPIClient interface { + ListReservations(context.Context, *ListReservationsInput, ...func(*Options)) (*ListReservationsOutput, error) +} + +var _ ListReservationsAPIClient = (*Client)(nil) + +// ListReservationsPaginatorOptions is the paginator options for ListReservations +type ListReservationsPaginatorOptions struct { + // Placeholder documentation for MaxResults + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListReservationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/medialive.ListReservations +type ListReservationsPaginator struct { + options ListReservationsPaginatorOptions + client ListReservationsAPIClient + params *ListReservationsInput + nextToken *string + firstPage bool + done bool +} + +// NewListReservationsPaginator returns a new ListReservationsPaginator +func NewListReservationsPaginator(client ListReservationsAPIClient, params *ListReservationsInput, optFns ...func(*ListReservationsPaginatorOptions)) *ListReservationsPaginator { + options := ListReservationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListReservationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListReservationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListReservations page. +func (p *ListReservationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListReservationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListReservations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListChannelsAPIClient is a client that implements the ListChannels operation. +type ListChannelsAPIClient interface { + ListChannels(context.Context, *ListChannelsInput, ...func(*Options)) (*ListChannelsOutput, error) +} + +var _ ListChannelsAPIClient = (*Client)(nil) + +// ListChannelsPaginatorOptions is the paginator options for ListChannels +type ListChannelsPaginatorOptions struct { + // Placeholder documentation for MaxResults + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListChannelsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/medialive.ListChannels +type ListChannelsPaginator struct { + options ListChannelsPaginatorOptions + client ListChannelsAPIClient + params *ListChannelsInput + nextToken *string + firstPage bool + done bool +} + +// NewListChannelsPaginator returns a new ListChannelsPaginator +func NewListChannelsPaginator(client ListChannelsAPIClient, params *ListChannelsInput, optFns ...func(*ListChannelsPaginatorOptions)) *ListChannelsPaginator { + options := ListChannelsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListChannelsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListChannelsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListChannels page. +func (p *ListChannelsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListChannelsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListChannels(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeScheduleAPIClient is a client that implements the DescribeSchedule +// operation. +type DescribeScheduleAPIClient interface { + DescribeSchedule(context.Context, *DescribeScheduleInput, ...func(*Options)) (*DescribeScheduleOutput, error) +} + +var _ DescribeScheduleAPIClient = (*Client)(nil) + +// DescribeSchedulePaginatorOptions is the paginator options for DescribeSchedule +type DescribeSchedulePaginatorOptions struct { + // Placeholder documentation for MaxResults + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeSchedulePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/medialive.DescribeSchedule +type DescribeSchedulePaginator struct { + options DescribeSchedulePaginatorOptions + client DescribeScheduleAPIClient + params *DescribeScheduleInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeSchedulePaginator returns a new DescribeSchedulePaginator +func NewDescribeSchedulePaginator(client DescribeScheduleAPIClient, params *DescribeScheduleInput, optFns ...func(*DescribeSchedulePaginatorOptions)) *DescribeSchedulePaginator { + options := DescribeSchedulePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeSchedulePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeSchedulePaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeSchedule page. +func (p *DescribeSchedulePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeScheduleOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeSchedule(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListInputSecurityGroupsAPIClient is a client that implements the +// ListInputSecurityGroups operation. +type ListInputSecurityGroupsAPIClient interface { + ListInputSecurityGroups(context.Context, *ListInputSecurityGroupsInput, ...func(*Options)) (*ListInputSecurityGroupsOutput, error) +} + +var _ ListInputSecurityGroupsAPIClient = (*Client)(nil) + +// ListInputSecurityGroupsPaginatorOptions is the paginator options for +// ListInputSecurityGroups +type ListInputSecurityGroupsPaginatorOptions struct { + // Placeholder documentation for MaxResults + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListInputSecurityGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/medialive.ListInputSecurityGroups +type ListInputSecurityGroupsPaginator struct { + options ListInputSecurityGroupsPaginatorOptions + client ListInputSecurityGroupsAPIClient + params *ListInputSecurityGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewListInputSecurityGroupsPaginator returns a new +// ListInputSecurityGroupsPaginator +func NewListInputSecurityGroupsPaginator(client ListInputSecurityGroupsAPIClient, params *ListInputSecurityGroupsInput, optFns ...func(*ListInputSecurityGroupsPaginatorOptions)) *ListInputSecurityGroupsPaginator { + options := ListInputSecurityGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListInputSecurityGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListInputSecurityGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListInputSecurityGroups page. +func (p *ListInputSecurityGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListInputSecurityGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListInputSecurityGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListMultiplexProgramsAPIClient is a client that implements the +// ListMultiplexPrograms operation. +type ListMultiplexProgramsAPIClient interface { + ListMultiplexPrograms(context.Context, *ListMultiplexProgramsInput, ...func(*Options)) (*ListMultiplexProgramsOutput, error) +} + +var _ ListMultiplexProgramsAPIClient = (*Client)(nil) + +// ListMultiplexProgramsPaginatorOptions is the paginator options for +// ListMultiplexPrograms +type ListMultiplexProgramsPaginatorOptions struct { + // The maximum number of items to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListMultiplexProgramsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/medialive.ListMultiplexPrograms +type ListMultiplexProgramsPaginator struct { + options ListMultiplexProgramsPaginatorOptions + client ListMultiplexProgramsAPIClient + params *ListMultiplexProgramsInput + nextToken *string + firstPage bool + done bool +} + +// NewListMultiplexProgramsPaginator returns a new ListMultiplexProgramsPaginator +func NewListMultiplexProgramsPaginator(client ListMultiplexProgramsAPIClient, params *ListMultiplexProgramsInput, optFns ...func(*ListMultiplexProgramsPaginatorOptions)) *ListMultiplexProgramsPaginator { + options := ListMultiplexProgramsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListMultiplexProgramsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMultiplexProgramsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListMultiplexPrograms page. +func (p *ListMultiplexProgramsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMultiplexProgramsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListMultiplexPrograms(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListInputDeviceTransfersAPIClient is a client that implements the +// ListInputDeviceTransfers operation. +type ListInputDeviceTransfersAPIClient interface { + ListInputDeviceTransfers(context.Context, *ListInputDeviceTransfersInput, ...func(*Options)) (*ListInputDeviceTransfersOutput, error) +} + +var _ ListInputDeviceTransfersAPIClient = (*Client)(nil) + +// ListInputDeviceTransfersPaginatorOptions is the paginator options for +// ListInputDeviceTransfers +type ListInputDeviceTransfersPaginatorOptions struct { + // Placeholder documentation for MaxResults + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListInputDeviceTransfersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/medialive.ListInputDeviceTransfers +type ListInputDeviceTransfersPaginator struct { + options ListInputDeviceTransfersPaginatorOptions + client ListInputDeviceTransfersAPIClient + params *ListInputDeviceTransfersInput + nextToken *string + firstPage bool + done bool +} + +// NewListInputDeviceTransfersPaginator returns a new +// ListInputDeviceTransfersPaginator +func NewListInputDeviceTransfersPaginator(client ListInputDeviceTransfersAPIClient, params *ListInputDeviceTransfersInput, optFns ...func(*ListInputDeviceTransfersPaginatorOptions)) *ListInputDeviceTransfersPaginator { + options := ListInputDeviceTransfersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListInputDeviceTransfersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListInputDeviceTransfersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListInputDeviceTransfers page. +func (p *ListInputDeviceTransfersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListInputDeviceTransfersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListInputDeviceTransfers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListMultiplexesAPIClient is a client that implements the ListMultiplexes +// operation. +type ListMultiplexesAPIClient interface { + ListMultiplexes(context.Context, *ListMultiplexesInput, ...func(*Options)) (*ListMultiplexesOutput, error) +} + +var _ ListMultiplexesAPIClient = (*Client)(nil) + +// ListMultiplexesPaginatorOptions is the paginator options for ListMultiplexes +type ListMultiplexesPaginatorOptions struct { + // The maximum number of items to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListMultiplexesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/medialive.ListMultiplexes +type ListMultiplexesPaginator struct { + options ListMultiplexesPaginatorOptions + client ListMultiplexesAPIClient + params *ListMultiplexesInput + nextToken *string + firstPage bool + done bool +} + +// NewListMultiplexesPaginator returns a new ListMultiplexesPaginator +func NewListMultiplexesPaginator(client ListMultiplexesAPIClient, params *ListMultiplexesInput, optFns ...func(*ListMultiplexesPaginatorOptions)) *ListMultiplexesPaginator { + options := ListMultiplexesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListMultiplexesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMultiplexesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListMultiplexes page. +func (p *ListMultiplexesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMultiplexesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListMultiplexes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListOfferingsAPIClient is a client that implements the ListOfferings operation. +type ListOfferingsAPIClient interface { + ListOfferings(context.Context, *ListOfferingsInput, ...func(*Options)) (*ListOfferingsOutput, error) +} + +var _ ListOfferingsAPIClient = (*Client)(nil) + +// ListOfferingsPaginatorOptions is the paginator options for ListOfferings +type ListOfferingsPaginatorOptions struct { + // Placeholder documentation for MaxResults + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListOfferingsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/medialive.ListOfferings +type ListOfferingsPaginator struct { + options ListOfferingsPaginatorOptions + client ListOfferingsAPIClient + params *ListOfferingsInput + nextToken *string + firstPage bool + done bool +} + +// NewListOfferingsPaginator returns a new ListOfferingsPaginator +func NewListOfferingsPaginator(client ListOfferingsAPIClient, params *ListOfferingsInput, optFns ...func(*ListOfferingsPaginatorOptions)) *ListOfferingsPaginator { + options := ListOfferingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListOfferingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListOfferingsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListOfferings page. +func (p *ListOfferingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListOfferingsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListOfferings(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListInputsAPIClient is a client that implements the ListInputs operation. +type ListInputsAPIClient interface { + ListInputs(context.Context, *ListInputsInput, ...func(*Options)) (*ListInputsOutput, error) +} + +var _ ListInputsAPIClient = (*Client)(nil) + +// ListInputsPaginatorOptions is the paginator options for ListInputs +type ListInputsPaginatorOptions struct { + // Placeholder documentation for MaxResults + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListInputsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/medialive.ListInputs +type ListInputsPaginator struct { + options ListInputsPaginatorOptions + client ListInputsAPIClient + params *ListInputsInput + nextToken *string + firstPage bool + done bool +} + +// NewListInputsPaginator returns a new ListInputsPaginator +func NewListInputsPaginator(client ListInputsAPIClient, params *ListInputsInput, optFns ...func(*ListInputsPaginatorOptions)) *ListInputsPaginator { + options := ListInputsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListInputsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListInputsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListInputs page. +func (p *ListInputsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListInputsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListInputs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListInputDevicesAPIClient is a client that implements the ListInputDevices +// operation. +type ListInputDevicesAPIClient interface { + ListInputDevices(context.Context, *ListInputDevicesInput, ...func(*Options)) (*ListInputDevicesOutput, error) +} + +var _ ListInputDevicesAPIClient = (*Client)(nil) + +// ListInputDevicesPaginatorOptions is the paginator options for ListInputDevices +type ListInputDevicesPaginatorOptions struct { + // Placeholder documentation for MaxResults + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListInputDevicesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/medialive.ListInputDevices +type ListInputDevicesPaginator struct { + options ListInputDevicesPaginatorOptions + client ListInputDevicesAPIClient + params *ListInputDevicesInput + nextToken *string + firstPage bool + done bool +} + +// NewListInputDevicesPaginator returns a new ListInputDevicesPaginator +func NewListInputDevicesPaginator(client ListInputDevicesAPIClient, params *ListInputDevicesInput, optFns ...func(*ListInputDevicesPaginatorOptions)) *ListInputDevicesPaginator { + options := ListInputDevicesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListInputDevicesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListInputDevicesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListInputDevices page. +func (p *ListInputDevicesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListInputDevicesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListInputDevices(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/mediapackage/go.sum b/service/mediapackage/go.sum index c669e324b14..32595049f96 100644 --- a/service/mediapackage/go.sum +++ b/service/mediapackage/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/mediapackage/paginators.go b/service/mediapackage/paginators.go new file mode 100644 index 00000000000..2e3af252220 --- /dev/null +++ b/service/mediapackage/paginators.go @@ -0,0 +1,233 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package mediapackage + +import ( + "context" + "fmt" +) + +// ListOriginEndpointsAPIClient is a client that implements the ListOriginEndpoints +// operation. +type ListOriginEndpointsAPIClient interface { + ListOriginEndpoints(context.Context, *ListOriginEndpointsInput, ...func(*Options)) (*ListOriginEndpointsOutput, error) +} + +var _ ListOriginEndpointsAPIClient = (*Client)(nil) + +// ListOriginEndpointsPaginatorOptions is the paginator options for +// ListOriginEndpoints +type ListOriginEndpointsPaginatorOptions struct { + // The upper bound on the number of records to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListOriginEndpointsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mediapackage.ListOriginEndpoints +type ListOriginEndpointsPaginator struct { + options ListOriginEndpointsPaginatorOptions + client ListOriginEndpointsAPIClient + params *ListOriginEndpointsInput + nextToken *string + firstPage bool + done bool +} + +// NewListOriginEndpointsPaginator returns a new ListOriginEndpointsPaginator +func NewListOriginEndpointsPaginator(client ListOriginEndpointsAPIClient, params *ListOriginEndpointsInput, optFns ...func(*ListOriginEndpointsPaginatorOptions)) *ListOriginEndpointsPaginator { + options := ListOriginEndpointsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListOriginEndpointsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListOriginEndpointsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListOriginEndpoints page. +func (p *ListOriginEndpointsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListOriginEndpointsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListOriginEndpoints(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListChannelsAPIClient is a client that implements the ListChannels operation. +type ListChannelsAPIClient interface { + ListChannels(context.Context, *ListChannelsInput, ...func(*Options)) (*ListChannelsOutput, error) +} + +var _ ListChannelsAPIClient = (*Client)(nil) + +// ListChannelsPaginatorOptions is the paginator options for ListChannels +type ListChannelsPaginatorOptions struct { + // Upper bound on number of records to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListChannelsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mediapackage.ListChannels +type ListChannelsPaginator struct { + options ListChannelsPaginatorOptions + client ListChannelsAPIClient + params *ListChannelsInput + nextToken *string + firstPage bool + done bool +} + +// NewListChannelsPaginator returns a new ListChannelsPaginator +func NewListChannelsPaginator(client ListChannelsAPIClient, params *ListChannelsInput, optFns ...func(*ListChannelsPaginatorOptions)) *ListChannelsPaginator { + options := ListChannelsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListChannelsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListChannelsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListChannels page. +func (p *ListChannelsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListChannelsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListChannels(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListHarvestJobsAPIClient is a client that implements the ListHarvestJobs +// operation. +type ListHarvestJobsAPIClient interface { + ListHarvestJobs(context.Context, *ListHarvestJobsInput, ...func(*Options)) (*ListHarvestJobsOutput, error) +} + +var _ ListHarvestJobsAPIClient = (*Client)(nil) + +// ListHarvestJobsPaginatorOptions is the paginator options for ListHarvestJobs +type ListHarvestJobsPaginatorOptions struct { + // The upper bound on the number of records to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListHarvestJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mediapackage.ListHarvestJobs +type ListHarvestJobsPaginator struct { + options ListHarvestJobsPaginatorOptions + client ListHarvestJobsAPIClient + params *ListHarvestJobsInput + nextToken *string + firstPage bool + done bool +} + +// NewListHarvestJobsPaginator returns a new ListHarvestJobsPaginator +func NewListHarvestJobsPaginator(client ListHarvestJobsAPIClient, params *ListHarvestJobsInput, optFns ...func(*ListHarvestJobsPaginatorOptions)) *ListHarvestJobsPaginator { + options := ListHarvestJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListHarvestJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListHarvestJobsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListHarvestJobs page. +func (p *ListHarvestJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListHarvestJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListHarvestJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/mediapackagevod/go.sum b/service/mediapackagevod/go.sum index c669e324b14..32595049f96 100644 --- a/service/mediapackagevod/go.sum +++ b/service/mediapackagevod/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/mediapackagevod/paginators.go b/service/mediapackagevod/paginators.go new file mode 100644 index 00000000000..42d2638e114 --- /dev/null +++ b/service/mediapackagevod/paginators.go @@ -0,0 +1,235 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package mediapackagevod + +import ( + "context" + "fmt" +) + +// ListAssetsAPIClient is a client that implements the ListAssets operation. +type ListAssetsAPIClient interface { + ListAssets(context.Context, *ListAssetsInput, ...func(*Options)) (*ListAssetsOutput, error) +} + +var _ ListAssetsAPIClient = (*Client)(nil) + +// ListAssetsPaginatorOptions is the paginator options for ListAssets +type ListAssetsPaginatorOptions struct { + // Upper bound on number of records to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAssetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mediapackagevod.ListAssets +type ListAssetsPaginator struct { + options ListAssetsPaginatorOptions + client ListAssetsAPIClient + params *ListAssetsInput + nextToken *string + firstPage bool + done bool +} + +// NewListAssetsPaginator returns a new ListAssetsPaginator +func NewListAssetsPaginator(client ListAssetsAPIClient, params *ListAssetsInput, optFns ...func(*ListAssetsPaginatorOptions)) *ListAssetsPaginator { + options := ListAssetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAssetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAssetsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAssets page. +func (p *ListAssetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAssetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListAssets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListPackagingGroupsAPIClient is a client that implements the ListPackagingGroups +// operation. +type ListPackagingGroupsAPIClient interface { + ListPackagingGroups(context.Context, *ListPackagingGroupsInput, ...func(*Options)) (*ListPackagingGroupsOutput, error) +} + +var _ ListPackagingGroupsAPIClient = (*Client)(nil) + +// ListPackagingGroupsPaginatorOptions is the paginator options for +// ListPackagingGroups +type ListPackagingGroupsPaginatorOptions struct { + // Upper bound on number of records to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListPackagingGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mediapackagevod.ListPackagingGroups +type ListPackagingGroupsPaginator struct { + options ListPackagingGroupsPaginatorOptions + client ListPackagingGroupsAPIClient + params *ListPackagingGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewListPackagingGroupsPaginator returns a new ListPackagingGroupsPaginator +func NewListPackagingGroupsPaginator(client ListPackagingGroupsAPIClient, params *ListPackagingGroupsInput, optFns ...func(*ListPackagingGroupsPaginatorOptions)) *ListPackagingGroupsPaginator { + options := ListPackagingGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListPackagingGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPackagingGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListPackagingGroups page. +func (p *ListPackagingGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPackagingGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListPackagingGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListPackagingConfigurationsAPIClient is a client that implements the +// ListPackagingConfigurations operation. +type ListPackagingConfigurationsAPIClient interface { + ListPackagingConfigurations(context.Context, *ListPackagingConfigurationsInput, ...func(*Options)) (*ListPackagingConfigurationsOutput, error) +} + +var _ ListPackagingConfigurationsAPIClient = (*Client)(nil) + +// ListPackagingConfigurationsPaginatorOptions is the paginator options for +// ListPackagingConfigurations +type ListPackagingConfigurationsPaginatorOptions struct { + // Upper bound on number of records to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListPackagingConfigurationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mediapackagevod.ListPackagingConfigurations +type ListPackagingConfigurationsPaginator struct { + options ListPackagingConfigurationsPaginatorOptions + client ListPackagingConfigurationsAPIClient + params *ListPackagingConfigurationsInput + nextToken *string + firstPage bool + done bool +} + +// NewListPackagingConfigurationsPaginator returns a new +// ListPackagingConfigurationsPaginator +func NewListPackagingConfigurationsPaginator(client ListPackagingConfigurationsAPIClient, params *ListPackagingConfigurationsInput, optFns ...func(*ListPackagingConfigurationsPaginatorOptions)) *ListPackagingConfigurationsPaginator { + options := ListPackagingConfigurationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListPackagingConfigurationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPackagingConfigurationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListPackagingConfigurations page. +func (p *ListPackagingConfigurationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPackagingConfigurationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListPackagingConfigurations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/mediastore/go.sum b/service/mediastore/go.sum index c669e324b14..32595049f96 100644 --- a/service/mediastore/go.sum +++ b/service/mediastore/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/mediastore/paginators.go b/service/mediastore/paginators.go new file mode 100644 index 00000000000..2ef7ba1a15a --- /dev/null +++ b/service/mediastore/paginators.go @@ -0,0 +1,84 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package mediastore + +import ( + "context" + "fmt" +) + +// ListContainersAPIClient is a client that implements the ListContainers +// operation. +type ListContainersAPIClient interface { + ListContainers(context.Context, *ListContainersInput, ...func(*Options)) (*ListContainersOutput, error) +} + +var _ ListContainersAPIClient = (*Client)(nil) + +// ListContainersPaginatorOptions is the paginator options for ListContainers +type ListContainersPaginatorOptions struct { + // Enter the maximum number of containers in the response. Use from 1 to 255 + // characters. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListContainersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mediastore.ListContainers +type ListContainersPaginator struct { + options ListContainersPaginatorOptions + client ListContainersAPIClient + params *ListContainersInput + nextToken *string + firstPage bool + done bool +} + +// NewListContainersPaginator returns a new ListContainersPaginator +func NewListContainersPaginator(client ListContainersAPIClient, params *ListContainersInput, optFns ...func(*ListContainersPaginatorOptions)) *ListContainersPaginator { + options := ListContainersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListContainersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListContainersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListContainers page. +func (p *ListContainersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListContainersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListContainers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/mediastoredata/go.sum b/service/mediastoredata/go.sum index c669e324b14..32595049f96 100644 --- a/service/mediastoredata/go.sum +++ b/service/mediastoredata/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/mediatailor/go.sum b/service/mediatailor/go.sum index c669e324b14..32595049f96 100644 --- a/service/mediatailor/go.sum +++ b/service/mediatailor/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/migrationhub/go.sum b/service/migrationhub/go.sum index c669e324b14..32595049f96 100644 --- a/service/migrationhub/go.sum +++ b/service/migrationhub/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/migrationhub/paginators.go b/service/migrationhub/paginators.go new file mode 100644 index 00000000000..28e33f7f4ab --- /dev/null +++ b/service/migrationhub/paginators.go @@ -0,0 +1,390 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package migrationhub + +import ( + "context" + "fmt" +) + +// ListDiscoveredResourcesAPIClient is a client that implements the +// ListDiscoveredResources operation. +type ListDiscoveredResourcesAPIClient interface { + ListDiscoveredResources(context.Context, *ListDiscoveredResourcesInput, ...func(*Options)) (*ListDiscoveredResourcesOutput, error) +} + +var _ ListDiscoveredResourcesAPIClient = (*Client)(nil) + +// ListDiscoveredResourcesPaginatorOptions is the paginator options for +// ListDiscoveredResources +type ListDiscoveredResourcesPaginatorOptions struct { + // The maximum number of results returned per page. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDiscoveredResourcesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/migrationhub.ListDiscoveredResources +type ListDiscoveredResourcesPaginator struct { + options ListDiscoveredResourcesPaginatorOptions + client ListDiscoveredResourcesAPIClient + params *ListDiscoveredResourcesInput + nextToken *string + firstPage bool + done bool +} + +// NewListDiscoveredResourcesPaginator returns a new +// ListDiscoveredResourcesPaginator +func NewListDiscoveredResourcesPaginator(client ListDiscoveredResourcesAPIClient, params *ListDiscoveredResourcesInput, optFns ...func(*ListDiscoveredResourcesPaginatorOptions)) *ListDiscoveredResourcesPaginator { + options := ListDiscoveredResourcesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDiscoveredResourcesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDiscoveredResourcesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDiscoveredResources page. +func (p *ListDiscoveredResourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDiscoveredResourcesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListDiscoveredResources(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListApplicationStatesAPIClient is a client that implements the +// ListApplicationStates operation. +type ListApplicationStatesAPIClient interface { + ListApplicationStates(context.Context, *ListApplicationStatesInput, ...func(*Options)) (*ListApplicationStatesOutput, error) +} + +var _ ListApplicationStatesAPIClient = (*Client)(nil) + +// ListApplicationStatesPaginatorOptions is the paginator options for +// ListApplicationStates +type ListApplicationStatesPaginatorOptions struct { + // Maximum number of results to be returned per page. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListApplicationStatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/migrationhub.ListApplicationStates +type ListApplicationStatesPaginator struct { + options ListApplicationStatesPaginatorOptions + client ListApplicationStatesAPIClient + params *ListApplicationStatesInput + nextToken *string + firstPage bool + done bool +} + +// NewListApplicationStatesPaginator returns a new ListApplicationStatesPaginator +func NewListApplicationStatesPaginator(client ListApplicationStatesAPIClient, params *ListApplicationStatesInput, optFns ...func(*ListApplicationStatesPaginatorOptions)) *ListApplicationStatesPaginator { + options := ListApplicationStatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListApplicationStatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListApplicationStatesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListApplicationStates page. +func (p *ListApplicationStatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListApplicationStatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListApplicationStates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListProgressUpdateStreamsAPIClient is a client that implements the +// ListProgressUpdateStreams operation. +type ListProgressUpdateStreamsAPIClient interface { + ListProgressUpdateStreams(context.Context, *ListProgressUpdateStreamsInput, ...func(*Options)) (*ListProgressUpdateStreamsOutput, error) +} + +var _ ListProgressUpdateStreamsAPIClient = (*Client)(nil) + +// ListProgressUpdateStreamsPaginatorOptions is the paginator options for +// ListProgressUpdateStreams +type ListProgressUpdateStreamsPaginatorOptions struct { + // Filter to limit the maximum number of results to list per page. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListProgressUpdateStreamsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/migrationhub.ListProgressUpdateStreams +type ListProgressUpdateStreamsPaginator struct { + options ListProgressUpdateStreamsPaginatorOptions + client ListProgressUpdateStreamsAPIClient + params *ListProgressUpdateStreamsInput + nextToken *string + firstPage bool + done bool +} + +// NewListProgressUpdateStreamsPaginator returns a new +// ListProgressUpdateStreamsPaginator +func NewListProgressUpdateStreamsPaginator(client ListProgressUpdateStreamsAPIClient, params *ListProgressUpdateStreamsInput, optFns ...func(*ListProgressUpdateStreamsPaginatorOptions)) *ListProgressUpdateStreamsPaginator { + options := ListProgressUpdateStreamsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListProgressUpdateStreamsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListProgressUpdateStreamsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListProgressUpdateStreams page. +func (p *ListProgressUpdateStreamsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProgressUpdateStreamsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListProgressUpdateStreams(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListCreatedArtifactsAPIClient is a client that implements the +// ListCreatedArtifacts operation. +type ListCreatedArtifactsAPIClient interface { + ListCreatedArtifacts(context.Context, *ListCreatedArtifactsInput, ...func(*Options)) (*ListCreatedArtifactsOutput, error) +} + +var _ ListCreatedArtifactsAPIClient = (*Client)(nil) + +// ListCreatedArtifactsPaginatorOptions is the paginator options for +// ListCreatedArtifacts +type ListCreatedArtifactsPaginatorOptions struct { + // Maximum number of results to be returned per page. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListCreatedArtifactsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/migrationhub.ListCreatedArtifacts +type ListCreatedArtifactsPaginator struct { + options ListCreatedArtifactsPaginatorOptions + client ListCreatedArtifactsAPIClient + params *ListCreatedArtifactsInput + nextToken *string + firstPage bool + done bool +} + +// NewListCreatedArtifactsPaginator returns a new ListCreatedArtifactsPaginator +func NewListCreatedArtifactsPaginator(client ListCreatedArtifactsAPIClient, params *ListCreatedArtifactsInput, optFns ...func(*ListCreatedArtifactsPaginatorOptions)) *ListCreatedArtifactsPaginator { + options := ListCreatedArtifactsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListCreatedArtifactsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCreatedArtifactsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListCreatedArtifacts page. +func (p *ListCreatedArtifactsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCreatedArtifactsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListCreatedArtifacts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListMigrationTasksAPIClient is a client that implements the ListMigrationTasks +// operation. +type ListMigrationTasksAPIClient interface { + ListMigrationTasks(context.Context, *ListMigrationTasksInput, ...func(*Options)) (*ListMigrationTasksOutput, error) +} + +var _ ListMigrationTasksAPIClient = (*Client)(nil) + +// ListMigrationTasksPaginatorOptions is the paginator options for +// ListMigrationTasks +type ListMigrationTasksPaginatorOptions struct { + // Value to specify how many results are returned per page. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListMigrationTasksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/migrationhub.ListMigrationTasks +type ListMigrationTasksPaginator struct { + options ListMigrationTasksPaginatorOptions + client ListMigrationTasksAPIClient + params *ListMigrationTasksInput + nextToken *string + firstPage bool + done bool +} + +// NewListMigrationTasksPaginator returns a new ListMigrationTasksPaginator +func NewListMigrationTasksPaginator(client ListMigrationTasksAPIClient, params *ListMigrationTasksInput, optFns ...func(*ListMigrationTasksPaginatorOptions)) *ListMigrationTasksPaginator { + options := ListMigrationTasksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListMigrationTasksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMigrationTasksPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListMigrationTasks page. +func (p *ListMigrationTasksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMigrationTasksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListMigrationTasks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/migrationhubconfig/go.sum b/service/migrationhubconfig/go.sum index c669e324b14..32595049f96 100644 --- a/service/migrationhubconfig/go.sum +++ b/service/migrationhubconfig/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/migrationhubconfig/paginators.go b/service/migrationhubconfig/paginators.go new file mode 100644 index 00000000000..2da0ab5f167 --- /dev/null +++ b/service/migrationhubconfig/paginators.go @@ -0,0 +1,85 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package migrationhubconfig + +import ( + "context" + "fmt" +) + +// DescribeHomeRegionControlsAPIClient is a client that implements the +// DescribeHomeRegionControls operation. +type DescribeHomeRegionControlsAPIClient interface { + DescribeHomeRegionControls(context.Context, *DescribeHomeRegionControlsInput, ...func(*Options)) (*DescribeHomeRegionControlsOutput, error) +} + +var _ DescribeHomeRegionControlsAPIClient = (*Client)(nil) + +// DescribeHomeRegionControlsPaginatorOptions is the paginator options for +// DescribeHomeRegionControls +type DescribeHomeRegionControlsPaginatorOptions struct { + // The maximum number of filtering results to display per page. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeHomeRegionControlsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/migrationhubconfig.DescribeHomeRegionControls +type DescribeHomeRegionControlsPaginator struct { + options DescribeHomeRegionControlsPaginatorOptions + client DescribeHomeRegionControlsAPIClient + params *DescribeHomeRegionControlsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeHomeRegionControlsPaginator returns a new +// DescribeHomeRegionControlsPaginator +func NewDescribeHomeRegionControlsPaginator(client DescribeHomeRegionControlsAPIClient, params *DescribeHomeRegionControlsInput, optFns ...func(*DescribeHomeRegionControlsPaginatorOptions)) *DescribeHomeRegionControlsPaginator { + options := DescribeHomeRegionControlsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeHomeRegionControlsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeHomeRegionControlsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeHomeRegionControls page. +func (p *DescribeHomeRegionControlsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeHomeRegionControlsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeHomeRegionControls(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/mobile/go.sum b/service/mobile/go.sum index c669e324b14..32595049f96 100644 --- a/service/mobile/go.sum +++ b/service/mobile/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/mobile/paginators.go b/service/mobile/paginators.go new file mode 100644 index 00000000000..5f3a8a6b7c0 --- /dev/null +++ b/service/mobile/paginators.go @@ -0,0 +1,156 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package mobile + +import ( + "context" + "fmt" +) + +// ListBundlesAPIClient is a client that implements the ListBundles operation. +type ListBundlesAPIClient interface { + ListBundles(context.Context, *ListBundlesInput, ...func(*Options)) (*ListBundlesOutput, error) +} + +var _ ListBundlesAPIClient = (*Client)(nil) + +// ListBundlesPaginatorOptions is the paginator options for ListBundles +type ListBundlesPaginatorOptions struct { + // Maximum number of records to list in a single response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListBundlesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mobile.ListBundles +type ListBundlesPaginator struct { + options ListBundlesPaginatorOptions + client ListBundlesAPIClient + params *ListBundlesInput + nextToken *string + firstPage bool + done bool +} + +// NewListBundlesPaginator returns a new ListBundlesPaginator +func NewListBundlesPaginator(client ListBundlesAPIClient, params *ListBundlesInput, optFns ...func(*ListBundlesPaginatorOptions)) *ListBundlesPaginator { + options := ListBundlesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListBundlesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListBundlesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListBundles page. +func (p *ListBundlesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBundlesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListBundles(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListProjectsAPIClient is a client that implements the ListProjects operation. +type ListProjectsAPIClient interface { + ListProjects(context.Context, *ListProjectsInput, ...func(*Options)) (*ListProjectsOutput, error) +} + +var _ ListProjectsAPIClient = (*Client)(nil) + +// ListProjectsPaginatorOptions is the paginator options for ListProjects +type ListProjectsPaginatorOptions struct { + // Maximum number of records to list in a single response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListProjectsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mobile.ListProjects +type ListProjectsPaginator struct { + options ListProjectsPaginatorOptions + client ListProjectsAPIClient + params *ListProjectsInput + nextToken *string + firstPage bool + done bool +} + +// NewListProjectsPaginator returns a new ListProjectsPaginator +func NewListProjectsPaginator(client ListProjectsAPIClient, params *ListProjectsInput, optFns ...func(*ListProjectsPaginatorOptions)) *ListProjectsPaginator { + options := ListProjectsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListProjectsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListProjectsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListProjects page. +func (p *ListProjectsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProjectsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListProjects(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/mq/go.sum b/service/mq/go.sum index c669e324b14..32595049f96 100644 --- a/service/mq/go.sum +++ b/service/mq/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/mq/paginators.go b/service/mq/paginators.go new file mode 100644 index 00000000000..beeb94b0946 --- /dev/null +++ b/service/mq/paginators.go @@ -0,0 +1,83 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package mq + +import ( + "context" + "fmt" +) + +// ListBrokersAPIClient is a client that implements the ListBrokers operation. +type ListBrokersAPIClient interface { + ListBrokers(context.Context, *ListBrokersInput, ...func(*Options)) (*ListBrokersOutput, error) +} + +var _ ListBrokersAPIClient = (*Client)(nil) + +// ListBrokersPaginatorOptions is the paginator options for ListBrokers +type ListBrokersPaginatorOptions struct { + // The maximum number of brokers that Amazon MQ can return per page (20 by + // default). This value must be an integer from 5 to 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListBrokersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mq.ListBrokers +type ListBrokersPaginator struct { + options ListBrokersPaginatorOptions + client ListBrokersAPIClient + params *ListBrokersInput + nextToken *string + firstPage bool + done bool +} + +// NewListBrokersPaginator returns a new ListBrokersPaginator +func NewListBrokersPaginator(client ListBrokersAPIClient, params *ListBrokersInput, optFns ...func(*ListBrokersPaginatorOptions)) *ListBrokersPaginator { + options := ListBrokersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListBrokersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListBrokersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListBrokers page. +func (p *ListBrokersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBrokersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListBrokers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/mturk/go.sum b/service/mturk/go.sum index c669e324b14..32595049f96 100644 --- a/service/mturk/go.sum +++ b/service/mturk/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/mturk/paginators.go b/service/mturk/paginators.go new file mode 100644 index 00000000000..17d28d88dc8 --- /dev/null +++ b/service/mturk/paginators.go @@ -0,0 +1,764 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package mturk + +import ( + "context" + "fmt" +) + +// ListHITsAPIClient is a client that implements the ListHITs operation. +type ListHITsAPIClient interface { + ListHITs(context.Context, *ListHITsInput, ...func(*Options)) (*ListHITsOutput, error) +} + +var _ ListHITsAPIClient = (*Client)(nil) + +// ListHITsPaginatorOptions is the paginator options for ListHITs +type ListHITsPaginatorOptions struct { + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListHITsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mturk.ListHITs +type ListHITsPaginator struct { + options ListHITsPaginatorOptions + client ListHITsAPIClient + params *ListHITsInput + nextToken *string + firstPage bool + done bool +} + +// NewListHITsPaginator returns a new ListHITsPaginator +func NewListHITsPaginator(client ListHITsAPIClient, params *ListHITsInput, optFns ...func(*ListHITsPaginatorOptions)) *ListHITsPaginator { + options := ListHITsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListHITsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListHITsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListHITs page. +func (p *ListHITsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListHITsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListHITs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListWorkerBlocksAPIClient is a client that implements the ListWorkerBlocks +// operation. +type ListWorkerBlocksAPIClient interface { + ListWorkerBlocks(context.Context, *ListWorkerBlocksInput, ...func(*Options)) (*ListWorkerBlocksOutput, error) +} + +var _ ListWorkerBlocksAPIClient = (*Client)(nil) + +// ListWorkerBlocksPaginatorOptions is the paginator options for ListWorkerBlocks +type ListWorkerBlocksPaginatorOptions struct { + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListWorkerBlocksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mturk.ListWorkerBlocks +type ListWorkerBlocksPaginator struct { + options ListWorkerBlocksPaginatorOptions + client ListWorkerBlocksAPIClient + params *ListWorkerBlocksInput + nextToken *string + firstPage bool + done bool +} + +// NewListWorkerBlocksPaginator returns a new ListWorkerBlocksPaginator +func NewListWorkerBlocksPaginator(client ListWorkerBlocksAPIClient, params *ListWorkerBlocksInput, optFns ...func(*ListWorkerBlocksPaginatorOptions)) *ListWorkerBlocksPaginator { + options := ListWorkerBlocksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListWorkerBlocksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListWorkerBlocksPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListWorkerBlocks page. +func (p *ListWorkerBlocksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListWorkerBlocksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListWorkerBlocks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListWorkersWithQualificationTypeAPIClient is a client that implements the +// ListWorkersWithQualificationType operation. +type ListWorkersWithQualificationTypeAPIClient interface { + ListWorkersWithQualificationType(context.Context, *ListWorkersWithQualificationTypeInput, ...func(*Options)) (*ListWorkersWithQualificationTypeOutput, error) +} + +var _ ListWorkersWithQualificationTypeAPIClient = (*Client)(nil) + +// ListWorkersWithQualificationTypePaginatorOptions is the paginator options for +// ListWorkersWithQualificationType +type ListWorkersWithQualificationTypePaginatorOptions struct { + // Limit the number of results returned. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListWorkersWithQualificationTypePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mturk.ListWorkersWithQualificationType +type ListWorkersWithQualificationTypePaginator struct { + options ListWorkersWithQualificationTypePaginatorOptions + client ListWorkersWithQualificationTypeAPIClient + params *ListWorkersWithQualificationTypeInput + nextToken *string + firstPage bool + done bool +} + +// NewListWorkersWithQualificationTypePaginator returns a new +// ListWorkersWithQualificationTypePaginator +func NewListWorkersWithQualificationTypePaginator(client ListWorkersWithQualificationTypeAPIClient, params *ListWorkersWithQualificationTypeInput, optFns ...func(*ListWorkersWithQualificationTypePaginatorOptions)) *ListWorkersWithQualificationTypePaginator { + options := ListWorkersWithQualificationTypePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListWorkersWithQualificationTypePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListWorkersWithQualificationTypePaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListWorkersWithQualificationType page. +func (p *ListWorkersWithQualificationTypePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListWorkersWithQualificationTypeOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListWorkersWithQualificationType(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListReviewableHITsAPIClient is a client that implements the ListReviewableHITs +// operation. +type ListReviewableHITsAPIClient interface { + ListReviewableHITs(context.Context, *ListReviewableHITsInput, ...func(*Options)) (*ListReviewableHITsOutput, error) +} + +var _ ListReviewableHITsAPIClient = (*Client)(nil) + +// ListReviewableHITsPaginatorOptions is the paginator options for +// ListReviewableHITs +type ListReviewableHITsPaginatorOptions struct { + // Limit the number of results returned. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListReviewableHITsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mturk.ListReviewableHITs +type ListReviewableHITsPaginator struct { + options ListReviewableHITsPaginatorOptions + client ListReviewableHITsAPIClient + params *ListReviewableHITsInput + nextToken *string + firstPage bool + done bool +} + +// NewListReviewableHITsPaginator returns a new ListReviewableHITsPaginator +func NewListReviewableHITsPaginator(client ListReviewableHITsAPIClient, params *ListReviewableHITsInput, optFns ...func(*ListReviewableHITsPaginatorOptions)) *ListReviewableHITsPaginator { + options := ListReviewableHITsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListReviewableHITsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListReviewableHITsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListReviewableHITs page. +func (p *ListReviewableHITsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListReviewableHITsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListReviewableHITs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListQualificationTypesAPIClient is a client that implements the +// ListQualificationTypes operation. +type ListQualificationTypesAPIClient interface { + ListQualificationTypes(context.Context, *ListQualificationTypesInput, ...func(*Options)) (*ListQualificationTypesOutput, error) +} + +var _ ListQualificationTypesAPIClient = (*Client)(nil) + +// ListQualificationTypesPaginatorOptions is the paginator options for +// ListQualificationTypes +type ListQualificationTypesPaginatorOptions struct { + // The maximum number of results to return in a single call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListQualificationTypesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mturk.ListQualificationTypes +type ListQualificationTypesPaginator struct { + options ListQualificationTypesPaginatorOptions + client ListQualificationTypesAPIClient + params *ListQualificationTypesInput + nextToken *string + firstPage bool + done bool +} + +// NewListQualificationTypesPaginator returns a new ListQualificationTypesPaginator +func NewListQualificationTypesPaginator(client ListQualificationTypesAPIClient, params *ListQualificationTypesInput, optFns ...func(*ListQualificationTypesPaginatorOptions)) *ListQualificationTypesPaginator { + options := ListQualificationTypesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListQualificationTypesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListQualificationTypesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListQualificationTypes page. +func (p *ListQualificationTypesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListQualificationTypesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListQualificationTypes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListHITsForQualificationTypeAPIClient is a client that implements the +// ListHITsForQualificationType operation. +type ListHITsForQualificationTypeAPIClient interface { + ListHITsForQualificationType(context.Context, *ListHITsForQualificationTypeInput, ...func(*Options)) (*ListHITsForQualificationTypeOutput, error) +} + +var _ ListHITsForQualificationTypeAPIClient = (*Client)(nil) + +// ListHITsForQualificationTypePaginatorOptions is the paginator options for +// ListHITsForQualificationType +type ListHITsForQualificationTypePaginatorOptions struct { + // Limit the number of results returned. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListHITsForQualificationTypePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mturk.ListHITsForQualificationType +type ListHITsForQualificationTypePaginator struct { + options ListHITsForQualificationTypePaginatorOptions + client ListHITsForQualificationTypeAPIClient + params *ListHITsForQualificationTypeInput + nextToken *string + firstPage bool + done bool +} + +// NewListHITsForQualificationTypePaginator returns a new +// ListHITsForQualificationTypePaginator +func NewListHITsForQualificationTypePaginator(client ListHITsForQualificationTypeAPIClient, params *ListHITsForQualificationTypeInput, optFns ...func(*ListHITsForQualificationTypePaginatorOptions)) *ListHITsForQualificationTypePaginator { + options := ListHITsForQualificationTypePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListHITsForQualificationTypePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListHITsForQualificationTypePaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListHITsForQualificationType page. +func (p *ListHITsForQualificationTypePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListHITsForQualificationTypeOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListHITsForQualificationType(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListBonusPaymentsAPIClient is a client that implements the ListBonusPayments +// operation. +type ListBonusPaymentsAPIClient interface { + ListBonusPayments(context.Context, *ListBonusPaymentsInput, ...func(*Options)) (*ListBonusPaymentsOutput, error) +} + +var _ ListBonusPaymentsAPIClient = (*Client)(nil) + +// ListBonusPaymentsPaginatorOptions is the paginator options for ListBonusPayments +type ListBonusPaymentsPaginatorOptions struct { + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListBonusPaymentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mturk.ListBonusPayments +type ListBonusPaymentsPaginator struct { + options ListBonusPaymentsPaginatorOptions + client ListBonusPaymentsAPIClient + params *ListBonusPaymentsInput + nextToken *string + firstPage bool + done bool +} + +// NewListBonusPaymentsPaginator returns a new ListBonusPaymentsPaginator +func NewListBonusPaymentsPaginator(client ListBonusPaymentsAPIClient, params *ListBonusPaymentsInput, optFns ...func(*ListBonusPaymentsPaginatorOptions)) *ListBonusPaymentsPaginator { + options := ListBonusPaymentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListBonusPaymentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListBonusPaymentsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListBonusPayments page. +func (p *ListBonusPaymentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBonusPaymentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListBonusPayments(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListReviewPolicyResultsForHITAPIClient is a client that implements the +// ListReviewPolicyResultsForHIT operation. +type ListReviewPolicyResultsForHITAPIClient interface { + ListReviewPolicyResultsForHIT(context.Context, *ListReviewPolicyResultsForHITInput, ...func(*Options)) (*ListReviewPolicyResultsForHITOutput, error) +} + +var _ ListReviewPolicyResultsForHITAPIClient = (*Client)(nil) + +// ListReviewPolicyResultsForHITPaginatorOptions is the paginator options for +// ListReviewPolicyResultsForHIT +type ListReviewPolicyResultsForHITPaginatorOptions struct { + // Limit the number of results returned. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListReviewPolicyResultsForHITPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mturk.ListReviewPolicyResultsForHIT +type ListReviewPolicyResultsForHITPaginator struct { + options ListReviewPolicyResultsForHITPaginatorOptions + client ListReviewPolicyResultsForHITAPIClient + params *ListReviewPolicyResultsForHITInput + nextToken *string + firstPage bool + done bool +} + +// NewListReviewPolicyResultsForHITPaginator returns a new +// ListReviewPolicyResultsForHITPaginator +func NewListReviewPolicyResultsForHITPaginator(client ListReviewPolicyResultsForHITAPIClient, params *ListReviewPolicyResultsForHITInput, optFns ...func(*ListReviewPolicyResultsForHITPaginatorOptions)) *ListReviewPolicyResultsForHITPaginator { + options := ListReviewPolicyResultsForHITPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListReviewPolicyResultsForHITPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListReviewPolicyResultsForHITPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListReviewPolicyResultsForHIT page. +func (p *ListReviewPolicyResultsForHITPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListReviewPolicyResultsForHITOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListReviewPolicyResultsForHIT(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListAssignmentsForHITAPIClient is a client that implements the +// ListAssignmentsForHIT operation. +type ListAssignmentsForHITAPIClient interface { + ListAssignmentsForHIT(context.Context, *ListAssignmentsForHITInput, ...func(*Options)) (*ListAssignmentsForHITOutput, error) +} + +var _ ListAssignmentsForHITAPIClient = (*Client)(nil) + +// ListAssignmentsForHITPaginatorOptions is the paginator options for +// ListAssignmentsForHIT +type ListAssignmentsForHITPaginatorOptions struct { + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAssignmentsForHITPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mturk.ListAssignmentsForHIT +type ListAssignmentsForHITPaginator struct { + options ListAssignmentsForHITPaginatorOptions + client ListAssignmentsForHITAPIClient + params *ListAssignmentsForHITInput + nextToken *string + firstPage bool + done bool +} + +// NewListAssignmentsForHITPaginator returns a new ListAssignmentsForHITPaginator +func NewListAssignmentsForHITPaginator(client ListAssignmentsForHITAPIClient, params *ListAssignmentsForHITInput, optFns ...func(*ListAssignmentsForHITPaginatorOptions)) *ListAssignmentsForHITPaginator { + options := ListAssignmentsForHITPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAssignmentsForHITPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAssignmentsForHITPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAssignmentsForHIT page. +func (p *ListAssignmentsForHITPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAssignmentsForHITOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListAssignmentsForHIT(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListQualificationRequestsAPIClient is a client that implements the +// ListQualificationRequests operation. +type ListQualificationRequestsAPIClient interface { + ListQualificationRequests(context.Context, *ListQualificationRequestsInput, ...func(*Options)) (*ListQualificationRequestsOutput, error) +} + +var _ ListQualificationRequestsAPIClient = (*Client)(nil) + +// ListQualificationRequestsPaginatorOptions is the paginator options for +// ListQualificationRequests +type ListQualificationRequestsPaginatorOptions struct { + // The maximum number of results to return in a single call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListQualificationRequestsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mturk.ListQualificationRequests +type ListQualificationRequestsPaginator struct { + options ListQualificationRequestsPaginatorOptions + client ListQualificationRequestsAPIClient + params *ListQualificationRequestsInput + nextToken *string + firstPage bool + done bool +} + +// NewListQualificationRequestsPaginator returns a new +// ListQualificationRequestsPaginator +func NewListQualificationRequestsPaginator(client ListQualificationRequestsAPIClient, params *ListQualificationRequestsInput, optFns ...func(*ListQualificationRequestsPaginatorOptions)) *ListQualificationRequestsPaginator { + options := ListQualificationRequestsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListQualificationRequestsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListQualificationRequestsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListQualificationRequests page. +func (p *ListQualificationRequestsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListQualificationRequestsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListQualificationRequests(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/neptune/go.sum b/service/neptune/go.sum index c669e324b14..32595049f96 100644 --- a/service/neptune/go.sum +++ b/service/neptune/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/neptune/paginators.go b/service/neptune/paginators.go new file mode 100644 index 00000000000..ccda98f6a93 --- /dev/null +++ b/service/neptune/paginators.go @@ -0,0 +1,805 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package neptune + +import ( + "context" + "fmt" +) + +// DescribeDBParameterGroupsAPIClient is a client that implements the +// DescribeDBParameterGroups operation. +type DescribeDBParameterGroupsAPIClient interface { + DescribeDBParameterGroups(context.Context, *DescribeDBParameterGroupsInput, ...func(*Options)) (*DescribeDBParameterGroupsOutput, error) +} + +var _ DescribeDBParameterGroupsAPIClient = (*Client)(nil) + +// DescribeDBParameterGroupsPaginatorOptions is the paginator options for +// DescribeDBParameterGroups +type DescribeDBParameterGroupsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeDBParameterGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/neptune.DescribeDBParameterGroups +type DescribeDBParameterGroupsPaginator struct { + options DescribeDBParameterGroupsPaginatorOptions + client DescribeDBParameterGroupsAPIClient + params *DescribeDBParameterGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeDBParameterGroupsPaginator returns a new +// DescribeDBParameterGroupsPaginator +func NewDescribeDBParameterGroupsPaginator(client DescribeDBParameterGroupsAPIClient, params *DescribeDBParameterGroupsInput, optFns ...func(*DescribeDBParameterGroupsPaginatorOptions)) *DescribeDBParameterGroupsPaginator { + options := DescribeDBParameterGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeDBParameterGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBParameterGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeDBParameterGroups page. +func (p *DescribeDBParameterGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBParameterGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeDBParameterGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeDBClusterEndpointsAPIClient is a client that implements the +// DescribeDBClusterEndpoints operation. +type DescribeDBClusterEndpointsAPIClient interface { + DescribeDBClusterEndpoints(context.Context, *DescribeDBClusterEndpointsInput, ...func(*Options)) (*DescribeDBClusterEndpointsOutput, error) +} + +var _ DescribeDBClusterEndpointsAPIClient = (*Client)(nil) + +// DescribeDBClusterEndpointsPaginatorOptions is the paginator options for +// DescribeDBClusterEndpoints +type DescribeDBClusterEndpointsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so you can retrieve the remaining results. Default: 100 + // Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeDBClusterEndpointsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/neptune.DescribeDBClusterEndpoints +type DescribeDBClusterEndpointsPaginator struct { + options DescribeDBClusterEndpointsPaginatorOptions + client DescribeDBClusterEndpointsAPIClient + params *DescribeDBClusterEndpointsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeDBClusterEndpointsPaginator returns a new +// DescribeDBClusterEndpointsPaginator +func NewDescribeDBClusterEndpointsPaginator(client DescribeDBClusterEndpointsAPIClient, params *DescribeDBClusterEndpointsInput, optFns ...func(*DescribeDBClusterEndpointsPaginatorOptions)) *DescribeDBClusterEndpointsPaginator { + options := DescribeDBClusterEndpointsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeDBClusterEndpointsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBClusterEndpointsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeDBClusterEndpoints page. +func (p *DescribeDBClusterEndpointsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBClusterEndpointsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeDBClusterEndpoints(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeDBEngineVersionsAPIClient is a client that implements the +// DescribeDBEngineVersions operation. +type DescribeDBEngineVersionsAPIClient interface { + DescribeDBEngineVersions(context.Context, *DescribeDBEngineVersionsInput, ...func(*Options)) (*DescribeDBEngineVersionsOutput, error) +} + +var _ DescribeDBEngineVersionsAPIClient = (*Client)(nil) + +// DescribeDBEngineVersionsPaginatorOptions is the paginator options for +// DescribeDBEngineVersions +type DescribeDBEngineVersionsPaginatorOptions struct { + // The maximum number of records to include in the response. If more than the + // MaxRecords value is available, a pagination token called a marker is included in + // the response so that the following results can be retrieved. Default: 100 + // Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeDBEngineVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/neptune.DescribeDBEngineVersions +type DescribeDBEngineVersionsPaginator struct { + options DescribeDBEngineVersionsPaginatorOptions + client DescribeDBEngineVersionsAPIClient + params *DescribeDBEngineVersionsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeDBEngineVersionsPaginator returns a new +// DescribeDBEngineVersionsPaginator +func NewDescribeDBEngineVersionsPaginator(client DescribeDBEngineVersionsAPIClient, params *DescribeDBEngineVersionsInput, optFns ...func(*DescribeDBEngineVersionsPaginatorOptions)) *DescribeDBEngineVersionsPaginator { + options := DescribeDBEngineVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeDBEngineVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBEngineVersionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeDBEngineVersions page. +func (p *DescribeDBEngineVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBEngineVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeDBEngineVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeEventSubscriptionsAPIClient is a client that implements the +// DescribeEventSubscriptions operation. +type DescribeEventSubscriptionsAPIClient interface { + DescribeEventSubscriptions(context.Context, *DescribeEventSubscriptionsInput, ...func(*Options)) (*DescribeEventSubscriptionsOutput, error) +} + +var _ DescribeEventSubscriptionsAPIClient = (*Client)(nil) + +// DescribeEventSubscriptionsPaginatorOptions is the paginator options for +// DescribeEventSubscriptions +type DescribeEventSubscriptionsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeEventSubscriptionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/neptune.DescribeEventSubscriptions +type DescribeEventSubscriptionsPaginator struct { + options DescribeEventSubscriptionsPaginatorOptions + client DescribeEventSubscriptionsAPIClient + params *DescribeEventSubscriptionsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeEventSubscriptionsPaginator returns a new +// DescribeEventSubscriptionsPaginator +func NewDescribeEventSubscriptionsPaginator(client DescribeEventSubscriptionsAPIClient, params *DescribeEventSubscriptionsInput, optFns ...func(*DescribeEventSubscriptionsPaginatorOptions)) *DescribeEventSubscriptionsPaginator { + options := DescribeEventSubscriptionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeEventSubscriptionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEventSubscriptionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeEventSubscriptions page. +func (p *DescribeEventSubscriptionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEventSubscriptionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeEventSubscriptions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeEventsAPIClient is a client that implements the DescribeEvents +// operation. +type DescribeEventsAPIClient interface { + DescribeEvents(context.Context, *DescribeEventsInput, ...func(*Options)) (*DescribeEventsOutput, error) +} + +var _ DescribeEventsAPIClient = (*Client)(nil) + +// DescribeEventsPaginatorOptions is the paginator options for DescribeEvents +type DescribeEventsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeEventsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/neptune.DescribeEvents +type DescribeEventsPaginator struct { + options DescribeEventsPaginatorOptions + client DescribeEventsAPIClient + params *DescribeEventsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeEventsPaginator returns a new DescribeEventsPaginator +func NewDescribeEventsPaginator(client DescribeEventsAPIClient, params *DescribeEventsInput, optFns ...func(*DescribeEventsPaginatorOptions)) *DescribeEventsPaginator { + options := DescribeEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeEventsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEventsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeEvents page. +func (p *DescribeEventsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEventsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeEvents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeDBSubnetGroupsAPIClient is a client that implements the +// DescribeDBSubnetGroups operation. +type DescribeDBSubnetGroupsAPIClient interface { + DescribeDBSubnetGroups(context.Context, *DescribeDBSubnetGroupsInput, ...func(*Options)) (*DescribeDBSubnetGroupsOutput, error) +} + +var _ DescribeDBSubnetGroupsAPIClient = (*Client)(nil) + +// DescribeDBSubnetGroupsPaginatorOptions is the paginator options for +// DescribeDBSubnetGroups +type DescribeDBSubnetGroupsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeDBSubnetGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/neptune.DescribeDBSubnetGroups +type DescribeDBSubnetGroupsPaginator struct { + options DescribeDBSubnetGroupsPaginatorOptions + client DescribeDBSubnetGroupsAPIClient + params *DescribeDBSubnetGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeDBSubnetGroupsPaginator returns a new DescribeDBSubnetGroupsPaginator +func NewDescribeDBSubnetGroupsPaginator(client DescribeDBSubnetGroupsAPIClient, params *DescribeDBSubnetGroupsInput, optFns ...func(*DescribeDBSubnetGroupsPaginatorOptions)) *DescribeDBSubnetGroupsPaginator { + options := DescribeDBSubnetGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeDBSubnetGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBSubnetGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeDBSubnetGroups page. +func (p *DescribeDBSubnetGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBSubnetGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeDBSubnetGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeDBParametersAPIClient is a client that implements the +// DescribeDBParameters operation. +type DescribeDBParametersAPIClient interface { + DescribeDBParameters(context.Context, *DescribeDBParametersInput, ...func(*Options)) (*DescribeDBParametersOutput, error) +} + +var _ DescribeDBParametersAPIClient = (*Client)(nil) + +// DescribeDBParametersPaginatorOptions is the paginator options for +// DescribeDBParameters +type DescribeDBParametersPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeDBParametersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/neptune.DescribeDBParameters +type DescribeDBParametersPaginator struct { + options DescribeDBParametersPaginatorOptions + client DescribeDBParametersAPIClient + params *DescribeDBParametersInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeDBParametersPaginator returns a new DescribeDBParametersPaginator +func NewDescribeDBParametersPaginator(client DescribeDBParametersAPIClient, params *DescribeDBParametersInput, optFns ...func(*DescribeDBParametersPaginatorOptions)) *DescribeDBParametersPaginator { + options := DescribeDBParametersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeDBParametersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBParametersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeDBParameters page. +func (p *DescribeDBParametersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBParametersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeDBParameters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeDBInstancesAPIClient is a client that implements the DescribeDBInstances +// operation. +type DescribeDBInstancesAPIClient interface { + DescribeDBInstances(context.Context, *DescribeDBInstancesInput, ...func(*Options)) (*DescribeDBInstancesOutput, error) +} + +var _ DescribeDBInstancesAPIClient = (*Client)(nil) + +// DescribeDBInstancesPaginatorOptions is the paginator options for +// DescribeDBInstances +type DescribeDBInstancesPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeDBInstancesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/neptune.DescribeDBInstances +type DescribeDBInstancesPaginator struct { + options DescribeDBInstancesPaginatorOptions + client DescribeDBInstancesAPIClient + params *DescribeDBInstancesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeDBInstancesPaginator returns a new DescribeDBInstancesPaginator +func NewDescribeDBInstancesPaginator(client DescribeDBInstancesAPIClient, params *DescribeDBInstancesInput, optFns ...func(*DescribeDBInstancesPaginatorOptions)) *DescribeDBInstancesPaginator { + options := DescribeDBInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeDBInstancesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBInstancesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeDBInstances page. +func (p *DescribeDBInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBInstancesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeDBInstances(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeEngineDefaultParametersAPIClient is a client that implements the +// DescribeEngineDefaultParameters operation. +type DescribeEngineDefaultParametersAPIClient interface { + DescribeEngineDefaultParameters(context.Context, *DescribeEngineDefaultParametersInput, ...func(*Options)) (*DescribeEngineDefaultParametersOutput, error) +} + +var _ DescribeEngineDefaultParametersAPIClient = (*Client)(nil) + +// DescribeEngineDefaultParametersPaginatorOptions is the paginator options for +// DescribeEngineDefaultParameters +type DescribeEngineDefaultParametersPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeEngineDefaultParametersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/neptune.DescribeEngineDefaultParameters +type DescribeEngineDefaultParametersPaginator struct { + options DescribeEngineDefaultParametersPaginatorOptions + client DescribeEngineDefaultParametersAPIClient + params *DescribeEngineDefaultParametersInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeEngineDefaultParametersPaginator returns a new +// DescribeEngineDefaultParametersPaginator +func NewDescribeEngineDefaultParametersPaginator(client DescribeEngineDefaultParametersAPIClient, params *DescribeEngineDefaultParametersInput, optFns ...func(*DescribeEngineDefaultParametersPaginatorOptions)) *DescribeEngineDefaultParametersPaginator { + options := DescribeEngineDefaultParametersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeEngineDefaultParametersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEngineDefaultParametersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeEngineDefaultParameters page. +func (p *DescribeEngineDefaultParametersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEngineDefaultParametersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeEngineDefaultParameters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + if result.EngineDefaults != nil { + p.nextToken = result.EngineDefaults.Marker + } + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeOrderableDBInstanceOptionsAPIClient is a client that implements the +// DescribeOrderableDBInstanceOptions operation. +type DescribeOrderableDBInstanceOptionsAPIClient interface { + DescribeOrderableDBInstanceOptions(context.Context, *DescribeOrderableDBInstanceOptionsInput, ...func(*Options)) (*DescribeOrderableDBInstanceOptionsOutput, error) +} + +var _ DescribeOrderableDBInstanceOptionsAPIClient = (*Client)(nil) + +// DescribeOrderableDBInstanceOptionsPaginatorOptions is the paginator options for +// DescribeOrderableDBInstanceOptions +type DescribeOrderableDBInstanceOptionsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeOrderableDBInstanceOptionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/neptune.DescribeOrderableDBInstanceOptions +type DescribeOrderableDBInstanceOptionsPaginator struct { + options DescribeOrderableDBInstanceOptionsPaginatorOptions + client DescribeOrderableDBInstanceOptionsAPIClient + params *DescribeOrderableDBInstanceOptionsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeOrderableDBInstanceOptionsPaginator returns a new +// DescribeOrderableDBInstanceOptionsPaginator +func NewDescribeOrderableDBInstanceOptionsPaginator(client DescribeOrderableDBInstanceOptionsAPIClient, params *DescribeOrderableDBInstanceOptionsInput, optFns ...func(*DescribeOrderableDBInstanceOptionsPaginatorOptions)) *DescribeOrderableDBInstanceOptionsPaginator { + options := DescribeOrderableDBInstanceOptionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeOrderableDBInstanceOptionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeOrderableDBInstanceOptionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeOrderableDBInstanceOptions page. +func (p *DescribeOrderableDBInstanceOptionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeOrderableDBInstanceOptionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeOrderableDBInstanceOptions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/networkmanager/go.sum b/service/networkmanager/go.sum index c669e324b14..32595049f96 100644 --- a/service/networkmanager/go.sum +++ b/service/networkmanager/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/networkmanager/paginators.go b/service/networkmanager/paginators.go new file mode 100644 index 00000000000..79a8215bec9 --- /dev/null +++ b/service/networkmanager/paginators.go @@ -0,0 +1,536 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package networkmanager + +import ( + "context" + "fmt" +) + +// GetLinksAPIClient is a client that implements the GetLinks operation. +type GetLinksAPIClient interface { + GetLinks(context.Context, *GetLinksInput, ...func(*Options)) (*GetLinksOutput, error) +} + +var _ GetLinksAPIClient = (*Client)(nil) + +// GetLinksPaginatorOptions is the paginator options for GetLinks +type GetLinksPaginatorOptions struct { + // The maximum number of results to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetLinksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/networkmanager.GetLinks +type GetLinksPaginator struct { + options GetLinksPaginatorOptions + client GetLinksAPIClient + params *GetLinksInput + nextToken *string + firstPage bool + done bool +} + +// NewGetLinksPaginator returns a new GetLinksPaginator +func NewGetLinksPaginator(client GetLinksAPIClient, params *GetLinksInput, optFns ...func(*GetLinksPaginatorOptions)) *GetLinksPaginator { + options := GetLinksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetLinksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetLinksPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetLinks page. +func (p *GetLinksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetLinksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetLinks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeGlobalNetworksAPIClient is a client that implements the +// DescribeGlobalNetworks operation. +type DescribeGlobalNetworksAPIClient interface { + DescribeGlobalNetworks(context.Context, *DescribeGlobalNetworksInput, ...func(*Options)) (*DescribeGlobalNetworksOutput, error) +} + +var _ DescribeGlobalNetworksAPIClient = (*Client)(nil) + +// DescribeGlobalNetworksPaginatorOptions is the paginator options for +// DescribeGlobalNetworks +type DescribeGlobalNetworksPaginatorOptions struct { + // The maximum number of results to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeGlobalNetworksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/networkmanager.DescribeGlobalNetworks +type DescribeGlobalNetworksPaginator struct { + options DescribeGlobalNetworksPaginatorOptions + client DescribeGlobalNetworksAPIClient + params *DescribeGlobalNetworksInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeGlobalNetworksPaginator returns a new DescribeGlobalNetworksPaginator +func NewDescribeGlobalNetworksPaginator(client DescribeGlobalNetworksAPIClient, params *DescribeGlobalNetworksInput, optFns ...func(*DescribeGlobalNetworksPaginatorOptions)) *DescribeGlobalNetworksPaginator { + options := DescribeGlobalNetworksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeGlobalNetworksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeGlobalNetworksPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeGlobalNetworks page. +func (p *DescribeGlobalNetworksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeGlobalNetworksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeGlobalNetworks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetSitesAPIClient is a client that implements the GetSites operation. +type GetSitesAPIClient interface { + GetSites(context.Context, *GetSitesInput, ...func(*Options)) (*GetSitesOutput, error) +} + +var _ GetSitesAPIClient = (*Client)(nil) + +// GetSitesPaginatorOptions is the paginator options for GetSites +type GetSitesPaginatorOptions struct { + // The maximum number of results to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetSitesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/networkmanager.GetSites +type GetSitesPaginator struct { + options GetSitesPaginatorOptions + client GetSitesAPIClient + params *GetSitesInput + nextToken *string + firstPage bool + done bool +} + +// NewGetSitesPaginator returns a new GetSitesPaginator +func NewGetSitesPaginator(client GetSitesAPIClient, params *GetSitesInput, optFns ...func(*GetSitesPaginatorOptions)) *GetSitesPaginator { + options := GetSitesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetSitesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetSitesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetSites page. +func (p *GetSitesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetSitesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetSites(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetCustomerGatewayAssociationsAPIClient is a client that implements the +// GetCustomerGatewayAssociations operation. +type GetCustomerGatewayAssociationsAPIClient interface { + GetCustomerGatewayAssociations(context.Context, *GetCustomerGatewayAssociationsInput, ...func(*Options)) (*GetCustomerGatewayAssociationsOutput, error) +} + +var _ GetCustomerGatewayAssociationsAPIClient = (*Client)(nil) + +// GetCustomerGatewayAssociationsPaginatorOptions is the paginator options for +// GetCustomerGatewayAssociations +type GetCustomerGatewayAssociationsPaginatorOptions struct { + // The maximum number of results to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetCustomerGatewayAssociationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/networkmanager.GetCustomerGatewayAssociations +type GetCustomerGatewayAssociationsPaginator struct { + options GetCustomerGatewayAssociationsPaginatorOptions + client GetCustomerGatewayAssociationsAPIClient + params *GetCustomerGatewayAssociationsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetCustomerGatewayAssociationsPaginator returns a new +// GetCustomerGatewayAssociationsPaginator +func NewGetCustomerGatewayAssociationsPaginator(client GetCustomerGatewayAssociationsAPIClient, params *GetCustomerGatewayAssociationsInput, optFns ...func(*GetCustomerGatewayAssociationsPaginatorOptions)) *GetCustomerGatewayAssociationsPaginator { + options := GetCustomerGatewayAssociationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetCustomerGatewayAssociationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetCustomerGatewayAssociationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetCustomerGatewayAssociations page. +func (p *GetCustomerGatewayAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetCustomerGatewayAssociationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetCustomerGatewayAssociations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetTransitGatewayRegistrationsAPIClient is a client that implements the +// GetTransitGatewayRegistrations operation. +type GetTransitGatewayRegistrationsAPIClient interface { + GetTransitGatewayRegistrations(context.Context, *GetTransitGatewayRegistrationsInput, ...func(*Options)) (*GetTransitGatewayRegistrationsOutput, error) +} + +var _ GetTransitGatewayRegistrationsAPIClient = (*Client)(nil) + +// GetTransitGatewayRegistrationsPaginatorOptions is the paginator options for +// GetTransitGatewayRegistrations +type GetTransitGatewayRegistrationsPaginatorOptions struct { + // The maximum number of results to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetTransitGatewayRegistrationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/networkmanager.GetTransitGatewayRegistrations +type GetTransitGatewayRegistrationsPaginator struct { + options GetTransitGatewayRegistrationsPaginatorOptions + client GetTransitGatewayRegistrationsAPIClient + params *GetTransitGatewayRegistrationsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetTransitGatewayRegistrationsPaginator returns a new +// GetTransitGatewayRegistrationsPaginator +func NewGetTransitGatewayRegistrationsPaginator(client GetTransitGatewayRegistrationsAPIClient, params *GetTransitGatewayRegistrationsInput, optFns ...func(*GetTransitGatewayRegistrationsPaginatorOptions)) *GetTransitGatewayRegistrationsPaginator { + options := GetTransitGatewayRegistrationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetTransitGatewayRegistrationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetTransitGatewayRegistrationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetTransitGatewayRegistrations page. +func (p *GetTransitGatewayRegistrationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetTransitGatewayRegistrationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetTransitGatewayRegistrations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetDevicesAPIClient is a client that implements the GetDevices operation. +type GetDevicesAPIClient interface { + GetDevices(context.Context, *GetDevicesInput, ...func(*Options)) (*GetDevicesOutput, error) +} + +var _ GetDevicesAPIClient = (*Client)(nil) + +// GetDevicesPaginatorOptions is the paginator options for GetDevices +type GetDevicesPaginatorOptions struct { + // The maximum number of results to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetDevicesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/networkmanager.GetDevices +type GetDevicesPaginator struct { + options GetDevicesPaginatorOptions + client GetDevicesAPIClient + params *GetDevicesInput + nextToken *string + firstPage bool + done bool +} + +// NewGetDevicesPaginator returns a new GetDevicesPaginator +func NewGetDevicesPaginator(client GetDevicesAPIClient, params *GetDevicesInput, optFns ...func(*GetDevicesPaginatorOptions)) *GetDevicesPaginator { + options := GetDevicesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetDevicesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetDevicesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetDevices page. +func (p *GetDevicesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetDevicesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetDevices(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetLinkAssociationsAPIClient is a client that implements the GetLinkAssociations +// operation. +type GetLinkAssociationsAPIClient interface { + GetLinkAssociations(context.Context, *GetLinkAssociationsInput, ...func(*Options)) (*GetLinkAssociationsOutput, error) +} + +var _ GetLinkAssociationsAPIClient = (*Client)(nil) + +// GetLinkAssociationsPaginatorOptions is the paginator options for +// GetLinkAssociations +type GetLinkAssociationsPaginatorOptions struct { + // The maximum number of results to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetLinkAssociationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/networkmanager.GetLinkAssociations +type GetLinkAssociationsPaginator struct { + options GetLinkAssociationsPaginatorOptions + client GetLinkAssociationsAPIClient + params *GetLinkAssociationsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetLinkAssociationsPaginator returns a new GetLinkAssociationsPaginator +func NewGetLinkAssociationsPaginator(client GetLinkAssociationsAPIClient, params *GetLinkAssociationsInput, optFns ...func(*GetLinkAssociationsPaginatorOptions)) *GetLinkAssociationsPaginator { + options := GetLinkAssociationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetLinkAssociationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetLinkAssociationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetLinkAssociations page. +func (p *GetLinkAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetLinkAssociationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetLinkAssociations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/opsworks/go.sum b/service/opsworks/go.sum index c669e324b14..32595049f96 100644 --- a/service/opsworks/go.sum +++ b/service/opsworks/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/opsworks/paginators.go b/service/opsworks/paginators.go new file mode 100644 index 00000000000..e34f09b85a6 --- /dev/null +++ b/service/opsworks/paginators.go @@ -0,0 +1,87 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package opsworks + +import ( + "context" + "fmt" +) + +// DescribeEcsClustersAPIClient is a client that implements the DescribeEcsClusters +// operation. +type DescribeEcsClustersAPIClient interface { + DescribeEcsClusters(context.Context, *DescribeEcsClustersInput, ...func(*Options)) (*DescribeEcsClustersOutput, error) +} + +var _ DescribeEcsClustersAPIClient = (*Client)(nil) + +// DescribeEcsClustersPaginatorOptions is the paginator options for +// DescribeEcsClusters +type DescribeEcsClustersPaginatorOptions struct { + // To receive a paginated response, use this parameter to specify the maximum + // number of results to be returned with a single call. If the number of available + // results exceeds this maximum, the response includes a NextToken value that you + // can assign to the NextToken request parameter to get the next set of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeEcsClustersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/opsworks.DescribeEcsClusters +type DescribeEcsClustersPaginator struct { + options DescribeEcsClustersPaginatorOptions + client DescribeEcsClustersAPIClient + params *DescribeEcsClustersInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeEcsClustersPaginator returns a new DescribeEcsClustersPaginator +func NewDescribeEcsClustersPaginator(client DescribeEcsClustersAPIClient, params *DescribeEcsClustersInput, optFns ...func(*DescribeEcsClustersPaginatorOptions)) *DescribeEcsClustersPaginator { + options := DescribeEcsClustersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeEcsClustersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEcsClustersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeEcsClusters page. +func (p *DescribeEcsClustersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEcsClustersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeEcsClusters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/opsworkscm/go.sum b/service/opsworkscm/go.sum index c669e324b14..32595049f96 100644 --- a/service/opsworkscm/go.sum +++ b/service/opsworkscm/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/opsworkscm/paginators.go b/service/opsworkscm/paginators.go new file mode 100644 index 00000000000..8a1f6985c72 --- /dev/null +++ b/service/opsworkscm/paginators.go @@ -0,0 +1,315 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package opsworkscm + +import ( + "context" + "fmt" +) + +// ListTagsForResourceAPIClient is a client that implements the ListTagsForResource +// operation. +type ListTagsForResourceAPIClient interface { + ListTagsForResource(context.Context, *ListTagsForResourceInput, ...func(*Options)) (*ListTagsForResourceOutput, error) +} + +var _ ListTagsForResourceAPIClient = (*Client)(nil) + +// ListTagsForResourcePaginatorOptions is the paginator options for +// ListTagsForResource +type ListTagsForResourcePaginatorOptions struct { + // To receive a paginated response, use this parameter to specify the maximum + // number of results to be returned with a single call. If the number of available + // results exceeds this maximum, the response includes a NextToken value that you + // can assign to the NextToken request parameter to get the next set of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTagsForResourcePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/opsworkscm.ListTagsForResource +type ListTagsForResourcePaginator struct { + options ListTagsForResourcePaginatorOptions + client ListTagsForResourceAPIClient + params *ListTagsForResourceInput + nextToken *string + firstPage bool + done bool +} + +// NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator +func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator { + options := ListTagsForResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTagsForResourcePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTagsForResourcePaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTagsForResource page. +func (p *ListTagsForResourcePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListTagsForResource(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeEventsAPIClient is a client that implements the DescribeEvents +// operation. +type DescribeEventsAPIClient interface { + DescribeEvents(context.Context, *DescribeEventsInput, ...func(*Options)) (*DescribeEventsOutput, error) +} + +var _ DescribeEventsAPIClient = (*Client)(nil) + +// DescribeEventsPaginatorOptions is the paginator options for DescribeEvents +type DescribeEventsPaginatorOptions struct { + // To receive a paginated response, use this parameter to specify the maximum + // number of results to be returned with a single call. If the number of available + // results exceeds this maximum, the response includes a NextToken value that you + // can assign to the NextToken request parameter to get the next set of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeEventsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/opsworkscm.DescribeEvents +type DescribeEventsPaginator struct { + options DescribeEventsPaginatorOptions + client DescribeEventsAPIClient + params *DescribeEventsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeEventsPaginator returns a new DescribeEventsPaginator +func NewDescribeEventsPaginator(client DescribeEventsAPIClient, params *DescribeEventsInput, optFns ...func(*DescribeEventsPaginatorOptions)) *DescribeEventsPaginator { + options := DescribeEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeEventsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEventsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeEvents page. +func (p *DescribeEventsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEventsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeEvents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeServersAPIClient is a client that implements the DescribeServers +// operation. +type DescribeServersAPIClient interface { + DescribeServers(context.Context, *DescribeServersInput, ...func(*Options)) (*DescribeServersOutput, error) +} + +var _ DescribeServersAPIClient = (*Client)(nil) + +// DescribeServersPaginatorOptions is the paginator options for DescribeServers +type DescribeServersPaginatorOptions struct { + // This is not currently implemented for DescribeServers requests. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeServersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/opsworkscm.DescribeServers +type DescribeServersPaginator struct { + options DescribeServersPaginatorOptions + client DescribeServersAPIClient + params *DescribeServersInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeServersPaginator returns a new DescribeServersPaginator +func NewDescribeServersPaginator(client DescribeServersAPIClient, params *DescribeServersInput, optFns ...func(*DescribeServersPaginatorOptions)) *DescribeServersPaginator { + options := DescribeServersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeServersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeServersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeServers page. +func (p *DescribeServersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeServersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeServers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeBackupsAPIClient is a client that implements the DescribeBackups +// operation. +type DescribeBackupsAPIClient interface { + DescribeBackups(context.Context, *DescribeBackupsInput, ...func(*Options)) (*DescribeBackupsOutput, error) +} + +var _ DescribeBackupsAPIClient = (*Client)(nil) + +// DescribeBackupsPaginatorOptions is the paginator options for DescribeBackups +type DescribeBackupsPaginatorOptions struct { + // This is not currently implemented for DescribeBackups requests. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeBackupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/opsworkscm.DescribeBackups +type DescribeBackupsPaginator struct { + options DescribeBackupsPaginatorOptions + client DescribeBackupsAPIClient + params *DescribeBackupsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeBackupsPaginator returns a new DescribeBackupsPaginator +func NewDescribeBackupsPaginator(client DescribeBackupsAPIClient, params *DescribeBackupsInput, optFns ...func(*DescribeBackupsPaginatorOptions)) *DescribeBackupsPaginator { + options := DescribeBackupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeBackupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeBackupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeBackups page. +func (p *DescribeBackupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeBackupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeBackups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/organizations/go.sum b/service/organizations/go.sum index c669e324b14..32595049f96 100644 --- a/service/organizations/go.sum +++ b/service/organizations/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/organizations/paginators.go b/service/organizations/paginators.go new file mode 100644 index 00000000000..12dd19d4b0d --- /dev/null +++ b/service/organizations/paginators.go @@ -0,0 +1,1337 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package organizations + +import ( + "context" + "fmt" +) + +// ListHandshakesForOrganizationAPIClient is a client that implements the +// ListHandshakesForOrganization operation. +type ListHandshakesForOrganizationAPIClient interface { + ListHandshakesForOrganization(context.Context, *ListHandshakesForOrganizationInput, ...func(*Options)) (*ListHandshakesForOrganizationOutput, error) +} + +var _ ListHandshakesForOrganizationAPIClient = (*Client)(nil) + +// ListHandshakesForOrganizationPaginatorOptions is the paginator options for +// ListHandshakesForOrganization +type ListHandshakesForOrganizationPaginatorOptions struct { + // The total number of results that you want included on each page of the response. + // If you do not include this parameter, it defaults to a value that is specific to + // the operation. If additional items exist beyond the maximum you specify, the + // NextToken response element is present and has a value (is not null). Include + // that value as the NextToken request parameter in the next call to the operation + // to get the next part of the results. Note that Organizations might return fewer + // results than the maximum even when there are more results available. You should + // check NextToken after every operation to ensure that you receive all of the + // results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListHandshakesForOrganizationPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/organizations.ListHandshakesForOrganization +type ListHandshakesForOrganizationPaginator struct { + options ListHandshakesForOrganizationPaginatorOptions + client ListHandshakesForOrganizationAPIClient + params *ListHandshakesForOrganizationInput + nextToken *string + firstPage bool + done bool +} + +// NewListHandshakesForOrganizationPaginator returns a new +// ListHandshakesForOrganizationPaginator +func NewListHandshakesForOrganizationPaginator(client ListHandshakesForOrganizationAPIClient, params *ListHandshakesForOrganizationInput, optFns ...func(*ListHandshakesForOrganizationPaginatorOptions)) *ListHandshakesForOrganizationPaginator { + options := ListHandshakesForOrganizationPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListHandshakesForOrganizationPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListHandshakesForOrganizationPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListHandshakesForOrganization page. +func (p *ListHandshakesForOrganizationPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListHandshakesForOrganizationOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListHandshakesForOrganization(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDelegatedServicesForAccountAPIClient is a client that implements the +// ListDelegatedServicesForAccount operation. +type ListDelegatedServicesForAccountAPIClient interface { + ListDelegatedServicesForAccount(context.Context, *ListDelegatedServicesForAccountInput, ...func(*Options)) (*ListDelegatedServicesForAccountOutput, error) +} + +var _ ListDelegatedServicesForAccountAPIClient = (*Client)(nil) + +// ListDelegatedServicesForAccountPaginatorOptions is the paginator options for +// ListDelegatedServicesForAccount +type ListDelegatedServicesForAccountPaginatorOptions struct { + // The total number of results that you want included on each page of the response. + // If you do not include this parameter, it defaults to a value that is specific to + // the operation. If additional items exist beyond the maximum you specify, the + // NextToken response element is present and has a value (is not null). Include + // that value as the NextToken request parameter in the next call to the operation + // to get the next part of the results. Note that Organizations might return fewer + // results than the maximum even when there are more results available. You should + // check NextToken after every operation to ensure that you receive all of the + // results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDelegatedServicesForAccountPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/organizations.ListDelegatedServicesForAccount +type ListDelegatedServicesForAccountPaginator struct { + options ListDelegatedServicesForAccountPaginatorOptions + client ListDelegatedServicesForAccountAPIClient + params *ListDelegatedServicesForAccountInput + nextToken *string + firstPage bool + done bool +} + +// NewListDelegatedServicesForAccountPaginator returns a new +// ListDelegatedServicesForAccountPaginator +func NewListDelegatedServicesForAccountPaginator(client ListDelegatedServicesForAccountAPIClient, params *ListDelegatedServicesForAccountInput, optFns ...func(*ListDelegatedServicesForAccountPaginatorOptions)) *ListDelegatedServicesForAccountPaginator { + options := ListDelegatedServicesForAccountPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDelegatedServicesForAccountPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDelegatedServicesForAccountPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDelegatedServicesForAccount page. +func (p *ListDelegatedServicesForAccountPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDelegatedServicesForAccountOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListDelegatedServicesForAccount(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListPoliciesAPIClient is a client that implements the ListPolicies operation. +type ListPoliciesAPIClient interface { + ListPolicies(context.Context, *ListPoliciesInput, ...func(*Options)) (*ListPoliciesOutput, error) +} + +var _ ListPoliciesAPIClient = (*Client)(nil) + +// ListPoliciesPaginatorOptions is the paginator options for ListPolicies +type ListPoliciesPaginatorOptions struct { + // The total number of results that you want included on each page of the response. + // If you do not include this parameter, it defaults to a value that is specific to + // the operation. If additional items exist beyond the maximum you specify, the + // NextToken response element is present and has a value (is not null). Include + // that value as the NextToken request parameter in the next call to the operation + // to get the next part of the results. Note that Organizations might return fewer + // results than the maximum even when there are more results available. You should + // check NextToken after every operation to ensure that you receive all of the + // results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListPoliciesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/organizations.ListPolicies +type ListPoliciesPaginator struct { + options ListPoliciesPaginatorOptions + client ListPoliciesAPIClient + params *ListPoliciesInput + nextToken *string + firstPage bool + done bool +} + +// NewListPoliciesPaginator returns a new ListPoliciesPaginator +func NewListPoliciesPaginator(client ListPoliciesAPIClient, params *ListPoliciesInput, optFns ...func(*ListPoliciesPaginatorOptions)) *ListPoliciesPaginator { + options := ListPoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListPoliciesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPoliciesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListPolicies page. +func (p *ListPoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPoliciesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListPolicies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListOrganizationalUnitsForParentAPIClient is a client that implements the +// ListOrganizationalUnitsForParent operation. +type ListOrganizationalUnitsForParentAPIClient interface { + ListOrganizationalUnitsForParent(context.Context, *ListOrganizationalUnitsForParentInput, ...func(*Options)) (*ListOrganizationalUnitsForParentOutput, error) +} + +var _ ListOrganizationalUnitsForParentAPIClient = (*Client)(nil) + +// ListOrganizationalUnitsForParentPaginatorOptions is the paginator options for +// ListOrganizationalUnitsForParent +type ListOrganizationalUnitsForParentPaginatorOptions struct { + // The total number of results that you want included on each page of the response. + // If you do not include this parameter, it defaults to a value that is specific to + // the operation. If additional items exist beyond the maximum you specify, the + // NextToken response element is present and has a value (is not null). Include + // that value as the NextToken request parameter in the next call to the operation + // to get the next part of the results. Note that Organizations might return fewer + // results than the maximum even when there are more results available. You should + // check NextToken after every operation to ensure that you receive all of the + // results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListOrganizationalUnitsForParentPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/organizations.ListOrganizationalUnitsForParent +type ListOrganizationalUnitsForParentPaginator struct { + options ListOrganizationalUnitsForParentPaginatorOptions + client ListOrganizationalUnitsForParentAPIClient + params *ListOrganizationalUnitsForParentInput + nextToken *string + firstPage bool + done bool +} + +// NewListOrganizationalUnitsForParentPaginator returns a new +// ListOrganizationalUnitsForParentPaginator +func NewListOrganizationalUnitsForParentPaginator(client ListOrganizationalUnitsForParentAPIClient, params *ListOrganizationalUnitsForParentInput, optFns ...func(*ListOrganizationalUnitsForParentPaginatorOptions)) *ListOrganizationalUnitsForParentPaginator { + options := ListOrganizationalUnitsForParentPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListOrganizationalUnitsForParentPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListOrganizationalUnitsForParentPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListOrganizationalUnitsForParent page. +func (p *ListOrganizationalUnitsForParentPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListOrganizationalUnitsForParentOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListOrganizationalUnitsForParent(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListPoliciesForTargetAPIClient is a client that implements the +// ListPoliciesForTarget operation. +type ListPoliciesForTargetAPIClient interface { + ListPoliciesForTarget(context.Context, *ListPoliciesForTargetInput, ...func(*Options)) (*ListPoliciesForTargetOutput, error) +} + +var _ ListPoliciesForTargetAPIClient = (*Client)(nil) + +// ListPoliciesForTargetPaginatorOptions is the paginator options for +// ListPoliciesForTarget +type ListPoliciesForTargetPaginatorOptions struct { + // The total number of results that you want included on each page of the response. + // If you do not include this parameter, it defaults to a value that is specific to + // the operation. If additional items exist beyond the maximum you specify, the + // NextToken response element is present and has a value (is not null). Include + // that value as the NextToken request parameter in the next call to the operation + // to get the next part of the results. Note that Organizations might return fewer + // results than the maximum even when there are more results available. You should + // check NextToken after every operation to ensure that you receive all of the + // results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListPoliciesForTargetPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/organizations.ListPoliciesForTarget +type ListPoliciesForTargetPaginator struct { + options ListPoliciesForTargetPaginatorOptions + client ListPoliciesForTargetAPIClient + params *ListPoliciesForTargetInput + nextToken *string + firstPage bool + done bool +} + +// NewListPoliciesForTargetPaginator returns a new ListPoliciesForTargetPaginator +func NewListPoliciesForTargetPaginator(client ListPoliciesForTargetAPIClient, params *ListPoliciesForTargetInput, optFns ...func(*ListPoliciesForTargetPaginatorOptions)) *ListPoliciesForTargetPaginator { + options := ListPoliciesForTargetPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListPoliciesForTargetPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPoliciesForTargetPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListPoliciesForTarget page. +func (p *ListPoliciesForTargetPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPoliciesForTargetOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListPoliciesForTarget(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListAWSServiceAccessForOrganizationAPIClient is a client that implements the +// ListAWSServiceAccessForOrganization operation. +type ListAWSServiceAccessForOrganizationAPIClient interface { + ListAWSServiceAccessForOrganization(context.Context, *ListAWSServiceAccessForOrganizationInput, ...func(*Options)) (*ListAWSServiceAccessForOrganizationOutput, error) +} + +var _ ListAWSServiceAccessForOrganizationAPIClient = (*Client)(nil) + +// ListAWSServiceAccessForOrganizationPaginatorOptions is the paginator options for +// ListAWSServiceAccessForOrganization +type ListAWSServiceAccessForOrganizationPaginatorOptions struct { + // The total number of results that you want included on each page of the response. + // If you do not include this parameter, it defaults to a value that is specific to + // the operation. If additional items exist beyond the maximum you specify, the + // NextToken response element is present and has a value (is not null). Include + // that value as the NextToken request parameter in the next call to the operation + // to get the next part of the results. Note that Organizations might return fewer + // results than the maximum even when there are more results available. You should + // check NextToken after every operation to ensure that you receive all of the + // results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAWSServiceAccessForOrganizationPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/organizations.ListAWSServiceAccessForOrganization +type ListAWSServiceAccessForOrganizationPaginator struct { + options ListAWSServiceAccessForOrganizationPaginatorOptions + client ListAWSServiceAccessForOrganizationAPIClient + params *ListAWSServiceAccessForOrganizationInput + nextToken *string + firstPage bool + done bool +} + +// NewListAWSServiceAccessForOrganizationPaginator returns a new +// ListAWSServiceAccessForOrganizationPaginator +func NewListAWSServiceAccessForOrganizationPaginator(client ListAWSServiceAccessForOrganizationAPIClient, params *ListAWSServiceAccessForOrganizationInput, optFns ...func(*ListAWSServiceAccessForOrganizationPaginatorOptions)) *ListAWSServiceAccessForOrganizationPaginator { + options := ListAWSServiceAccessForOrganizationPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAWSServiceAccessForOrganizationPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAWSServiceAccessForOrganizationPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAWSServiceAccessForOrganization page. +func (p *ListAWSServiceAccessForOrganizationPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAWSServiceAccessForOrganizationOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListAWSServiceAccessForOrganization(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListParentsAPIClient is a client that implements the ListParents operation. +type ListParentsAPIClient interface { + ListParents(context.Context, *ListParentsInput, ...func(*Options)) (*ListParentsOutput, error) +} + +var _ ListParentsAPIClient = (*Client)(nil) + +// ListParentsPaginatorOptions is the paginator options for ListParents +type ListParentsPaginatorOptions struct { + // The total number of results that you want included on each page of the response. + // If you do not include this parameter, it defaults to a value that is specific to + // the operation. If additional items exist beyond the maximum you specify, the + // NextToken response element is present and has a value (is not null). Include + // that value as the NextToken request parameter in the next call to the operation + // to get the next part of the results. Note that Organizations might return fewer + // results than the maximum even when there are more results available. You should + // check NextToken after every operation to ensure that you receive all of the + // results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListParentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/organizations.ListParents +type ListParentsPaginator struct { + options ListParentsPaginatorOptions + client ListParentsAPIClient + params *ListParentsInput + nextToken *string + firstPage bool + done bool +} + +// NewListParentsPaginator returns a new ListParentsPaginator +func NewListParentsPaginator(client ListParentsAPIClient, params *ListParentsInput, optFns ...func(*ListParentsPaginatorOptions)) *ListParentsPaginator { + options := ListParentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListParentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListParentsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListParents page. +func (p *ListParentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListParentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListParents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListChildrenAPIClient is a client that implements the ListChildren operation. +type ListChildrenAPIClient interface { + ListChildren(context.Context, *ListChildrenInput, ...func(*Options)) (*ListChildrenOutput, error) +} + +var _ ListChildrenAPIClient = (*Client)(nil) + +// ListChildrenPaginatorOptions is the paginator options for ListChildren +type ListChildrenPaginatorOptions struct { + // The total number of results that you want included on each page of the response. + // If you do not include this parameter, it defaults to a value that is specific to + // the operation. If additional items exist beyond the maximum you specify, the + // NextToken response element is present and has a value (is not null). Include + // that value as the NextToken request parameter in the next call to the operation + // to get the next part of the results. Note that Organizations might return fewer + // results than the maximum even when there are more results available. You should + // check NextToken after every operation to ensure that you receive all of the + // results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListChildrenPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/organizations.ListChildren +type ListChildrenPaginator struct { + options ListChildrenPaginatorOptions + client ListChildrenAPIClient + params *ListChildrenInput + nextToken *string + firstPage bool + done bool +} + +// NewListChildrenPaginator returns a new ListChildrenPaginator +func NewListChildrenPaginator(client ListChildrenAPIClient, params *ListChildrenInput, optFns ...func(*ListChildrenPaginatorOptions)) *ListChildrenPaginator { + options := ListChildrenPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListChildrenPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListChildrenPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListChildren page. +func (p *ListChildrenPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListChildrenOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListChildren(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTargetsForPolicyAPIClient is a client that implements the +// ListTargetsForPolicy operation. +type ListTargetsForPolicyAPIClient interface { + ListTargetsForPolicy(context.Context, *ListTargetsForPolicyInput, ...func(*Options)) (*ListTargetsForPolicyOutput, error) +} + +var _ ListTargetsForPolicyAPIClient = (*Client)(nil) + +// ListTargetsForPolicyPaginatorOptions is the paginator options for +// ListTargetsForPolicy +type ListTargetsForPolicyPaginatorOptions struct { + // The total number of results that you want included on each page of the response. + // If you do not include this parameter, it defaults to a value that is specific to + // the operation. If additional items exist beyond the maximum you specify, the + // NextToken response element is present and has a value (is not null). Include + // that value as the NextToken request parameter in the next call to the operation + // to get the next part of the results. Note that Organizations might return fewer + // results than the maximum even when there are more results available. You should + // check NextToken after every operation to ensure that you receive all of the + // results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTargetsForPolicyPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/organizations.ListTargetsForPolicy +type ListTargetsForPolicyPaginator struct { + options ListTargetsForPolicyPaginatorOptions + client ListTargetsForPolicyAPIClient + params *ListTargetsForPolicyInput + nextToken *string + firstPage bool + done bool +} + +// NewListTargetsForPolicyPaginator returns a new ListTargetsForPolicyPaginator +func NewListTargetsForPolicyPaginator(client ListTargetsForPolicyAPIClient, params *ListTargetsForPolicyInput, optFns ...func(*ListTargetsForPolicyPaginatorOptions)) *ListTargetsForPolicyPaginator { + options := ListTargetsForPolicyPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTargetsForPolicyPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTargetsForPolicyPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTargetsForPolicy page. +func (p *ListTargetsForPolicyPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTargetsForPolicyOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListTargetsForPolicy(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListRootsAPIClient is a client that implements the ListRoots operation. +type ListRootsAPIClient interface { + ListRoots(context.Context, *ListRootsInput, ...func(*Options)) (*ListRootsOutput, error) +} + +var _ ListRootsAPIClient = (*Client)(nil) + +// ListRootsPaginatorOptions is the paginator options for ListRoots +type ListRootsPaginatorOptions struct { + // The total number of results that you want included on each page of the response. + // If you do not include this parameter, it defaults to a value that is specific to + // the operation. If additional items exist beyond the maximum you specify, the + // NextToken response element is present and has a value (is not null). Include + // that value as the NextToken request parameter in the next call to the operation + // to get the next part of the results. Note that Organizations might return fewer + // results than the maximum even when there are more results available. You should + // check NextToken after every operation to ensure that you receive all of the + // results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListRootsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/organizations.ListRoots +type ListRootsPaginator struct { + options ListRootsPaginatorOptions + client ListRootsAPIClient + params *ListRootsInput + nextToken *string + firstPage bool + done bool +} + +// NewListRootsPaginator returns a new ListRootsPaginator +func NewListRootsPaginator(client ListRootsAPIClient, params *ListRootsInput, optFns ...func(*ListRootsPaginatorOptions)) *ListRootsPaginator { + options := ListRootsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListRootsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRootsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListRoots page. +func (p *ListRootsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRootsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListRoots(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListCreateAccountStatusAPIClient is a client that implements the +// ListCreateAccountStatus operation. +type ListCreateAccountStatusAPIClient interface { + ListCreateAccountStatus(context.Context, *ListCreateAccountStatusInput, ...func(*Options)) (*ListCreateAccountStatusOutput, error) +} + +var _ ListCreateAccountStatusAPIClient = (*Client)(nil) + +// ListCreateAccountStatusPaginatorOptions is the paginator options for +// ListCreateAccountStatus +type ListCreateAccountStatusPaginatorOptions struct { + // The total number of results that you want included on each page of the response. + // If you do not include this parameter, it defaults to a value that is specific to + // the operation. If additional items exist beyond the maximum you specify, the + // NextToken response element is present and has a value (is not null). Include + // that value as the NextToken request parameter in the next call to the operation + // to get the next part of the results. Note that Organizations might return fewer + // results than the maximum even when there are more results available. You should + // check NextToken after every operation to ensure that you receive all of the + // results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListCreateAccountStatusPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/organizations.ListCreateAccountStatus +type ListCreateAccountStatusPaginator struct { + options ListCreateAccountStatusPaginatorOptions + client ListCreateAccountStatusAPIClient + params *ListCreateAccountStatusInput + nextToken *string + firstPage bool + done bool +} + +// NewListCreateAccountStatusPaginator returns a new +// ListCreateAccountStatusPaginator +func NewListCreateAccountStatusPaginator(client ListCreateAccountStatusAPIClient, params *ListCreateAccountStatusInput, optFns ...func(*ListCreateAccountStatusPaginatorOptions)) *ListCreateAccountStatusPaginator { + options := ListCreateAccountStatusPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListCreateAccountStatusPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCreateAccountStatusPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListCreateAccountStatus page. +func (p *ListCreateAccountStatusPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCreateAccountStatusOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListCreateAccountStatus(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListHandshakesForAccountAPIClient is a client that implements the +// ListHandshakesForAccount operation. +type ListHandshakesForAccountAPIClient interface { + ListHandshakesForAccount(context.Context, *ListHandshakesForAccountInput, ...func(*Options)) (*ListHandshakesForAccountOutput, error) +} + +var _ ListHandshakesForAccountAPIClient = (*Client)(nil) + +// ListHandshakesForAccountPaginatorOptions is the paginator options for +// ListHandshakesForAccount +type ListHandshakesForAccountPaginatorOptions struct { + // The total number of results that you want included on each page of the response. + // If you do not include this parameter, it defaults to a value that is specific to + // the operation. If additional items exist beyond the maximum you specify, the + // NextToken response element is present and has a value (is not null). Include + // that value as the NextToken request parameter in the next call to the operation + // to get the next part of the results. Note that Organizations might return fewer + // results than the maximum even when there are more results available. You should + // check NextToken after every operation to ensure that you receive all of the + // results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListHandshakesForAccountPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/organizations.ListHandshakesForAccount +type ListHandshakesForAccountPaginator struct { + options ListHandshakesForAccountPaginatorOptions + client ListHandshakesForAccountAPIClient + params *ListHandshakesForAccountInput + nextToken *string + firstPage bool + done bool +} + +// NewListHandshakesForAccountPaginator returns a new +// ListHandshakesForAccountPaginator +func NewListHandshakesForAccountPaginator(client ListHandshakesForAccountAPIClient, params *ListHandshakesForAccountInput, optFns ...func(*ListHandshakesForAccountPaginatorOptions)) *ListHandshakesForAccountPaginator { + options := ListHandshakesForAccountPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListHandshakesForAccountPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListHandshakesForAccountPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListHandshakesForAccount page. +func (p *ListHandshakesForAccountPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListHandshakesForAccountOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListHandshakesForAccount(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDelegatedAdministratorsAPIClient is a client that implements the +// ListDelegatedAdministrators operation. +type ListDelegatedAdministratorsAPIClient interface { + ListDelegatedAdministrators(context.Context, *ListDelegatedAdministratorsInput, ...func(*Options)) (*ListDelegatedAdministratorsOutput, error) +} + +var _ ListDelegatedAdministratorsAPIClient = (*Client)(nil) + +// ListDelegatedAdministratorsPaginatorOptions is the paginator options for +// ListDelegatedAdministrators +type ListDelegatedAdministratorsPaginatorOptions struct { + // The total number of results that you want included on each page of the response. + // If you do not include this parameter, it defaults to a value that is specific to + // the operation. If additional items exist beyond the maximum you specify, the + // NextToken response element is present and has a value (is not null). Include + // that value as the NextToken request parameter in the next call to the operation + // to get the next part of the results. Note that Organizations might return fewer + // results than the maximum even when there are more results available. You should + // check NextToken after every operation to ensure that you receive all of the + // results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDelegatedAdministratorsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/organizations.ListDelegatedAdministrators +type ListDelegatedAdministratorsPaginator struct { + options ListDelegatedAdministratorsPaginatorOptions + client ListDelegatedAdministratorsAPIClient + params *ListDelegatedAdministratorsInput + nextToken *string + firstPage bool + done bool +} + +// NewListDelegatedAdministratorsPaginator returns a new +// ListDelegatedAdministratorsPaginator +func NewListDelegatedAdministratorsPaginator(client ListDelegatedAdministratorsAPIClient, params *ListDelegatedAdministratorsInput, optFns ...func(*ListDelegatedAdministratorsPaginatorOptions)) *ListDelegatedAdministratorsPaginator { + options := ListDelegatedAdministratorsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDelegatedAdministratorsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDelegatedAdministratorsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDelegatedAdministrators page. +func (p *ListDelegatedAdministratorsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDelegatedAdministratorsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListDelegatedAdministrators(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListAccountsAPIClient is a client that implements the ListAccounts operation. +type ListAccountsAPIClient interface { + ListAccounts(context.Context, *ListAccountsInput, ...func(*Options)) (*ListAccountsOutput, error) +} + +var _ ListAccountsAPIClient = (*Client)(nil) + +// ListAccountsPaginatorOptions is the paginator options for ListAccounts +type ListAccountsPaginatorOptions struct { + // The total number of results that you want included on each page of the response. + // If you do not include this parameter, it defaults to a value that is specific to + // the operation. If additional items exist beyond the maximum you specify, the + // NextToken response element is present and has a value (is not null). Include + // that value as the NextToken request parameter in the next call to the operation + // to get the next part of the results. Note that Organizations might return fewer + // results than the maximum even when there are more results available. You should + // check NextToken after every operation to ensure that you receive all of the + // results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAccountsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/organizations.ListAccounts +type ListAccountsPaginator struct { + options ListAccountsPaginatorOptions + client ListAccountsAPIClient + params *ListAccountsInput + nextToken *string + firstPage bool + done bool +} + +// NewListAccountsPaginator returns a new ListAccountsPaginator +func NewListAccountsPaginator(client ListAccountsAPIClient, params *ListAccountsInput, optFns ...func(*ListAccountsPaginatorOptions)) *ListAccountsPaginator { + options := ListAccountsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAccountsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAccountsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAccounts page. +func (p *ListAccountsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccountsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListAccounts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListAccountsForParentAPIClient is a client that implements the +// ListAccountsForParent operation. +type ListAccountsForParentAPIClient interface { + ListAccountsForParent(context.Context, *ListAccountsForParentInput, ...func(*Options)) (*ListAccountsForParentOutput, error) +} + +var _ ListAccountsForParentAPIClient = (*Client)(nil) + +// ListAccountsForParentPaginatorOptions is the paginator options for +// ListAccountsForParent +type ListAccountsForParentPaginatorOptions struct { + // The total number of results that you want included on each page of the response. + // If you do not include this parameter, it defaults to a value that is specific to + // the operation. If additional items exist beyond the maximum you specify, the + // NextToken response element is present and has a value (is not null). Include + // that value as the NextToken request parameter in the next call to the operation + // to get the next part of the results. Note that Organizations might return fewer + // results than the maximum even when there are more results available. You should + // check NextToken after every operation to ensure that you receive all of the + // results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAccountsForParentPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/organizations.ListAccountsForParent +type ListAccountsForParentPaginator struct { + options ListAccountsForParentPaginatorOptions + client ListAccountsForParentAPIClient + params *ListAccountsForParentInput + nextToken *string + firstPage bool + done bool +} + +// NewListAccountsForParentPaginator returns a new ListAccountsForParentPaginator +func NewListAccountsForParentPaginator(client ListAccountsForParentAPIClient, params *ListAccountsForParentInput, optFns ...func(*ListAccountsForParentPaginatorOptions)) *ListAccountsForParentPaginator { + options := ListAccountsForParentPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAccountsForParentPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAccountsForParentPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAccountsForParent page. +func (p *ListAccountsForParentPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccountsForParentOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListAccountsForParent(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTagsForResourceAPIClient is a client that implements the ListTagsForResource +// operation. +type ListTagsForResourceAPIClient interface { + ListTagsForResource(context.Context, *ListTagsForResourceInput, ...func(*Options)) (*ListTagsForResourceOutput, error) +} + +var _ ListTagsForResourceAPIClient = (*Client)(nil) + +// ListTagsForResourcePaginatorOptions is the paginator options for +// ListTagsForResource +type ListTagsForResourcePaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTagsForResourcePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/organizations.ListTagsForResource +type ListTagsForResourcePaginator struct { + options ListTagsForResourcePaginatorOptions + client ListTagsForResourceAPIClient + params *ListTagsForResourceInput + nextToken *string + firstPage bool + done bool +} + +// NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator +func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator { + options := ListTagsForResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTagsForResourcePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTagsForResourcePaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTagsForResource page. +func (p *ListTagsForResourcePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListTagsForResource(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/outposts/go.sum b/service/outposts/go.sum index c669e324b14..32595049f96 100644 --- a/service/outposts/go.sum +++ b/service/outposts/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/outposts/paginators.go b/service/outposts/paginators.go new file mode 100644 index 00000000000..80c079b3b6a --- /dev/null +++ b/service/outposts/paginators.go @@ -0,0 +1,156 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package outposts + +import ( + "context" + "fmt" +) + +// ListSitesAPIClient is a client that implements the ListSites operation. +type ListSitesAPIClient interface { + ListSites(context.Context, *ListSitesInput, ...func(*Options)) (*ListSitesOutput, error) +} + +var _ ListSitesAPIClient = (*Client)(nil) + +// ListSitesPaginatorOptions is the paginator options for ListSites +type ListSitesPaginatorOptions struct { + // The maximum page size. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListSitesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/outposts.ListSites +type ListSitesPaginator struct { + options ListSitesPaginatorOptions + client ListSitesAPIClient + params *ListSitesInput + nextToken *string + firstPage bool + done bool +} + +// NewListSitesPaginator returns a new ListSitesPaginator +func NewListSitesPaginator(client ListSitesAPIClient, params *ListSitesInput, optFns ...func(*ListSitesPaginatorOptions)) *ListSitesPaginator { + options := ListSitesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListSitesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSitesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListSites page. +func (p *ListSitesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSitesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListSites(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListOutpostsAPIClient is a client that implements the ListOutposts operation. +type ListOutpostsAPIClient interface { + ListOutposts(context.Context, *ListOutpostsInput, ...func(*Options)) (*ListOutpostsOutput, error) +} + +var _ ListOutpostsAPIClient = (*Client)(nil) + +// ListOutpostsPaginatorOptions is the paginator options for ListOutposts +type ListOutpostsPaginatorOptions struct { + // The maximum page size. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListOutpostsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/outposts.ListOutposts +type ListOutpostsPaginator struct { + options ListOutpostsPaginatorOptions + client ListOutpostsAPIClient + params *ListOutpostsInput + nextToken *string + firstPage bool + done bool +} + +// NewListOutpostsPaginator returns a new ListOutpostsPaginator +func NewListOutpostsPaginator(client ListOutpostsAPIClient, params *ListOutpostsInput, optFns ...func(*ListOutpostsPaginatorOptions)) *ListOutpostsPaginator { + options := ListOutpostsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListOutpostsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListOutpostsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListOutposts page. +func (p *ListOutpostsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListOutpostsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListOutposts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/personalize/go.sum b/service/personalize/go.sum index c669e324b14..32595049f96 100644 --- a/service/personalize/go.sum +++ b/service/personalize/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/personalize/paginators.go b/service/personalize/paginators.go new file mode 100644 index 00000000000..beb981a5ae3 --- /dev/null +++ b/service/personalize/paginators.go @@ -0,0 +1,757 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package personalize + +import ( + "context" + "fmt" +) + +// ListCampaignsAPIClient is a client that implements the ListCampaigns operation. +type ListCampaignsAPIClient interface { + ListCampaigns(context.Context, *ListCampaignsInput, ...func(*Options)) (*ListCampaignsOutput, error) +} + +var _ ListCampaignsAPIClient = (*Client)(nil) + +// ListCampaignsPaginatorOptions is the paginator options for ListCampaigns +type ListCampaignsPaginatorOptions struct { + // The maximum number of campaigns to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListCampaignsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/personalize.ListCampaigns +type ListCampaignsPaginator struct { + options ListCampaignsPaginatorOptions + client ListCampaignsAPIClient + params *ListCampaignsInput + nextToken *string + firstPage bool + done bool +} + +// NewListCampaignsPaginator returns a new ListCampaignsPaginator +func NewListCampaignsPaginator(client ListCampaignsAPIClient, params *ListCampaignsInput, optFns ...func(*ListCampaignsPaginatorOptions)) *ListCampaignsPaginator { + options := ListCampaignsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListCampaignsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCampaignsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListCampaigns page. +func (p *ListCampaignsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCampaignsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListCampaigns(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDatasetGroupsAPIClient is a client that implements the ListDatasetGroups +// operation. +type ListDatasetGroupsAPIClient interface { + ListDatasetGroups(context.Context, *ListDatasetGroupsInput, ...func(*Options)) (*ListDatasetGroupsOutput, error) +} + +var _ ListDatasetGroupsAPIClient = (*Client)(nil) + +// ListDatasetGroupsPaginatorOptions is the paginator options for ListDatasetGroups +type ListDatasetGroupsPaginatorOptions struct { + // The maximum number of dataset groups to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDatasetGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/personalize.ListDatasetGroups +type ListDatasetGroupsPaginator struct { + options ListDatasetGroupsPaginatorOptions + client ListDatasetGroupsAPIClient + params *ListDatasetGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewListDatasetGroupsPaginator returns a new ListDatasetGroupsPaginator +func NewListDatasetGroupsPaginator(client ListDatasetGroupsAPIClient, params *ListDatasetGroupsInput, optFns ...func(*ListDatasetGroupsPaginatorOptions)) *ListDatasetGroupsPaginator { + options := ListDatasetGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDatasetGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDatasetGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDatasetGroups page. +func (p *ListDatasetGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDatasetGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListDatasetGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListRecipesAPIClient is a client that implements the ListRecipes operation. +type ListRecipesAPIClient interface { + ListRecipes(context.Context, *ListRecipesInput, ...func(*Options)) (*ListRecipesOutput, error) +} + +var _ ListRecipesAPIClient = (*Client)(nil) + +// ListRecipesPaginatorOptions is the paginator options for ListRecipes +type ListRecipesPaginatorOptions struct { + // The maximum number of recipes to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListRecipesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/personalize.ListRecipes +type ListRecipesPaginator struct { + options ListRecipesPaginatorOptions + client ListRecipesAPIClient + params *ListRecipesInput + nextToken *string + firstPage bool + done bool +} + +// NewListRecipesPaginator returns a new ListRecipesPaginator +func NewListRecipesPaginator(client ListRecipesAPIClient, params *ListRecipesInput, optFns ...func(*ListRecipesPaginatorOptions)) *ListRecipesPaginator { + options := ListRecipesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListRecipesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRecipesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListRecipes page. +func (p *ListRecipesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRecipesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListRecipes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListEventTrackersAPIClient is a client that implements the ListEventTrackers +// operation. +type ListEventTrackersAPIClient interface { + ListEventTrackers(context.Context, *ListEventTrackersInput, ...func(*Options)) (*ListEventTrackersOutput, error) +} + +var _ ListEventTrackersAPIClient = (*Client)(nil) + +// ListEventTrackersPaginatorOptions is the paginator options for ListEventTrackers +type ListEventTrackersPaginatorOptions struct { + // The maximum number of event trackers to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListEventTrackersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/personalize.ListEventTrackers +type ListEventTrackersPaginator struct { + options ListEventTrackersPaginatorOptions + client ListEventTrackersAPIClient + params *ListEventTrackersInput + nextToken *string + firstPage bool + done bool +} + +// NewListEventTrackersPaginator returns a new ListEventTrackersPaginator +func NewListEventTrackersPaginator(client ListEventTrackersAPIClient, params *ListEventTrackersInput, optFns ...func(*ListEventTrackersPaginatorOptions)) *ListEventTrackersPaginator { + options := ListEventTrackersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListEventTrackersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListEventTrackersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListEventTrackers page. +func (p *ListEventTrackersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEventTrackersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListEventTrackers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListSolutionsAPIClient is a client that implements the ListSolutions operation. +type ListSolutionsAPIClient interface { + ListSolutions(context.Context, *ListSolutionsInput, ...func(*Options)) (*ListSolutionsOutput, error) +} + +var _ ListSolutionsAPIClient = (*Client)(nil) + +// ListSolutionsPaginatorOptions is the paginator options for ListSolutions +type ListSolutionsPaginatorOptions struct { + // The maximum number of solutions to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListSolutionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/personalize.ListSolutions +type ListSolutionsPaginator struct { + options ListSolutionsPaginatorOptions + client ListSolutionsAPIClient + params *ListSolutionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListSolutionsPaginator returns a new ListSolutionsPaginator +func NewListSolutionsPaginator(client ListSolutionsAPIClient, params *ListSolutionsInput, optFns ...func(*ListSolutionsPaginatorOptions)) *ListSolutionsPaginator { + options := ListSolutionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListSolutionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSolutionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListSolutions page. +func (p *ListSolutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSolutionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListSolutions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDatasetImportJobsAPIClient is a client that implements the +// ListDatasetImportJobs operation. +type ListDatasetImportJobsAPIClient interface { + ListDatasetImportJobs(context.Context, *ListDatasetImportJobsInput, ...func(*Options)) (*ListDatasetImportJobsOutput, error) +} + +var _ ListDatasetImportJobsAPIClient = (*Client)(nil) + +// ListDatasetImportJobsPaginatorOptions is the paginator options for +// ListDatasetImportJobs +type ListDatasetImportJobsPaginatorOptions struct { + // The maximum number of dataset import jobs to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDatasetImportJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/personalize.ListDatasetImportJobs +type ListDatasetImportJobsPaginator struct { + options ListDatasetImportJobsPaginatorOptions + client ListDatasetImportJobsAPIClient + params *ListDatasetImportJobsInput + nextToken *string + firstPage bool + done bool +} + +// NewListDatasetImportJobsPaginator returns a new ListDatasetImportJobsPaginator +func NewListDatasetImportJobsPaginator(client ListDatasetImportJobsAPIClient, params *ListDatasetImportJobsInput, optFns ...func(*ListDatasetImportJobsPaginatorOptions)) *ListDatasetImportJobsPaginator { + options := ListDatasetImportJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDatasetImportJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDatasetImportJobsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDatasetImportJobs page. +func (p *ListDatasetImportJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDatasetImportJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListDatasetImportJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListSchemasAPIClient is a client that implements the ListSchemas operation. +type ListSchemasAPIClient interface { + ListSchemas(context.Context, *ListSchemasInput, ...func(*Options)) (*ListSchemasOutput, error) +} + +var _ ListSchemasAPIClient = (*Client)(nil) + +// ListSchemasPaginatorOptions is the paginator options for ListSchemas +type ListSchemasPaginatorOptions struct { + // The maximum number of schemas to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListSchemasPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/personalize.ListSchemas +type ListSchemasPaginator struct { + options ListSchemasPaginatorOptions + client ListSchemasAPIClient + params *ListSchemasInput + nextToken *string + firstPage bool + done bool +} + +// NewListSchemasPaginator returns a new ListSchemasPaginator +func NewListSchemasPaginator(client ListSchemasAPIClient, params *ListSchemasInput, optFns ...func(*ListSchemasPaginatorOptions)) *ListSchemasPaginator { + options := ListSchemasPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListSchemasPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSchemasPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListSchemas page. +func (p *ListSchemasPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSchemasOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListSchemas(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListSolutionVersionsAPIClient is a client that implements the +// ListSolutionVersions operation. +type ListSolutionVersionsAPIClient interface { + ListSolutionVersions(context.Context, *ListSolutionVersionsInput, ...func(*Options)) (*ListSolutionVersionsOutput, error) +} + +var _ ListSolutionVersionsAPIClient = (*Client)(nil) + +// ListSolutionVersionsPaginatorOptions is the paginator options for +// ListSolutionVersions +type ListSolutionVersionsPaginatorOptions struct { + // The maximum number of solution versions to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListSolutionVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/personalize.ListSolutionVersions +type ListSolutionVersionsPaginator struct { + options ListSolutionVersionsPaginatorOptions + client ListSolutionVersionsAPIClient + params *ListSolutionVersionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListSolutionVersionsPaginator returns a new ListSolutionVersionsPaginator +func NewListSolutionVersionsPaginator(client ListSolutionVersionsAPIClient, params *ListSolutionVersionsInput, optFns ...func(*ListSolutionVersionsPaginatorOptions)) *ListSolutionVersionsPaginator { + options := ListSolutionVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListSolutionVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSolutionVersionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListSolutionVersions page. +func (p *ListSolutionVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSolutionVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListSolutionVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListBatchInferenceJobsAPIClient is a client that implements the +// ListBatchInferenceJobs operation. +type ListBatchInferenceJobsAPIClient interface { + ListBatchInferenceJobs(context.Context, *ListBatchInferenceJobsInput, ...func(*Options)) (*ListBatchInferenceJobsOutput, error) +} + +var _ ListBatchInferenceJobsAPIClient = (*Client)(nil) + +// ListBatchInferenceJobsPaginatorOptions is the paginator options for +// ListBatchInferenceJobs +type ListBatchInferenceJobsPaginatorOptions struct { + // The maximum number of batch inference job results to return in each page. The + // default value is 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListBatchInferenceJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/personalize.ListBatchInferenceJobs +type ListBatchInferenceJobsPaginator struct { + options ListBatchInferenceJobsPaginatorOptions + client ListBatchInferenceJobsAPIClient + params *ListBatchInferenceJobsInput + nextToken *string + firstPage bool + done bool +} + +// NewListBatchInferenceJobsPaginator returns a new ListBatchInferenceJobsPaginator +func NewListBatchInferenceJobsPaginator(client ListBatchInferenceJobsAPIClient, params *ListBatchInferenceJobsInput, optFns ...func(*ListBatchInferenceJobsPaginatorOptions)) *ListBatchInferenceJobsPaginator { + options := ListBatchInferenceJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListBatchInferenceJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListBatchInferenceJobsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListBatchInferenceJobs page. +func (p *ListBatchInferenceJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBatchInferenceJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListBatchInferenceJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDatasetsAPIClient is a client that implements the ListDatasets operation. +type ListDatasetsAPIClient interface { + ListDatasets(context.Context, *ListDatasetsInput, ...func(*Options)) (*ListDatasetsOutput, error) +} + +var _ ListDatasetsAPIClient = (*Client)(nil) + +// ListDatasetsPaginatorOptions is the paginator options for ListDatasets +type ListDatasetsPaginatorOptions struct { + // The maximum number of datasets to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDatasetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/personalize.ListDatasets +type ListDatasetsPaginator struct { + options ListDatasetsPaginatorOptions + client ListDatasetsAPIClient + params *ListDatasetsInput + nextToken *string + firstPage bool + done bool +} + +// NewListDatasetsPaginator returns a new ListDatasetsPaginator +func NewListDatasetsPaginator(client ListDatasetsAPIClient, params *ListDatasetsInput, optFns ...func(*ListDatasetsPaginatorOptions)) *ListDatasetsPaginator { + options := ListDatasetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDatasetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDatasetsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDatasets page. +func (p *ListDatasetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDatasetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListDatasets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/personalizeevents/go.sum b/service/personalizeevents/go.sum index c669e324b14..32595049f96 100644 --- a/service/personalizeevents/go.sum +++ b/service/personalizeevents/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/personalizeruntime/go.sum b/service/personalizeruntime/go.sum index c669e324b14..32595049f96 100644 --- a/service/personalizeruntime/go.sum +++ b/service/personalizeruntime/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/pi/go.sum b/service/pi/go.sum index c669e324b14..32595049f96 100644 --- a/service/pi/go.sum +++ b/service/pi/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/pinpoint/go.sum b/service/pinpoint/go.sum index c669e324b14..32595049f96 100644 --- a/service/pinpoint/go.sum +++ b/service/pinpoint/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/pinpointemail/go.sum b/service/pinpointemail/go.sum index c669e324b14..32595049f96 100644 --- a/service/pinpointemail/go.sum +++ b/service/pinpointemail/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/pinpointemail/paginators.go b/service/pinpointemail/paginators.go new file mode 100644 index 00000000000..f7495209434 --- /dev/null +++ b/service/pinpointemail/paginators.go @@ -0,0 +1,485 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package pinpointemail + +import ( + "context" + "fmt" +) + +// ListEmailIdentitiesAPIClient is a client that implements the ListEmailIdentities +// operation. +type ListEmailIdentitiesAPIClient interface { + ListEmailIdentities(context.Context, *ListEmailIdentitiesInput, ...func(*Options)) (*ListEmailIdentitiesOutput, error) +} + +var _ ListEmailIdentitiesAPIClient = (*Client)(nil) + +// ListEmailIdentitiesPaginatorOptions is the paginator options for +// ListEmailIdentities +type ListEmailIdentitiesPaginatorOptions struct { + // The number of results to show in a single call to ListEmailIdentities. If the + // number of results is larger than the number you specified in this parameter, + // then the response includes a NextToken element, which you can use to obtain + // additional results. The value you specify has to be at least 0, and can be no + // more than 1000. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListEmailIdentitiesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/pinpointemail.ListEmailIdentities +type ListEmailIdentitiesPaginator struct { + options ListEmailIdentitiesPaginatorOptions + client ListEmailIdentitiesAPIClient + params *ListEmailIdentitiesInput + nextToken *string + firstPage bool + done bool +} + +// NewListEmailIdentitiesPaginator returns a new ListEmailIdentitiesPaginator +func NewListEmailIdentitiesPaginator(client ListEmailIdentitiesAPIClient, params *ListEmailIdentitiesInput, optFns ...func(*ListEmailIdentitiesPaginatorOptions)) *ListEmailIdentitiesPaginator { + options := ListEmailIdentitiesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListEmailIdentitiesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListEmailIdentitiesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListEmailIdentities page. +func (p *ListEmailIdentitiesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEmailIdentitiesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.PageSize = p.options.Limit + result, err := p.client.ListEmailIdentities(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDomainDeliverabilityCampaignsAPIClient is a client that implements the +// ListDomainDeliverabilityCampaigns operation. +type ListDomainDeliverabilityCampaignsAPIClient interface { + ListDomainDeliverabilityCampaigns(context.Context, *ListDomainDeliverabilityCampaignsInput, ...func(*Options)) (*ListDomainDeliverabilityCampaignsOutput, error) +} + +var _ ListDomainDeliverabilityCampaignsAPIClient = (*Client)(nil) + +// ListDomainDeliverabilityCampaignsPaginatorOptions is the paginator options for +// ListDomainDeliverabilityCampaigns +type ListDomainDeliverabilityCampaignsPaginatorOptions struct { + // The maximum number of results to include in response to a single call to the + // ListDomainDeliverabilityCampaigns operation. If the number of results is larger + // than the number that you specify in this parameter, the response includes a + // NextToken element, which you can use to obtain additional results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDomainDeliverabilityCampaignsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/pinpointemail.ListDomainDeliverabilityCampaigns +type ListDomainDeliverabilityCampaignsPaginator struct { + options ListDomainDeliverabilityCampaignsPaginatorOptions + client ListDomainDeliverabilityCampaignsAPIClient + params *ListDomainDeliverabilityCampaignsInput + nextToken *string + firstPage bool + done bool +} + +// NewListDomainDeliverabilityCampaignsPaginator returns a new +// ListDomainDeliverabilityCampaignsPaginator +func NewListDomainDeliverabilityCampaignsPaginator(client ListDomainDeliverabilityCampaignsAPIClient, params *ListDomainDeliverabilityCampaignsInput, optFns ...func(*ListDomainDeliverabilityCampaignsPaginatorOptions)) *ListDomainDeliverabilityCampaignsPaginator { + options := ListDomainDeliverabilityCampaignsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDomainDeliverabilityCampaignsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDomainDeliverabilityCampaignsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDomainDeliverabilityCampaigns page. +func (p *ListDomainDeliverabilityCampaignsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDomainDeliverabilityCampaignsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.PageSize = p.options.Limit + result, err := p.client.ListDomainDeliverabilityCampaigns(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDedicatedIpPoolsAPIClient is a client that implements the +// ListDedicatedIpPools operation. +type ListDedicatedIpPoolsAPIClient interface { + ListDedicatedIpPools(context.Context, *ListDedicatedIpPoolsInput, ...func(*Options)) (*ListDedicatedIpPoolsOutput, error) +} + +var _ ListDedicatedIpPoolsAPIClient = (*Client)(nil) + +// ListDedicatedIpPoolsPaginatorOptions is the paginator options for +// ListDedicatedIpPools +type ListDedicatedIpPoolsPaginatorOptions struct { + // The number of results to show in a single call to ListDedicatedIpPools. If the + // number of results is larger than the number you specified in this parameter, + // then the response includes a NextToken element, which you can use to obtain + // additional results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDedicatedIpPoolsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/pinpointemail.ListDedicatedIpPools +type ListDedicatedIpPoolsPaginator struct { + options ListDedicatedIpPoolsPaginatorOptions + client ListDedicatedIpPoolsAPIClient + params *ListDedicatedIpPoolsInput + nextToken *string + firstPage bool + done bool +} + +// NewListDedicatedIpPoolsPaginator returns a new ListDedicatedIpPoolsPaginator +func NewListDedicatedIpPoolsPaginator(client ListDedicatedIpPoolsAPIClient, params *ListDedicatedIpPoolsInput, optFns ...func(*ListDedicatedIpPoolsPaginatorOptions)) *ListDedicatedIpPoolsPaginator { + options := ListDedicatedIpPoolsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDedicatedIpPoolsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDedicatedIpPoolsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDedicatedIpPools page. +func (p *ListDedicatedIpPoolsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDedicatedIpPoolsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.PageSize = p.options.Limit + result, err := p.client.ListDedicatedIpPools(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetDedicatedIpsAPIClient is a client that implements the GetDedicatedIps +// operation. +type GetDedicatedIpsAPIClient interface { + GetDedicatedIps(context.Context, *GetDedicatedIpsInput, ...func(*Options)) (*GetDedicatedIpsOutput, error) +} + +var _ GetDedicatedIpsAPIClient = (*Client)(nil) + +// GetDedicatedIpsPaginatorOptions is the paginator options for GetDedicatedIps +type GetDedicatedIpsPaginatorOptions struct { + // The number of results to show in a single call to GetDedicatedIpsRequest. If the + // number of results is larger than the number you specified in this parameter, + // then the response includes a NextToken element, which you can use to obtain + // additional results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetDedicatedIpsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/pinpointemail.GetDedicatedIps +type GetDedicatedIpsPaginator struct { + options GetDedicatedIpsPaginatorOptions + client GetDedicatedIpsAPIClient + params *GetDedicatedIpsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetDedicatedIpsPaginator returns a new GetDedicatedIpsPaginator +func NewGetDedicatedIpsPaginator(client GetDedicatedIpsAPIClient, params *GetDedicatedIpsInput, optFns ...func(*GetDedicatedIpsPaginatorOptions)) *GetDedicatedIpsPaginator { + options := GetDedicatedIpsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetDedicatedIpsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetDedicatedIpsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetDedicatedIps page. +func (p *GetDedicatedIpsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetDedicatedIpsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.PageSize = p.options.Limit + result, err := p.client.GetDedicatedIps(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListConfigurationSetsAPIClient is a client that implements the +// ListConfigurationSets operation. +type ListConfigurationSetsAPIClient interface { + ListConfigurationSets(context.Context, *ListConfigurationSetsInput, ...func(*Options)) (*ListConfigurationSetsOutput, error) +} + +var _ ListConfigurationSetsAPIClient = (*Client)(nil) + +// ListConfigurationSetsPaginatorOptions is the paginator options for +// ListConfigurationSets +type ListConfigurationSetsPaginatorOptions struct { + // The number of results to show in a single call to ListConfigurationSets. If the + // number of results is larger than the number you specified in this parameter, + // then the response includes a NextToken element, which you can use to obtain + // additional results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListConfigurationSetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/pinpointemail.ListConfigurationSets +type ListConfigurationSetsPaginator struct { + options ListConfigurationSetsPaginatorOptions + client ListConfigurationSetsAPIClient + params *ListConfigurationSetsInput + nextToken *string + firstPage bool + done bool +} + +// NewListConfigurationSetsPaginator returns a new ListConfigurationSetsPaginator +func NewListConfigurationSetsPaginator(client ListConfigurationSetsAPIClient, params *ListConfigurationSetsInput, optFns ...func(*ListConfigurationSetsPaginatorOptions)) *ListConfigurationSetsPaginator { + options := ListConfigurationSetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListConfigurationSetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListConfigurationSetsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListConfigurationSets page. +func (p *ListConfigurationSetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListConfigurationSetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.PageSize = p.options.Limit + result, err := p.client.ListConfigurationSets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDeliverabilityTestReportsAPIClient is a client that implements the +// ListDeliverabilityTestReports operation. +type ListDeliverabilityTestReportsAPIClient interface { + ListDeliverabilityTestReports(context.Context, *ListDeliverabilityTestReportsInput, ...func(*Options)) (*ListDeliverabilityTestReportsOutput, error) +} + +var _ ListDeliverabilityTestReportsAPIClient = (*Client)(nil) + +// ListDeliverabilityTestReportsPaginatorOptions is the paginator options for +// ListDeliverabilityTestReports +type ListDeliverabilityTestReportsPaginatorOptions struct { + // The number of results to show in a single call to ListDeliverabilityTestReports. + // If the number of results is larger than the number you specified in this + // parameter, then the response includes a NextToken element, which you can use to + // obtain additional results. The value you specify has to be at least 0, and can + // be no more than 1000. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDeliverabilityTestReportsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/pinpointemail.ListDeliverabilityTestReports +type ListDeliverabilityTestReportsPaginator struct { + options ListDeliverabilityTestReportsPaginatorOptions + client ListDeliverabilityTestReportsAPIClient + params *ListDeliverabilityTestReportsInput + nextToken *string + firstPage bool + done bool +} + +// NewListDeliverabilityTestReportsPaginator returns a new +// ListDeliverabilityTestReportsPaginator +func NewListDeliverabilityTestReportsPaginator(client ListDeliverabilityTestReportsAPIClient, params *ListDeliverabilityTestReportsInput, optFns ...func(*ListDeliverabilityTestReportsPaginatorOptions)) *ListDeliverabilityTestReportsPaginator { + options := ListDeliverabilityTestReportsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDeliverabilityTestReportsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDeliverabilityTestReportsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDeliverabilityTestReports page. +func (p *ListDeliverabilityTestReportsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDeliverabilityTestReportsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.PageSize = p.options.Limit + result, err := p.client.ListDeliverabilityTestReports(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/pinpointsmsvoice/go.sum b/service/pinpointsmsvoice/go.sum index c669e324b14..32595049f96 100644 --- a/service/pinpointsmsvoice/go.sum +++ b/service/pinpointsmsvoice/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/polly/go.sum b/service/polly/go.sum index c669e324b14..32595049f96 100644 --- a/service/polly/go.sum +++ b/service/polly/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/polly/paginators.go b/service/polly/paginators.go new file mode 100644 index 00000000000..d4d4d50ee6b --- /dev/null +++ b/service/polly/paginators.go @@ -0,0 +1,85 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package polly + +import ( + "context" + "fmt" +) + +// ListSpeechSynthesisTasksAPIClient is a client that implements the +// ListSpeechSynthesisTasks operation. +type ListSpeechSynthesisTasksAPIClient interface { + ListSpeechSynthesisTasks(context.Context, *ListSpeechSynthesisTasksInput, ...func(*Options)) (*ListSpeechSynthesisTasksOutput, error) +} + +var _ ListSpeechSynthesisTasksAPIClient = (*Client)(nil) + +// ListSpeechSynthesisTasksPaginatorOptions is the paginator options for +// ListSpeechSynthesisTasks +type ListSpeechSynthesisTasksPaginatorOptions struct { + // Maximum number of speech synthesis tasks returned in a List operation. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListSpeechSynthesisTasksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/polly.ListSpeechSynthesisTasks +type ListSpeechSynthesisTasksPaginator struct { + options ListSpeechSynthesisTasksPaginatorOptions + client ListSpeechSynthesisTasksAPIClient + params *ListSpeechSynthesisTasksInput + nextToken *string + firstPage bool + done bool +} + +// NewListSpeechSynthesisTasksPaginator returns a new +// ListSpeechSynthesisTasksPaginator +func NewListSpeechSynthesisTasksPaginator(client ListSpeechSynthesisTasksAPIClient, params *ListSpeechSynthesisTasksInput, optFns ...func(*ListSpeechSynthesisTasksPaginatorOptions)) *ListSpeechSynthesisTasksPaginator { + options := ListSpeechSynthesisTasksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListSpeechSynthesisTasksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSpeechSynthesisTasksPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListSpeechSynthesisTasks page. +func (p *ListSpeechSynthesisTasksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSpeechSynthesisTasksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListSpeechSynthesisTasks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/pricing/go.sum b/service/pricing/go.sum index c669e324b14..32595049f96 100644 --- a/service/pricing/go.sum +++ b/service/pricing/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/pricing/paginators.go b/service/pricing/paginators.go new file mode 100644 index 00000000000..9246a333d78 --- /dev/null +++ b/service/pricing/paginators.go @@ -0,0 +1,233 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package pricing + +import ( + "context" + "fmt" +) + +// GetProductsAPIClient is a client that implements the GetProducts operation. +type GetProductsAPIClient interface { + GetProducts(context.Context, *GetProductsInput, ...func(*Options)) (*GetProductsOutput, error) +} + +var _ GetProductsAPIClient = (*Client)(nil) + +// GetProductsPaginatorOptions is the paginator options for GetProducts +type GetProductsPaginatorOptions struct { + // The maximum number of results to return in the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetProductsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/pricing.GetProducts +type GetProductsPaginator struct { + options GetProductsPaginatorOptions + client GetProductsAPIClient + params *GetProductsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetProductsPaginator returns a new GetProductsPaginator +func NewGetProductsPaginator(client GetProductsAPIClient, params *GetProductsInput, optFns ...func(*GetProductsPaginatorOptions)) *GetProductsPaginator { + options := GetProductsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetProductsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetProductsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetProducts page. +func (p *GetProductsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetProductsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetProducts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeServicesAPIClient is a client that implements the DescribeServices +// operation. +type DescribeServicesAPIClient interface { + DescribeServices(context.Context, *DescribeServicesInput, ...func(*Options)) (*DescribeServicesOutput, error) +} + +var _ DescribeServicesAPIClient = (*Client)(nil) + +// DescribeServicesPaginatorOptions is the paginator options for DescribeServices +type DescribeServicesPaginatorOptions struct { + // The maximum number of results that you want returned in the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeServicesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/pricing.DescribeServices +type DescribeServicesPaginator struct { + options DescribeServicesPaginatorOptions + client DescribeServicesAPIClient + params *DescribeServicesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeServicesPaginator returns a new DescribeServicesPaginator +func NewDescribeServicesPaginator(client DescribeServicesAPIClient, params *DescribeServicesInput, optFns ...func(*DescribeServicesPaginatorOptions)) *DescribeServicesPaginator { + options := DescribeServicesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeServicesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeServicesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeServices page. +func (p *DescribeServicesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeServicesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeServices(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetAttributeValuesAPIClient is a client that implements the GetAttributeValues +// operation. +type GetAttributeValuesAPIClient interface { + GetAttributeValues(context.Context, *GetAttributeValuesInput, ...func(*Options)) (*GetAttributeValuesOutput, error) +} + +var _ GetAttributeValuesAPIClient = (*Client)(nil) + +// GetAttributeValuesPaginatorOptions is the paginator options for +// GetAttributeValues +type GetAttributeValuesPaginatorOptions struct { + // The maximum number of results to return in response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetAttributeValuesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/pricing.GetAttributeValues +type GetAttributeValuesPaginator struct { + options GetAttributeValuesPaginatorOptions + client GetAttributeValuesAPIClient + params *GetAttributeValuesInput + nextToken *string + firstPage bool + done bool +} + +// NewGetAttributeValuesPaginator returns a new GetAttributeValuesPaginator +func NewGetAttributeValuesPaginator(client GetAttributeValuesAPIClient, params *GetAttributeValuesInput, optFns ...func(*GetAttributeValuesPaginatorOptions)) *GetAttributeValuesPaginator { + options := GetAttributeValuesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetAttributeValuesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetAttributeValuesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetAttributeValues page. +func (p *GetAttributeValuesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetAttributeValuesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetAttributeValues(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/qldb/go.sum b/service/qldb/go.sum index c669e324b14..32595049f96 100644 --- a/service/qldb/go.sum +++ b/service/qldb/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/qldb/paginators.go b/service/qldb/paginators.go new file mode 100644 index 00000000000..a460aeb15bb --- /dev/null +++ b/service/qldb/paginators.go @@ -0,0 +1,318 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package qldb + +import ( + "context" + "fmt" +) + +// ListJournalS3ExportsAPIClient is a client that implements the +// ListJournalS3Exports operation. +type ListJournalS3ExportsAPIClient interface { + ListJournalS3Exports(context.Context, *ListJournalS3ExportsInput, ...func(*Options)) (*ListJournalS3ExportsOutput, error) +} + +var _ ListJournalS3ExportsAPIClient = (*Client)(nil) + +// ListJournalS3ExportsPaginatorOptions is the paginator options for +// ListJournalS3Exports +type ListJournalS3ExportsPaginatorOptions struct { + // The maximum number of results to return in a single ListJournalS3Exports + // request. (The actual number of results returned might be fewer.) + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListJournalS3ExportsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/qldb.ListJournalS3Exports +type ListJournalS3ExportsPaginator struct { + options ListJournalS3ExportsPaginatorOptions + client ListJournalS3ExportsAPIClient + params *ListJournalS3ExportsInput + nextToken *string + firstPage bool + done bool +} + +// NewListJournalS3ExportsPaginator returns a new ListJournalS3ExportsPaginator +func NewListJournalS3ExportsPaginator(client ListJournalS3ExportsAPIClient, params *ListJournalS3ExportsInput, optFns ...func(*ListJournalS3ExportsPaginatorOptions)) *ListJournalS3ExportsPaginator { + options := ListJournalS3ExportsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListJournalS3ExportsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListJournalS3ExportsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListJournalS3Exports page. +func (p *ListJournalS3ExportsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListJournalS3ExportsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListJournalS3Exports(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListJournalKinesisStreamsForLedgerAPIClient is a client that implements the +// ListJournalKinesisStreamsForLedger operation. +type ListJournalKinesisStreamsForLedgerAPIClient interface { + ListJournalKinesisStreamsForLedger(context.Context, *ListJournalKinesisStreamsForLedgerInput, ...func(*Options)) (*ListJournalKinesisStreamsForLedgerOutput, error) +} + +var _ ListJournalKinesisStreamsForLedgerAPIClient = (*Client)(nil) + +// ListJournalKinesisStreamsForLedgerPaginatorOptions is the paginator options for +// ListJournalKinesisStreamsForLedger +type ListJournalKinesisStreamsForLedgerPaginatorOptions struct { + // The maximum number of results to return in a single + // ListJournalKinesisStreamsForLedger request. (The actual number of results + // returned might be fewer.) + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListJournalKinesisStreamsForLedgerPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/qldb.ListJournalKinesisStreamsForLedger +type ListJournalKinesisStreamsForLedgerPaginator struct { + options ListJournalKinesisStreamsForLedgerPaginatorOptions + client ListJournalKinesisStreamsForLedgerAPIClient + params *ListJournalKinesisStreamsForLedgerInput + nextToken *string + firstPage bool + done bool +} + +// NewListJournalKinesisStreamsForLedgerPaginator returns a new +// ListJournalKinesisStreamsForLedgerPaginator +func NewListJournalKinesisStreamsForLedgerPaginator(client ListJournalKinesisStreamsForLedgerAPIClient, params *ListJournalKinesisStreamsForLedgerInput, optFns ...func(*ListJournalKinesisStreamsForLedgerPaginatorOptions)) *ListJournalKinesisStreamsForLedgerPaginator { + options := ListJournalKinesisStreamsForLedgerPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListJournalKinesisStreamsForLedgerPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListJournalKinesisStreamsForLedgerPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListJournalKinesisStreamsForLedger page. +func (p *ListJournalKinesisStreamsForLedgerPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListJournalKinesisStreamsForLedgerOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListJournalKinesisStreamsForLedger(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListJournalS3ExportsForLedgerAPIClient is a client that implements the +// ListJournalS3ExportsForLedger operation. +type ListJournalS3ExportsForLedgerAPIClient interface { + ListJournalS3ExportsForLedger(context.Context, *ListJournalS3ExportsForLedgerInput, ...func(*Options)) (*ListJournalS3ExportsForLedgerOutput, error) +} + +var _ ListJournalS3ExportsForLedgerAPIClient = (*Client)(nil) + +// ListJournalS3ExportsForLedgerPaginatorOptions is the paginator options for +// ListJournalS3ExportsForLedger +type ListJournalS3ExportsForLedgerPaginatorOptions struct { + // The maximum number of results to return in a single + // ListJournalS3ExportsForLedger request. (The actual number of results returned + // might be fewer.) + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListJournalS3ExportsForLedgerPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/qldb.ListJournalS3ExportsForLedger +type ListJournalS3ExportsForLedgerPaginator struct { + options ListJournalS3ExportsForLedgerPaginatorOptions + client ListJournalS3ExportsForLedgerAPIClient + params *ListJournalS3ExportsForLedgerInput + nextToken *string + firstPage bool + done bool +} + +// NewListJournalS3ExportsForLedgerPaginator returns a new +// ListJournalS3ExportsForLedgerPaginator +func NewListJournalS3ExportsForLedgerPaginator(client ListJournalS3ExportsForLedgerAPIClient, params *ListJournalS3ExportsForLedgerInput, optFns ...func(*ListJournalS3ExportsForLedgerPaginatorOptions)) *ListJournalS3ExportsForLedgerPaginator { + options := ListJournalS3ExportsForLedgerPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListJournalS3ExportsForLedgerPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListJournalS3ExportsForLedgerPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListJournalS3ExportsForLedger page. +func (p *ListJournalS3ExportsForLedgerPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListJournalS3ExportsForLedgerOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListJournalS3ExportsForLedger(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListLedgersAPIClient is a client that implements the ListLedgers operation. +type ListLedgersAPIClient interface { + ListLedgers(context.Context, *ListLedgersInput, ...func(*Options)) (*ListLedgersOutput, error) +} + +var _ ListLedgersAPIClient = (*Client)(nil) + +// ListLedgersPaginatorOptions is the paginator options for ListLedgers +type ListLedgersPaginatorOptions struct { + // The maximum number of results to return in a single ListLedgers request. (The + // actual number of results returned might be fewer.) + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListLedgersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/qldb.ListLedgers +type ListLedgersPaginator struct { + options ListLedgersPaginatorOptions + client ListLedgersAPIClient + params *ListLedgersInput + nextToken *string + firstPage bool + done bool +} + +// NewListLedgersPaginator returns a new ListLedgersPaginator +func NewListLedgersPaginator(client ListLedgersAPIClient, params *ListLedgersInput, optFns ...func(*ListLedgersPaginatorOptions)) *ListLedgersPaginator { + options := ListLedgersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListLedgersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListLedgersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListLedgers page. +func (p *ListLedgersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListLedgersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListLedgers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/qldbsession/go.sum b/service/qldbsession/go.sum index c669e324b14..32595049f96 100644 --- a/service/qldbsession/go.sum +++ b/service/qldbsession/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/quicksight/go.sum b/service/quicksight/go.sum index c669e324b14..32595049f96 100644 --- a/service/quicksight/go.sum +++ b/service/quicksight/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/quicksight/paginators.go b/service/quicksight/paginators.go new file mode 100644 index 00000000000..bbfe1c37450 --- /dev/null +++ b/service/quicksight/paginators.go @@ -0,0 +1,908 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package quicksight + +import ( + "context" + "fmt" +) + +// ListNamespacesAPIClient is a client that implements the ListNamespaces +// operation. +type ListNamespacesAPIClient interface { + ListNamespaces(context.Context, *ListNamespacesInput, ...func(*Options)) (*ListNamespacesOutput, error) +} + +var _ ListNamespacesAPIClient = (*Client)(nil) + +// ListNamespacesPaginatorOptions is the paginator options for ListNamespaces +type ListNamespacesPaginatorOptions struct { + // The maximum number of results to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListNamespacesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/quicksight.ListNamespaces +type ListNamespacesPaginator struct { + options ListNamespacesPaginatorOptions + client ListNamespacesAPIClient + params *ListNamespacesInput + nextToken *string + firstPage bool + done bool +} + +// NewListNamespacesPaginator returns a new ListNamespacesPaginator +func NewListNamespacesPaginator(client ListNamespacesAPIClient, params *ListNamespacesInput, optFns ...func(*ListNamespacesPaginatorOptions)) *ListNamespacesPaginator { + options := ListNamespacesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListNamespacesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListNamespacesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListNamespaces page. +func (p *ListNamespacesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListNamespacesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListNamespaces(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListAnalysesAPIClient is a client that implements the ListAnalyses operation. +type ListAnalysesAPIClient interface { + ListAnalyses(context.Context, *ListAnalysesInput, ...func(*Options)) (*ListAnalysesOutput, error) +} + +var _ ListAnalysesAPIClient = (*Client)(nil) + +// ListAnalysesPaginatorOptions is the paginator options for ListAnalyses +type ListAnalysesPaginatorOptions struct { + // The maximum number of results to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAnalysesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/quicksight.ListAnalyses +type ListAnalysesPaginator struct { + options ListAnalysesPaginatorOptions + client ListAnalysesAPIClient + params *ListAnalysesInput + nextToken *string + firstPage bool + done bool +} + +// NewListAnalysesPaginator returns a new ListAnalysesPaginator +func NewListAnalysesPaginator(client ListAnalysesAPIClient, params *ListAnalysesInput, optFns ...func(*ListAnalysesPaginatorOptions)) *ListAnalysesPaginator { + options := ListAnalysesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAnalysesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAnalysesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAnalyses page. +func (p *ListAnalysesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAnalysesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListAnalyses(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTemplatesAPIClient is a client that implements the ListTemplates operation. +type ListTemplatesAPIClient interface { + ListTemplates(context.Context, *ListTemplatesInput, ...func(*Options)) (*ListTemplatesOutput, error) +} + +var _ ListTemplatesAPIClient = (*Client)(nil) + +// ListTemplatesPaginatorOptions is the paginator options for ListTemplates +type ListTemplatesPaginatorOptions struct { + // The maximum number of results to be returned per request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTemplatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/quicksight.ListTemplates +type ListTemplatesPaginator struct { + options ListTemplatesPaginatorOptions + client ListTemplatesAPIClient + params *ListTemplatesInput + nextToken *string + firstPage bool + done bool +} + +// NewListTemplatesPaginator returns a new ListTemplatesPaginator +func NewListTemplatesPaginator(client ListTemplatesAPIClient, params *ListTemplatesInput, optFns ...func(*ListTemplatesPaginatorOptions)) *ListTemplatesPaginator { + options := ListTemplatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTemplatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTemplatesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTemplates page. +func (p *ListTemplatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTemplatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListTemplates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDashboardsAPIClient is a client that implements the ListDashboards +// operation. +type ListDashboardsAPIClient interface { + ListDashboards(context.Context, *ListDashboardsInput, ...func(*Options)) (*ListDashboardsOutput, error) +} + +var _ ListDashboardsAPIClient = (*Client)(nil) + +// ListDashboardsPaginatorOptions is the paginator options for ListDashboards +type ListDashboardsPaginatorOptions struct { + // The maximum number of results to be returned per request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDashboardsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/quicksight.ListDashboards +type ListDashboardsPaginator struct { + options ListDashboardsPaginatorOptions + client ListDashboardsAPIClient + params *ListDashboardsInput + nextToken *string + firstPage bool + done bool +} + +// NewListDashboardsPaginator returns a new ListDashboardsPaginator +func NewListDashboardsPaginator(client ListDashboardsAPIClient, params *ListDashboardsInput, optFns ...func(*ListDashboardsPaginatorOptions)) *ListDashboardsPaginator { + options := ListDashboardsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDashboardsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDashboardsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDashboards page. +func (p *ListDashboardsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDashboardsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListDashboards(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTemplateAliasesAPIClient is a client that implements the ListTemplateAliases +// operation. +type ListTemplateAliasesAPIClient interface { + ListTemplateAliases(context.Context, *ListTemplateAliasesInput, ...func(*Options)) (*ListTemplateAliasesOutput, error) +} + +var _ ListTemplateAliasesAPIClient = (*Client)(nil) + +// ListTemplateAliasesPaginatorOptions is the paginator options for +// ListTemplateAliases +type ListTemplateAliasesPaginatorOptions struct { + // The maximum number of results to be returned per request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTemplateAliasesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/quicksight.ListTemplateAliases +type ListTemplateAliasesPaginator struct { + options ListTemplateAliasesPaginatorOptions + client ListTemplateAliasesAPIClient + params *ListTemplateAliasesInput + nextToken *string + firstPage bool + done bool +} + +// NewListTemplateAliasesPaginator returns a new ListTemplateAliasesPaginator +func NewListTemplateAliasesPaginator(client ListTemplateAliasesAPIClient, params *ListTemplateAliasesInput, optFns ...func(*ListTemplateAliasesPaginatorOptions)) *ListTemplateAliasesPaginator { + options := ListTemplateAliasesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTemplateAliasesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTemplateAliasesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTemplateAliases page. +func (p *ListTemplateAliasesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTemplateAliasesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListTemplateAliases(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTemplateVersionsAPIClient is a client that implements the +// ListTemplateVersions operation. +type ListTemplateVersionsAPIClient interface { + ListTemplateVersions(context.Context, *ListTemplateVersionsInput, ...func(*Options)) (*ListTemplateVersionsOutput, error) +} + +var _ ListTemplateVersionsAPIClient = (*Client)(nil) + +// ListTemplateVersionsPaginatorOptions is the paginator options for +// ListTemplateVersions +type ListTemplateVersionsPaginatorOptions struct { + // The maximum number of results to be returned per request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTemplateVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/quicksight.ListTemplateVersions +type ListTemplateVersionsPaginator struct { + options ListTemplateVersionsPaginatorOptions + client ListTemplateVersionsAPIClient + params *ListTemplateVersionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListTemplateVersionsPaginator returns a new ListTemplateVersionsPaginator +func NewListTemplateVersionsPaginator(client ListTemplateVersionsAPIClient, params *ListTemplateVersionsInput, optFns ...func(*ListTemplateVersionsPaginatorOptions)) *ListTemplateVersionsPaginator { + options := ListTemplateVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTemplateVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTemplateVersionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTemplateVersions page. +func (p *ListTemplateVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTemplateVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListTemplateVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDashboardVersionsAPIClient is a client that implements the +// ListDashboardVersions operation. +type ListDashboardVersionsAPIClient interface { + ListDashboardVersions(context.Context, *ListDashboardVersionsInput, ...func(*Options)) (*ListDashboardVersionsOutput, error) +} + +var _ ListDashboardVersionsAPIClient = (*Client)(nil) + +// ListDashboardVersionsPaginatorOptions is the paginator options for +// ListDashboardVersions +type ListDashboardVersionsPaginatorOptions struct { + // The maximum number of results to be returned per request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDashboardVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/quicksight.ListDashboardVersions +type ListDashboardVersionsPaginator struct { + options ListDashboardVersionsPaginatorOptions + client ListDashboardVersionsAPIClient + params *ListDashboardVersionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListDashboardVersionsPaginator returns a new ListDashboardVersionsPaginator +func NewListDashboardVersionsPaginator(client ListDashboardVersionsAPIClient, params *ListDashboardVersionsInput, optFns ...func(*ListDashboardVersionsPaginatorOptions)) *ListDashboardVersionsPaginator { + options := ListDashboardVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDashboardVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDashboardVersionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDashboardVersions page. +func (p *ListDashboardVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDashboardVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListDashboardVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// SearchDashboardsAPIClient is a client that implements the SearchDashboards +// operation. +type SearchDashboardsAPIClient interface { + SearchDashboards(context.Context, *SearchDashboardsInput, ...func(*Options)) (*SearchDashboardsOutput, error) +} + +var _ SearchDashboardsAPIClient = (*Client)(nil) + +// SearchDashboardsPaginatorOptions is the paginator options for SearchDashboards +type SearchDashboardsPaginatorOptions struct { + // The maximum number of results to be returned per request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// SearchDashboardsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/quicksight.SearchDashboards +type SearchDashboardsPaginator struct { + options SearchDashboardsPaginatorOptions + client SearchDashboardsAPIClient + params *SearchDashboardsInput + nextToken *string + firstPage bool + done bool +} + +// NewSearchDashboardsPaginator returns a new SearchDashboardsPaginator +func NewSearchDashboardsPaginator(client SearchDashboardsAPIClient, params *SearchDashboardsInput, optFns ...func(*SearchDashboardsPaginatorOptions)) *SearchDashboardsPaginator { + options := SearchDashboardsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &SearchDashboardsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchDashboardsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next SearchDashboards page. +func (p *SearchDashboardsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchDashboardsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.SearchDashboards(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// SearchAnalysesAPIClient is a client that implements the SearchAnalyses +// operation. +type SearchAnalysesAPIClient interface { + SearchAnalyses(context.Context, *SearchAnalysesInput, ...func(*Options)) (*SearchAnalysesOutput, error) +} + +var _ SearchAnalysesAPIClient = (*Client)(nil) + +// SearchAnalysesPaginatorOptions is the paginator options for SearchAnalyses +type SearchAnalysesPaginatorOptions struct { + // The maximum number of results to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// SearchAnalysesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/quicksight.SearchAnalyses +type SearchAnalysesPaginator struct { + options SearchAnalysesPaginatorOptions + client SearchAnalysesAPIClient + params *SearchAnalysesInput + nextToken *string + firstPage bool + done bool +} + +// NewSearchAnalysesPaginator returns a new SearchAnalysesPaginator +func NewSearchAnalysesPaginator(client SearchAnalysesAPIClient, params *SearchAnalysesInput, optFns ...func(*SearchAnalysesPaginatorOptions)) *SearchAnalysesPaginator { + options := SearchAnalysesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &SearchAnalysesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchAnalysesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next SearchAnalyses page. +func (p *SearchAnalysesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchAnalysesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.SearchAnalyses(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDataSetsAPIClient is a client that implements the ListDataSets operation. +type ListDataSetsAPIClient interface { + ListDataSets(context.Context, *ListDataSetsInput, ...func(*Options)) (*ListDataSetsOutput, error) +} + +var _ ListDataSetsAPIClient = (*Client)(nil) + +// ListDataSetsPaginatorOptions is the paginator options for ListDataSets +type ListDataSetsPaginatorOptions struct { + // The maximum number of results to be returned per request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDataSetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/quicksight.ListDataSets +type ListDataSetsPaginator struct { + options ListDataSetsPaginatorOptions + client ListDataSetsAPIClient + params *ListDataSetsInput + nextToken *string + firstPage bool + done bool +} + +// NewListDataSetsPaginator returns a new ListDataSetsPaginator +func NewListDataSetsPaginator(client ListDataSetsAPIClient, params *ListDataSetsInput, optFns ...func(*ListDataSetsPaginatorOptions)) *ListDataSetsPaginator { + options := ListDataSetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDataSetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDataSetsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDataSets page. +func (p *ListDataSetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDataSetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListDataSets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListIngestionsAPIClient is a client that implements the ListIngestions +// operation. +type ListIngestionsAPIClient interface { + ListIngestions(context.Context, *ListIngestionsInput, ...func(*Options)) (*ListIngestionsOutput, error) +} + +var _ ListIngestionsAPIClient = (*Client)(nil) + +// ListIngestionsPaginatorOptions is the paginator options for ListIngestions +type ListIngestionsPaginatorOptions struct { + // The maximum number of results to be returned per request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListIngestionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/quicksight.ListIngestions +type ListIngestionsPaginator struct { + options ListIngestionsPaginatorOptions + client ListIngestionsAPIClient + params *ListIngestionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListIngestionsPaginator returns a new ListIngestionsPaginator +func NewListIngestionsPaginator(client ListIngestionsAPIClient, params *ListIngestionsInput, optFns ...func(*ListIngestionsPaginatorOptions)) *ListIngestionsPaginator { + options := ListIngestionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListIngestionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListIngestionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListIngestions page. +func (p *ListIngestionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListIngestionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListIngestions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDataSourcesAPIClient is a client that implements the ListDataSources +// operation. +type ListDataSourcesAPIClient interface { + ListDataSources(context.Context, *ListDataSourcesInput, ...func(*Options)) (*ListDataSourcesOutput, error) +} + +var _ ListDataSourcesAPIClient = (*Client)(nil) + +// ListDataSourcesPaginatorOptions is the paginator options for ListDataSources +type ListDataSourcesPaginatorOptions struct { + // The maximum number of results to be returned per request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDataSourcesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/quicksight.ListDataSources +type ListDataSourcesPaginator struct { + options ListDataSourcesPaginatorOptions + client ListDataSourcesAPIClient + params *ListDataSourcesInput + nextToken *string + firstPage bool + done bool +} + +// NewListDataSourcesPaginator returns a new ListDataSourcesPaginator +func NewListDataSourcesPaginator(client ListDataSourcesAPIClient, params *ListDataSourcesInput, optFns ...func(*ListDataSourcesPaginatorOptions)) *ListDataSourcesPaginator { + options := ListDataSourcesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDataSourcesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDataSourcesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDataSources page. +func (p *ListDataSourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDataSourcesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListDataSources(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/ram/go.sum b/service/ram/go.sum index c669e324b14..32595049f96 100644 --- a/service/ram/go.sum +++ b/service/ram/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/ram/paginators.go b/service/ram/paginators.go new file mode 100644 index 00000000000..84cbb6b4eba --- /dev/null +++ b/service/ram/paginators.go @@ -0,0 +1,546 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ram + +import ( + "context" + "fmt" +) + +// GetResourceShareAssociationsAPIClient is a client that implements the +// GetResourceShareAssociations operation. +type GetResourceShareAssociationsAPIClient interface { + GetResourceShareAssociations(context.Context, *GetResourceShareAssociationsInput, ...func(*Options)) (*GetResourceShareAssociationsOutput, error) +} + +var _ GetResourceShareAssociationsAPIClient = (*Client)(nil) + +// GetResourceShareAssociationsPaginatorOptions is the paginator options for +// GetResourceShareAssociations +type GetResourceShareAssociationsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetResourceShareAssociationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ram.GetResourceShareAssociations +type GetResourceShareAssociationsPaginator struct { + options GetResourceShareAssociationsPaginatorOptions + client GetResourceShareAssociationsAPIClient + params *GetResourceShareAssociationsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetResourceShareAssociationsPaginator returns a new +// GetResourceShareAssociationsPaginator +func NewGetResourceShareAssociationsPaginator(client GetResourceShareAssociationsAPIClient, params *GetResourceShareAssociationsInput, optFns ...func(*GetResourceShareAssociationsPaginatorOptions)) *GetResourceShareAssociationsPaginator { + options := GetResourceShareAssociationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetResourceShareAssociationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetResourceShareAssociationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetResourceShareAssociations page. +func (p *GetResourceShareAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetResourceShareAssociationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetResourceShareAssociations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListPendingInvitationResourcesAPIClient is a client that implements the +// ListPendingInvitationResources operation. +type ListPendingInvitationResourcesAPIClient interface { + ListPendingInvitationResources(context.Context, *ListPendingInvitationResourcesInput, ...func(*Options)) (*ListPendingInvitationResourcesOutput, error) +} + +var _ ListPendingInvitationResourcesAPIClient = (*Client)(nil) + +// ListPendingInvitationResourcesPaginatorOptions is the paginator options for +// ListPendingInvitationResources +type ListPendingInvitationResourcesPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListPendingInvitationResourcesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ram.ListPendingInvitationResources +type ListPendingInvitationResourcesPaginator struct { + options ListPendingInvitationResourcesPaginatorOptions + client ListPendingInvitationResourcesAPIClient + params *ListPendingInvitationResourcesInput + nextToken *string + firstPage bool + done bool +} + +// NewListPendingInvitationResourcesPaginator returns a new +// ListPendingInvitationResourcesPaginator +func NewListPendingInvitationResourcesPaginator(client ListPendingInvitationResourcesAPIClient, params *ListPendingInvitationResourcesInput, optFns ...func(*ListPendingInvitationResourcesPaginatorOptions)) *ListPendingInvitationResourcesPaginator { + options := ListPendingInvitationResourcesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListPendingInvitationResourcesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPendingInvitationResourcesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListPendingInvitationResources page. +func (p *ListPendingInvitationResourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPendingInvitationResourcesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListPendingInvitationResources(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListResourcesAPIClient is a client that implements the ListResources operation. +type ListResourcesAPIClient interface { + ListResources(context.Context, *ListResourcesInput, ...func(*Options)) (*ListResourcesOutput, error) +} + +var _ ListResourcesAPIClient = (*Client)(nil) + +// ListResourcesPaginatorOptions is the paginator options for ListResources +type ListResourcesPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListResourcesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ram.ListResources +type ListResourcesPaginator struct { + options ListResourcesPaginatorOptions + client ListResourcesAPIClient + params *ListResourcesInput + nextToken *string + firstPage bool + done bool +} + +// NewListResourcesPaginator returns a new ListResourcesPaginator +func NewListResourcesPaginator(client ListResourcesAPIClient, params *ListResourcesInput, optFns ...func(*ListResourcesPaginatorOptions)) *ListResourcesPaginator { + options := ListResourcesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListResourcesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListResourcesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListResources page. +func (p *ListResourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListResourcesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListResources(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetResourcePoliciesAPIClient is a client that implements the GetResourcePolicies +// operation. +type GetResourcePoliciesAPIClient interface { + GetResourcePolicies(context.Context, *GetResourcePoliciesInput, ...func(*Options)) (*GetResourcePoliciesOutput, error) +} + +var _ GetResourcePoliciesAPIClient = (*Client)(nil) + +// GetResourcePoliciesPaginatorOptions is the paginator options for +// GetResourcePolicies +type GetResourcePoliciesPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetResourcePoliciesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ram.GetResourcePolicies +type GetResourcePoliciesPaginator struct { + options GetResourcePoliciesPaginatorOptions + client GetResourcePoliciesAPIClient + params *GetResourcePoliciesInput + nextToken *string + firstPage bool + done bool +} + +// NewGetResourcePoliciesPaginator returns a new GetResourcePoliciesPaginator +func NewGetResourcePoliciesPaginator(client GetResourcePoliciesAPIClient, params *GetResourcePoliciesInput, optFns ...func(*GetResourcePoliciesPaginatorOptions)) *GetResourcePoliciesPaginator { + options := GetResourcePoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetResourcePoliciesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetResourcePoliciesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetResourcePolicies page. +func (p *GetResourcePoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetResourcePoliciesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetResourcePolicies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetResourceShareInvitationsAPIClient is a client that implements the +// GetResourceShareInvitations operation. +type GetResourceShareInvitationsAPIClient interface { + GetResourceShareInvitations(context.Context, *GetResourceShareInvitationsInput, ...func(*Options)) (*GetResourceShareInvitationsOutput, error) +} + +var _ GetResourceShareInvitationsAPIClient = (*Client)(nil) + +// GetResourceShareInvitationsPaginatorOptions is the paginator options for +// GetResourceShareInvitations +type GetResourceShareInvitationsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetResourceShareInvitationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ram.GetResourceShareInvitations +type GetResourceShareInvitationsPaginator struct { + options GetResourceShareInvitationsPaginatorOptions + client GetResourceShareInvitationsAPIClient + params *GetResourceShareInvitationsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetResourceShareInvitationsPaginator returns a new +// GetResourceShareInvitationsPaginator +func NewGetResourceShareInvitationsPaginator(client GetResourceShareInvitationsAPIClient, params *GetResourceShareInvitationsInput, optFns ...func(*GetResourceShareInvitationsPaginatorOptions)) *GetResourceShareInvitationsPaginator { + options := GetResourceShareInvitationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetResourceShareInvitationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetResourceShareInvitationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetResourceShareInvitations page. +func (p *GetResourceShareInvitationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetResourceShareInvitationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetResourceShareInvitations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetResourceSharesAPIClient is a client that implements the GetResourceShares +// operation. +type GetResourceSharesAPIClient interface { + GetResourceShares(context.Context, *GetResourceSharesInput, ...func(*Options)) (*GetResourceSharesOutput, error) +} + +var _ GetResourceSharesAPIClient = (*Client)(nil) + +// GetResourceSharesPaginatorOptions is the paginator options for GetResourceShares +type GetResourceSharesPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetResourceSharesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ram.GetResourceShares +type GetResourceSharesPaginator struct { + options GetResourceSharesPaginatorOptions + client GetResourceSharesAPIClient + params *GetResourceSharesInput + nextToken *string + firstPage bool + done bool +} + +// NewGetResourceSharesPaginator returns a new GetResourceSharesPaginator +func NewGetResourceSharesPaginator(client GetResourceSharesAPIClient, params *GetResourceSharesInput, optFns ...func(*GetResourceSharesPaginatorOptions)) *GetResourceSharesPaginator { + options := GetResourceSharesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetResourceSharesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetResourceSharesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetResourceShares page. +func (p *GetResourceSharesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetResourceSharesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetResourceShares(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListPrincipalsAPIClient is a client that implements the ListPrincipals +// operation. +type ListPrincipalsAPIClient interface { + ListPrincipals(context.Context, *ListPrincipalsInput, ...func(*Options)) (*ListPrincipalsOutput, error) +} + +var _ ListPrincipalsAPIClient = (*Client)(nil) + +// ListPrincipalsPaginatorOptions is the paginator options for ListPrincipals +type ListPrincipalsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListPrincipalsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ram.ListPrincipals +type ListPrincipalsPaginator struct { + options ListPrincipalsPaginatorOptions + client ListPrincipalsAPIClient + params *ListPrincipalsInput + nextToken *string + firstPage bool + done bool +} + +// NewListPrincipalsPaginator returns a new ListPrincipalsPaginator +func NewListPrincipalsPaginator(client ListPrincipalsAPIClient, params *ListPrincipalsInput, optFns ...func(*ListPrincipalsPaginatorOptions)) *ListPrincipalsPaginator { + options := ListPrincipalsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListPrincipalsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPrincipalsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListPrincipals page. +func (p *ListPrincipalsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPrincipalsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListPrincipals(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/rds/go.sum b/service/rds/go.sum index 8a4986a5fc4..875bf37048a 100644 --- a/service/rds/go.sum +++ b/service/rds/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/rds/paginators.go b/service/rds/paginators.go new file mode 100644 index 00000000000..ca97f95d859 --- /dev/null +++ b/service/rds/paginators.go @@ -0,0 +1,2632 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" +) + +// DescribeDBProxyTargetsAPIClient is a client that implements the +// DescribeDBProxyTargets operation. +type DescribeDBProxyTargetsAPIClient interface { + DescribeDBProxyTargets(context.Context, *DescribeDBProxyTargetsInput, ...func(*Options)) (*DescribeDBProxyTargetsOutput, error) +} + +var _ DescribeDBProxyTargetsAPIClient = (*Client)(nil) + +// DescribeDBProxyTargetsPaginatorOptions is the paginator options for +// DescribeDBProxyTargets +type DescribeDBProxyTargetsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeDBProxyTargetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeDBProxyTargets +type DescribeDBProxyTargetsPaginator struct { + options DescribeDBProxyTargetsPaginatorOptions + client DescribeDBProxyTargetsAPIClient + params *DescribeDBProxyTargetsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeDBProxyTargetsPaginator returns a new DescribeDBProxyTargetsPaginator +func NewDescribeDBProxyTargetsPaginator(client DescribeDBProxyTargetsAPIClient, params *DescribeDBProxyTargetsInput, optFns ...func(*DescribeDBProxyTargetsPaginatorOptions)) *DescribeDBProxyTargetsPaginator { + options := DescribeDBProxyTargetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeDBProxyTargetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBProxyTargetsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeDBProxyTargets page. +func (p *DescribeDBProxyTargetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBProxyTargetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeDBProxyTargets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribePendingMaintenanceActionsAPIClient is a client that implements the +// DescribePendingMaintenanceActions operation. +type DescribePendingMaintenanceActionsAPIClient interface { + DescribePendingMaintenanceActions(context.Context, *DescribePendingMaintenanceActionsInput, ...func(*Options)) (*DescribePendingMaintenanceActionsOutput, error) +} + +var _ DescribePendingMaintenanceActionsAPIClient = (*Client)(nil) + +// DescribePendingMaintenanceActionsPaginatorOptions is the paginator options for +// DescribePendingMaintenanceActions +type DescribePendingMaintenanceActionsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // Default: 100 Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribePendingMaintenanceActionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribePendingMaintenanceActions +type DescribePendingMaintenanceActionsPaginator struct { + options DescribePendingMaintenanceActionsPaginatorOptions + client DescribePendingMaintenanceActionsAPIClient + params *DescribePendingMaintenanceActionsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribePendingMaintenanceActionsPaginator returns a new +// DescribePendingMaintenanceActionsPaginator +func NewDescribePendingMaintenanceActionsPaginator(client DescribePendingMaintenanceActionsAPIClient, params *DescribePendingMaintenanceActionsInput, optFns ...func(*DescribePendingMaintenanceActionsPaginatorOptions)) *DescribePendingMaintenanceActionsPaginator { + options := DescribePendingMaintenanceActionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribePendingMaintenanceActionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribePendingMaintenanceActionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribePendingMaintenanceActions page. +func (p *DescribePendingMaintenanceActionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribePendingMaintenanceActionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribePendingMaintenanceActions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeDBClusterParameterGroupsAPIClient is a client that implements the +// DescribeDBClusterParameterGroups operation. +type DescribeDBClusterParameterGroupsAPIClient interface { + DescribeDBClusterParameterGroups(context.Context, *DescribeDBClusterParameterGroupsInput, ...func(*Options)) (*DescribeDBClusterParameterGroupsOutput, error) +} + +var _ DescribeDBClusterParameterGroupsAPIClient = (*Client)(nil) + +// DescribeDBClusterParameterGroupsPaginatorOptions is the paginator options for +// DescribeDBClusterParameterGroups +type DescribeDBClusterParameterGroupsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so you can retrieve the remaining results. Default: 100 + // Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeDBClusterParameterGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeDBClusterParameterGroups +type DescribeDBClusterParameterGroupsPaginator struct { + options DescribeDBClusterParameterGroupsPaginatorOptions + client DescribeDBClusterParameterGroupsAPIClient + params *DescribeDBClusterParameterGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeDBClusterParameterGroupsPaginator returns a new +// DescribeDBClusterParameterGroupsPaginator +func NewDescribeDBClusterParameterGroupsPaginator(client DescribeDBClusterParameterGroupsAPIClient, params *DescribeDBClusterParameterGroupsInput, optFns ...func(*DescribeDBClusterParameterGroupsPaginatorOptions)) *DescribeDBClusterParameterGroupsPaginator { + options := DescribeDBClusterParameterGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeDBClusterParameterGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBClusterParameterGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeDBClusterParameterGroups page. +func (p *DescribeDBClusterParameterGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBClusterParameterGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeDBClusterParameterGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeDBLogFilesAPIClient is a client that implements the DescribeDBLogFiles +// operation. +type DescribeDBLogFilesAPIClient interface { + DescribeDBLogFiles(context.Context, *DescribeDBLogFilesInput, ...func(*Options)) (*DescribeDBLogFilesOutput, error) +} + +var _ DescribeDBLogFilesAPIClient = (*Client)(nil) + +// DescribeDBLogFilesPaginatorOptions is the paginator options for +// DescribeDBLogFiles +type DescribeDBLogFilesPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so you can retrieve the remaining results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeDBLogFilesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeDBLogFiles +type DescribeDBLogFilesPaginator struct { + options DescribeDBLogFilesPaginatorOptions + client DescribeDBLogFilesAPIClient + params *DescribeDBLogFilesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeDBLogFilesPaginator returns a new DescribeDBLogFilesPaginator +func NewDescribeDBLogFilesPaginator(client DescribeDBLogFilesAPIClient, params *DescribeDBLogFilesInput, optFns ...func(*DescribeDBLogFilesPaginatorOptions)) *DescribeDBLogFilesPaginator { + options := DescribeDBLogFilesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeDBLogFilesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBLogFilesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeDBLogFiles page. +func (p *DescribeDBLogFilesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBLogFilesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeDBLogFiles(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeCustomAvailabilityZonesAPIClient is a client that implements the +// DescribeCustomAvailabilityZones operation. +type DescribeCustomAvailabilityZonesAPIClient interface { + DescribeCustomAvailabilityZones(context.Context, *DescribeCustomAvailabilityZonesInput, ...func(*Options)) (*DescribeCustomAvailabilityZonesOutput, error) +} + +var _ DescribeCustomAvailabilityZonesAPIClient = (*Client)(nil) + +// DescribeCustomAvailabilityZonesPaginatorOptions is the paginator options for +// DescribeCustomAvailabilityZones +type DescribeCustomAvailabilityZonesPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so you can retrieve the remaining results. Default: 100 + // Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeCustomAvailabilityZonesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeCustomAvailabilityZones +type DescribeCustomAvailabilityZonesPaginator struct { + options DescribeCustomAvailabilityZonesPaginatorOptions + client DescribeCustomAvailabilityZonesAPIClient + params *DescribeCustomAvailabilityZonesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeCustomAvailabilityZonesPaginator returns a new +// DescribeCustomAvailabilityZonesPaginator +func NewDescribeCustomAvailabilityZonesPaginator(client DescribeCustomAvailabilityZonesAPIClient, params *DescribeCustomAvailabilityZonesInput, optFns ...func(*DescribeCustomAvailabilityZonesPaginatorOptions)) *DescribeCustomAvailabilityZonesPaginator { + options := DescribeCustomAvailabilityZonesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeCustomAvailabilityZonesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeCustomAvailabilityZonesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeCustomAvailabilityZones page. +func (p *DescribeCustomAvailabilityZonesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCustomAvailabilityZonesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeCustomAvailabilityZones(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeCertificatesAPIClient is a client that implements the +// DescribeCertificates operation. +type DescribeCertificatesAPIClient interface { + DescribeCertificates(context.Context, *DescribeCertificatesInput, ...func(*Options)) (*DescribeCertificatesOutput, error) +} + +var _ DescribeCertificatesAPIClient = (*Client)(nil) + +// DescribeCertificatesPaginatorOptions is the paginator options for +// DescribeCertificates +type DescribeCertificatesPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so you can retrieve the remaining results. Default: 100 + // Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeCertificatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeCertificates +type DescribeCertificatesPaginator struct { + options DescribeCertificatesPaginatorOptions + client DescribeCertificatesAPIClient + params *DescribeCertificatesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeCertificatesPaginator returns a new DescribeCertificatesPaginator +func NewDescribeCertificatesPaginator(client DescribeCertificatesAPIClient, params *DescribeCertificatesInput, optFns ...func(*DescribeCertificatesPaginatorOptions)) *DescribeCertificatesPaginator { + options := DescribeCertificatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeCertificatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeCertificatesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeCertificates page. +func (p *DescribeCertificatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCertificatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeCertificates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeOrderableDBInstanceOptionsAPIClient is a client that implements the +// DescribeOrderableDBInstanceOptions operation. +type DescribeOrderableDBInstanceOptionsAPIClient interface { + DescribeOrderableDBInstanceOptions(context.Context, *DescribeOrderableDBInstanceOptionsInput, ...func(*Options)) (*DescribeOrderableDBInstanceOptionsOutput, error) +} + +var _ DescribeOrderableDBInstanceOptionsAPIClient = (*Client)(nil) + +// DescribeOrderableDBInstanceOptionsPaginatorOptions is the paginator options for +// DescribeOrderableDBInstanceOptions +type DescribeOrderableDBInstanceOptionsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // Default: 100 Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeOrderableDBInstanceOptionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeOrderableDBInstanceOptions +type DescribeOrderableDBInstanceOptionsPaginator struct { + options DescribeOrderableDBInstanceOptionsPaginatorOptions + client DescribeOrderableDBInstanceOptionsAPIClient + params *DescribeOrderableDBInstanceOptionsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeOrderableDBInstanceOptionsPaginator returns a new +// DescribeOrderableDBInstanceOptionsPaginator +func NewDescribeOrderableDBInstanceOptionsPaginator(client DescribeOrderableDBInstanceOptionsAPIClient, params *DescribeOrderableDBInstanceOptionsInput, optFns ...func(*DescribeOrderableDBInstanceOptionsPaginatorOptions)) *DescribeOrderableDBInstanceOptionsPaginator { + options := DescribeOrderableDBInstanceOptionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeOrderableDBInstanceOptionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeOrderableDBInstanceOptionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeOrderableDBInstanceOptions page. +func (p *DescribeOrderableDBInstanceOptionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeOrderableDBInstanceOptionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeOrderableDBInstanceOptions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeDBParameterGroupsAPIClient is a client that implements the +// DescribeDBParameterGroups operation. +type DescribeDBParameterGroupsAPIClient interface { + DescribeDBParameterGroups(context.Context, *DescribeDBParameterGroupsInput, ...func(*Options)) (*DescribeDBParameterGroupsOutput, error) +} + +var _ DescribeDBParameterGroupsAPIClient = (*Client)(nil) + +// DescribeDBParameterGroupsPaginatorOptions is the paginator options for +// DescribeDBParameterGroups +type DescribeDBParameterGroupsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // Default: 100 Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeDBParameterGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeDBParameterGroups +type DescribeDBParameterGroupsPaginator struct { + options DescribeDBParameterGroupsPaginatorOptions + client DescribeDBParameterGroupsAPIClient + params *DescribeDBParameterGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeDBParameterGroupsPaginator returns a new +// DescribeDBParameterGroupsPaginator +func NewDescribeDBParameterGroupsPaginator(client DescribeDBParameterGroupsAPIClient, params *DescribeDBParameterGroupsInput, optFns ...func(*DescribeDBParameterGroupsPaginatorOptions)) *DescribeDBParameterGroupsPaginator { + options := DescribeDBParameterGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeDBParameterGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBParameterGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeDBParameterGroups page. +func (p *DescribeDBParameterGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBParameterGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeDBParameterGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeDBInstanceAutomatedBackupsAPIClient is a client that implements the +// DescribeDBInstanceAutomatedBackups operation. +type DescribeDBInstanceAutomatedBackupsAPIClient interface { + DescribeDBInstanceAutomatedBackups(context.Context, *DescribeDBInstanceAutomatedBackupsInput, ...func(*Options)) (*DescribeDBInstanceAutomatedBackupsOutput, error) +} + +var _ DescribeDBInstanceAutomatedBackupsAPIClient = (*Client)(nil) + +// DescribeDBInstanceAutomatedBackupsPaginatorOptions is the paginator options for +// DescribeDBInstanceAutomatedBackups +type DescribeDBInstanceAutomatedBackupsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeDBInstanceAutomatedBackupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeDBInstanceAutomatedBackups +type DescribeDBInstanceAutomatedBackupsPaginator struct { + options DescribeDBInstanceAutomatedBackupsPaginatorOptions + client DescribeDBInstanceAutomatedBackupsAPIClient + params *DescribeDBInstanceAutomatedBackupsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeDBInstanceAutomatedBackupsPaginator returns a new +// DescribeDBInstanceAutomatedBackupsPaginator +func NewDescribeDBInstanceAutomatedBackupsPaginator(client DescribeDBInstanceAutomatedBackupsAPIClient, params *DescribeDBInstanceAutomatedBackupsInput, optFns ...func(*DescribeDBInstanceAutomatedBackupsPaginatorOptions)) *DescribeDBInstanceAutomatedBackupsPaginator { + options := DescribeDBInstanceAutomatedBackupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeDBInstanceAutomatedBackupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBInstanceAutomatedBackupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeDBInstanceAutomatedBackups page. +func (p *DescribeDBInstanceAutomatedBackupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBInstanceAutomatedBackupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeDBInstanceAutomatedBackups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeOptionGroupsAPIClient is a client that implements the +// DescribeOptionGroups operation. +type DescribeOptionGroupsAPIClient interface { + DescribeOptionGroups(context.Context, *DescribeOptionGroupsInput, ...func(*Options)) (*DescribeOptionGroupsOutput, error) +} + +var _ DescribeOptionGroupsAPIClient = (*Client)(nil) + +// DescribeOptionGroupsPaginatorOptions is the paginator options for +// DescribeOptionGroups +type DescribeOptionGroupsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // Default: 100 Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeOptionGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeOptionGroups +type DescribeOptionGroupsPaginator struct { + options DescribeOptionGroupsPaginatorOptions + client DescribeOptionGroupsAPIClient + params *DescribeOptionGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeOptionGroupsPaginator returns a new DescribeOptionGroupsPaginator +func NewDescribeOptionGroupsPaginator(client DescribeOptionGroupsAPIClient, params *DescribeOptionGroupsInput, optFns ...func(*DescribeOptionGroupsPaginatorOptions)) *DescribeOptionGroupsPaginator { + options := DescribeOptionGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeOptionGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeOptionGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeOptionGroups page. +func (p *DescribeOptionGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeOptionGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeOptionGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeDBProxiesAPIClient is a client that implements the DescribeDBProxies +// operation. +type DescribeDBProxiesAPIClient interface { + DescribeDBProxies(context.Context, *DescribeDBProxiesInput, ...func(*Options)) (*DescribeDBProxiesOutput, error) +} + +var _ DescribeDBProxiesAPIClient = (*Client)(nil) + +// DescribeDBProxiesPaginatorOptions is the paginator options for DescribeDBProxies +type DescribeDBProxiesPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeDBProxiesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeDBProxies +type DescribeDBProxiesPaginator struct { + options DescribeDBProxiesPaginatorOptions + client DescribeDBProxiesAPIClient + params *DescribeDBProxiesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeDBProxiesPaginator returns a new DescribeDBProxiesPaginator +func NewDescribeDBProxiesPaginator(client DescribeDBProxiesAPIClient, params *DescribeDBProxiesInput, optFns ...func(*DescribeDBProxiesPaginatorOptions)) *DescribeDBProxiesPaginator { + options := DescribeDBProxiesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeDBProxiesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBProxiesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeDBProxies page. +func (p *DescribeDBProxiesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBProxiesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeDBProxies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeDBSnapshotsAPIClient is a client that implements the DescribeDBSnapshots +// operation. +type DescribeDBSnapshotsAPIClient interface { + DescribeDBSnapshots(context.Context, *DescribeDBSnapshotsInput, ...func(*Options)) (*DescribeDBSnapshotsOutput, error) +} + +var _ DescribeDBSnapshotsAPIClient = (*Client)(nil) + +// DescribeDBSnapshotsPaginatorOptions is the paginator options for +// DescribeDBSnapshots +type DescribeDBSnapshotsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // Default: 100 Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeDBSnapshotsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeDBSnapshots +type DescribeDBSnapshotsPaginator struct { + options DescribeDBSnapshotsPaginatorOptions + client DescribeDBSnapshotsAPIClient + params *DescribeDBSnapshotsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeDBSnapshotsPaginator returns a new DescribeDBSnapshotsPaginator +func NewDescribeDBSnapshotsPaginator(client DescribeDBSnapshotsAPIClient, params *DescribeDBSnapshotsInput, optFns ...func(*DescribeDBSnapshotsPaginatorOptions)) *DescribeDBSnapshotsPaginator { + options := DescribeDBSnapshotsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeDBSnapshotsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBSnapshotsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeDBSnapshots page. +func (p *DescribeDBSnapshotsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBSnapshotsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeDBSnapshots(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeDBSubnetGroupsAPIClient is a client that implements the +// DescribeDBSubnetGroups operation. +type DescribeDBSubnetGroupsAPIClient interface { + DescribeDBSubnetGroups(context.Context, *DescribeDBSubnetGroupsInput, ...func(*Options)) (*DescribeDBSubnetGroupsOutput, error) +} + +var _ DescribeDBSubnetGroupsAPIClient = (*Client)(nil) + +// DescribeDBSubnetGroupsPaginatorOptions is the paginator options for +// DescribeDBSubnetGroups +type DescribeDBSubnetGroupsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // Default: 100 Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeDBSubnetGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeDBSubnetGroups +type DescribeDBSubnetGroupsPaginator struct { + options DescribeDBSubnetGroupsPaginatorOptions + client DescribeDBSubnetGroupsAPIClient + params *DescribeDBSubnetGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeDBSubnetGroupsPaginator returns a new DescribeDBSubnetGroupsPaginator +func NewDescribeDBSubnetGroupsPaginator(client DescribeDBSubnetGroupsAPIClient, params *DescribeDBSubnetGroupsInput, optFns ...func(*DescribeDBSubnetGroupsPaginatorOptions)) *DescribeDBSubnetGroupsPaginator { + options := DescribeDBSubnetGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeDBSubnetGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBSubnetGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeDBSubnetGroups page. +func (p *DescribeDBSubnetGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBSubnetGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeDBSubnetGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeEngineDefaultParametersAPIClient is a client that implements the +// DescribeEngineDefaultParameters operation. +type DescribeEngineDefaultParametersAPIClient interface { + DescribeEngineDefaultParameters(context.Context, *DescribeEngineDefaultParametersInput, ...func(*Options)) (*DescribeEngineDefaultParametersOutput, error) +} + +var _ DescribeEngineDefaultParametersAPIClient = (*Client)(nil) + +// DescribeEngineDefaultParametersPaginatorOptions is the paginator options for +// DescribeEngineDefaultParameters +type DescribeEngineDefaultParametersPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so you can retrieve the remaining results. Default: 100 + // Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeEngineDefaultParametersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeEngineDefaultParameters +type DescribeEngineDefaultParametersPaginator struct { + options DescribeEngineDefaultParametersPaginatorOptions + client DescribeEngineDefaultParametersAPIClient + params *DescribeEngineDefaultParametersInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeEngineDefaultParametersPaginator returns a new +// DescribeEngineDefaultParametersPaginator +func NewDescribeEngineDefaultParametersPaginator(client DescribeEngineDefaultParametersAPIClient, params *DescribeEngineDefaultParametersInput, optFns ...func(*DescribeEngineDefaultParametersPaginatorOptions)) *DescribeEngineDefaultParametersPaginator { + options := DescribeEngineDefaultParametersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeEngineDefaultParametersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEngineDefaultParametersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeEngineDefaultParameters page. +func (p *DescribeEngineDefaultParametersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEngineDefaultParametersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeEngineDefaultParameters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + if result.EngineDefaults != nil { + p.nextToken = result.EngineDefaults.Marker + } + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeDBSecurityGroupsAPIClient is a client that implements the +// DescribeDBSecurityGroups operation. +type DescribeDBSecurityGroupsAPIClient interface { + DescribeDBSecurityGroups(context.Context, *DescribeDBSecurityGroupsInput, ...func(*Options)) (*DescribeDBSecurityGroupsOutput, error) +} + +var _ DescribeDBSecurityGroupsAPIClient = (*Client)(nil) + +// DescribeDBSecurityGroupsPaginatorOptions is the paginator options for +// DescribeDBSecurityGroups +type DescribeDBSecurityGroupsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // Default: 100 Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeDBSecurityGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeDBSecurityGroups +type DescribeDBSecurityGroupsPaginator struct { + options DescribeDBSecurityGroupsPaginatorOptions + client DescribeDBSecurityGroupsAPIClient + params *DescribeDBSecurityGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeDBSecurityGroupsPaginator returns a new +// DescribeDBSecurityGroupsPaginator +func NewDescribeDBSecurityGroupsPaginator(client DescribeDBSecurityGroupsAPIClient, params *DescribeDBSecurityGroupsInput, optFns ...func(*DescribeDBSecurityGroupsPaginatorOptions)) *DescribeDBSecurityGroupsPaginator { + options := DescribeDBSecurityGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeDBSecurityGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBSecurityGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeDBSecurityGroups page. +func (p *DescribeDBSecurityGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBSecurityGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeDBSecurityGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeReservedDBInstancesAPIClient is a client that implements the +// DescribeReservedDBInstances operation. +type DescribeReservedDBInstancesAPIClient interface { + DescribeReservedDBInstances(context.Context, *DescribeReservedDBInstancesInput, ...func(*Options)) (*DescribeReservedDBInstancesOutput, error) +} + +var _ DescribeReservedDBInstancesAPIClient = (*Client)(nil) + +// DescribeReservedDBInstancesPaginatorOptions is the paginator options for +// DescribeReservedDBInstances +type DescribeReservedDBInstancesPaginatorOptions struct { + // The maximum number of records to include in the response. If more than the + // MaxRecords value is available, a pagination token called a marker is included in + // the response so you can retrieve the remaining results. Default: 100 + // Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeReservedDBInstancesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeReservedDBInstances +type DescribeReservedDBInstancesPaginator struct { + options DescribeReservedDBInstancesPaginatorOptions + client DescribeReservedDBInstancesAPIClient + params *DescribeReservedDBInstancesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeReservedDBInstancesPaginator returns a new +// DescribeReservedDBInstancesPaginator +func NewDescribeReservedDBInstancesPaginator(client DescribeReservedDBInstancesAPIClient, params *DescribeReservedDBInstancesInput, optFns ...func(*DescribeReservedDBInstancesPaginatorOptions)) *DescribeReservedDBInstancesPaginator { + options := DescribeReservedDBInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeReservedDBInstancesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeReservedDBInstancesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeReservedDBInstances page. +func (p *DescribeReservedDBInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeReservedDBInstancesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeReservedDBInstances(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeGlobalClustersAPIClient is a client that implements the +// DescribeGlobalClusters operation. +type DescribeGlobalClustersAPIClient interface { + DescribeGlobalClusters(context.Context, *DescribeGlobalClustersInput, ...func(*Options)) (*DescribeGlobalClustersOutput, error) +} + +var _ DescribeGlobalClustersAPIClient = (*Client)(nil) + +// DescribeGlobalClustersPaginatorOptions is the paginator options for +// DescribeGlobalClusters +type DescribeGlobalClustersPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // Default: 100 Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeGlobalClustersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeGlobalClusters +type DescribeGlobalClustersPaginator struct { + options DescribeGlobalClustersPaginatorOptions + client DescribeGlobalClustersAPIClient + params *DescribeGlobalClustersInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeGlobalClustersPaginator returns a new DescribeGlobalClustersPaginator +func NewDescribeGlobalClustersPaginator(client DescribeGlobalClustersAPIClient, params *DescribeGlobalClustersInput, optFns ...func(*DescribeGlobalClustersPaginatorOptions)) *DescribeGlobalClustersPaginator { + options := DescribeGlobalClustersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeGlobalClustersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeGlobalClustersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeGlobalClusters page. +func (p *DescribeGlobalClustersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeGlobalClustersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeGlobalClusters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeReservedDBInstancesOfferingsAPIClient is a client that implements the +// DescribeReservedDBInstancesOfferings operation. +type DescribeReservedDBInstancesOfferingsAPIClient interface { + DescribeReservedDBInstancesOfferings(context.Context, *DescribeReservedDBInstancesOfferingsInput, ...func(*Options)) (*DescribeReservedDBInstancesOfferingsOutput, error) +} + +var _ DescribeReservedDBInstancesOfferingsAPIClient = (*Client)(nil) + +// DescribeReservedDBInstancesOfferingsPaginatorOptions is the paginator options +// for DescribeReservedDBInstancesOfferings +type DescribeReservedDBInstancesOfferingsPaginatorOptions struct { + // The maximum number of records to include in the response. If more than the + // MaxRecords value is available, a pagination token called a marker is included in + // the response so you can retrieve the remaining results. Default: 100 + // Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeReservedDBInstancesOfferingsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeReservedDBInstancesOfferings +type DescribeReservedDBInstancesOfferingsPaginator struct { + options DescribeReservedDBInstancesOfferingsPaginatorOptions + client DescribeReservedDBInstancesOfferingsAPIClient + params *DescribeReservedDBInstancesOfferingsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeReservedDBInstancesOfferingsPaginator returns a new +// DescribeReservedDBInstancesOfferingsPaginator +func NewDescribeReservedDBInstancesOfferingsPaginator(client DescribeReservedDBInstancesOfferingsAPIClient, params *DescribeReservedDBInstancesOfferingsInput, optFns ...func(*DescribeReservedDBInstancesOfferingsPaginatorOptions)) *DescribeReservedDBInstancesOfferingsPaginator { + options := DescribeReservedDBInstancesOfferingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeReservedDBInstancesOfferingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeReservedDBInstancesOfferingsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeReservedDBInstancesOfferings page. +func (p *DescribeReservedDBInstancesOfferingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeReservedDBInstancesOfferingsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeReservedDBInstancesOfferings(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeDBClusterParametersAPIClient is a client that implements the +// DescribeDBClusterParameters operation. +type DescribeDBClusterParametersAPIClient interface { + DescribeDBClusterParameters(context.Context, *DescribeDBClusterParametersInput, ...func(*Options)) (*DescribeDBClusterParametersOutput, error) +} + +var _ DescribeDBClusterParametersAPIClient = (*Client)(nil) + +// DescribeDBClusterParametersPaginatorOptions is the paginator options for +// DescribeDBClusterParameters +type DescribeDBClusterParametersPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so you can retrieve the remaining results. Default: 100 + // Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeDBClusterParametersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeDBClusterParameters +type DescribeDBClusterParametersPaginator struct { + options DescribeDBClusterParametersPaginatorOptions + client DescribeDBClusterParametersAPIClient + params *DescribeDBClusterParametersInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeDBClusterParametersPaginator returns a new +// DescribeDBClusterParametersPaginator +func NewDescribeDBClusterParametersPaginator(client DescribeDBClusterParametersAPIClient, params *DescribeDBClusterParametersInput, optFns ...func(*DescribeDBClusterParametersPaginatorOptions)) *DescribeDBClusterParametersPaginator { + options := DescribeDBClusterParametersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeDBClusterParametersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBClusterParametersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeDBClusterParameters page. +func (p *DescribeDBClusterParametersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBClusterParametersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeDBClusterParameters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeSourceRegionsAPIClient is a client that implements the +// DescribeSourceRegions operation. +type DescribeSourceRegionsAPIClient interface { + DescribeSourceRegions(context.Context, *DescribeSourceRegionsInput, ...func(*Options)) (*DescribeSourceRegionsOutput, error) +} + +var _ DescribeSourceRegionsAPIClient = (*Client)(nil) + +// DescribeSourceRegionsPaginatorOptions is the paginator options for +// DescribeSourceRegions +type DescribeSourceRegionsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so you can retrieve the remaining results. Default: 100 + // Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeSourceRegionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeSourceRegions +type DescribeSourceRegionsPaginator struct { + options DescribeSourceRegionsPaginatorOptions + client DescribeSourceRegionsAPIClient + params *DescribeSourceRegionsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeSourceRegionsPaginator returns a new DescribeSourceRegionsPaginator +func NewDescribeSourceRegionsPaginator(client DescribeSourceRegionsAPIClient, params *DescribeSourceRegionsInput, optFns ...func(*DescribeSourceRegionsPaginatorOptions)) *DescribeSourceRegionsPaginator { + options := DescribeSourceRegionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeSourceRegionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeSourceRegionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeSourceRegions page. +func (p *DescribeSourceRegionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeSourceRegionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeSourceRegions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeEventsAPIClient is a client that implements the DescribeEvents +// operation. +type DescribeEventsAPIClient interface { + DescribeEvents(context.Context, *DescribeEventsInput, ...func(*Options)) (*DescribeEventsOutput, error) +} + +var _ DescribeEventsAPIClient = (*Client)(nil) + +// DescribeEventsPaginatorOptions is the paginator options for DescribeEvents +type DescribeEventsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // Default: 100 Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeEventsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeEvents +type DescribeEventsPaginator struct { + options DescribeEventsPaginatorOptions + client DescribeEventsAPIClient + params *DescribeEventsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeEventsPaginator returns a new DescribeEventsPaginator +func NewDescribeEventsPaginator(client DescribeEventsAPIClient, params *DescribeEventsInput, optFns ...func(*DescribeEventsPaginatorOptions)) *DescribeEventsPaginator { + options := DescribeEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeEventsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEventsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeEvents page. +func (p *DescribeEventsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEventsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeEvents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeOptionGroupOptionsAPIClient is a client that implements the +// DescribeOptionGroupOptions operation. +type DescribeOptionGroupOptionsAPIClient interface { + DescribeOptionGroupOptions(context.Context, *DescribeOptionGroupOptionsInput, ...func(*Options)) (*DescribeOptionGroupOptionsOutput, error) +} + +var _ DescribeOptionGroupOptionsAPIClient = (*Client)(nil) + +// DescribeOptionGroupOptionsPaginatorOptions is the paginator options for +// DescribeOptionGroupOptions +type DescribeOptionGroupOptionsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // Default: 100 Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeOptionGroupOptionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeOptionGroupOptions +type DescribeOptionGroupOptionsPaginator struct { + options DescribeOptionGroupOptionsPaginatorOptions + client DescribeOptionGroupOptionsAPIClient + params *DescribeOptionGroupOptionsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeOptionGroupOptionsPaginator returns a new +// DescribeOptionGroupOptionsPaginator +func NewDescribeOptionGroupOptionsPaginator(client DescribeOptionGroupOptionsAPIClient, params *DescribeOptionGroupOptionsInput, optFns ...func(*DescribeOptionGroupOptionsPaginatorOptions)) *DescribeOptionGroupOptionsPaginator { + options := DescribeOptionGroupOptionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeOptionGroupOptionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeOptionGroupOptionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeOptionGroupOptions page. +func (p *DescribeOptionGroupOptionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeOptionGroupOptionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeOptionGroupOptions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeExportTasksAPIClient is a client that implements the DescribeExportTasks +// operation. +type DescribeExportTasksAPIClient interface { + DescribeExportTasks(context.Context, *DescribeExportTasksInput, ...func(*Options)) (*DescribeExportTasksOutput, error) +} + +var _ DescribeExportTasksAPIClient = (*Client)(nil) + +// DescribeExportTasksPaginatorOptions is the paginator options for +// DescribeExportTasks +type DescribeExportTasksPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified value, a pagination token called a marker is included in the + // response. You can use the marker in a later DescribeExportTasks request to + // retrieve the remaining results. Default: 100 Constraints: Minimum 20, maximum + // 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeExportTasksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeExportTasks +type DescribeExportTasksPaginator struct { + options DescribeExportTasksPaginatorOptions + client DescribeExportTasksAPIClient + params *DescribeExportTasksInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeExportTasksPaginator returns a new DescribeExportTasksPaginator +func NewDescribeExportTasksPaginator(client DescribeExportTasksAPIClient, params *DescribeExportTasksInput, optFns ...func(*DescribeExportTasksPaginatorOptions)) *DescribeExportTasksPaginator { + options := DescribeExportTasksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeExportTasksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeExportTasksPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeExportTasks page. +func (p *DescribeExportTasksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeExportTasksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeExportTasks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeInstallationMediaAPIClient is a client that implements the +// DescribeInstallationMedia operation. +type DescribeInstallationMediaAPIClient interface { + DescribeInstallationMedia(context.Context, *DescribeInstallationMediaInput, ...func(*Options)) (*DescribeInstallationMediaOutput, error) +} + +var _ DescribeInstallationMediaAPIClient = (*Client)(nil) + +// DescribeInstallationMediaPaginatorOptions is the paginator options for +// DescribeInstallationMedia +type DescribeInstallationMediaPaginatorOptions struct { + // An optional pagination token provided by a previous DescribeInstallationMedia + // request. If this parameter is specified, the response includes only records + // beyond the marker, up to the value specified by MaxRecords. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeInstallationMediaPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeInstallationMedia +type DescribeInstallationMediaPaginator struct { + options DescribeInstallationMediaPaginatorOptions + client DescribeInstallationMediaAPIClient + params *DescribeInstallationMediaInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeInstallationMediaPaginator returns a new +// DescribeInstallationMediaPaginator +func NewDescribeInstallationMediaPaginator(client DescribeInstallationMediaAPIClient, params *DescribeInstallationMediaInput, optFns ...func(*DescribeInstallationMediaPaginatorOptions)) *DescribeInstallationMediaPaginator { + options := DescribeInstallationMediaPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeInstallationMediaPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeInstallationMediaPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeInstallationMedia page. +func (p *DescribeInstallationMediaPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInstallationMediaOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeInstallationMedia(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeDBInstancesAPIClient is a client that implements the DescribeDBInstances +// operation. +type DescribeDBInstancesAPIClient interface { + DescribeDBInstances(context.Context, *DescribeDBInstancesInput, ...func(*Options)) (*DescribeDBInstancesOutput, error) +} + +var _ DescribeDBInstancesAPIClient = (*Client)(nil) + +// DescribeDBInstancesPaginatorOptions is the paginator options for +// DescribeDBInstances +type DescribeDBInstancesPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // Default: 100 Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeDBInstancesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeDBInstances +type DescribeDBInstancesPaginator struct { + options DescribeDBInstancesPaginatorOptions + client DescribeDBInstancesAPIClient + params *DescribeDBInstancesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeDBInstancesPaginator returns a new DescribeDBInstancesPaginator +func NewDescribeDBInstancesPaginator(client DescribeDBInstancesAPIClient, params *DescribeDBInstancesInput, optFns ...func(*DescribeDBInstancesPaginatorOptions)) *DescribeDBInstancesPaginator { + options := DescribeDBInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeDBInstancesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBInstancesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeDBInstances page. +func (p *DescribeDBInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBInstancesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeDBInstances(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeDBClusterSnapshotsAPIClient is a client that implements the +// DescribeDBClusterSnapshots operation. +type DescribeDBClusterSnapshotsAPIClient interface { + DescribeDBClusterSnapshots(context.Context, *DescribeDBClusterSnapshotsInput, ...func(*Options)) (*DescribeDBClusterSnapshotsOutput, error) +} + +var _ DescribeDBClusterSnapshotsAPIClient = (*Client)(nil) + +// DescribeDBClusterSnapshotsPaginatorOptions is the paginator options for +// DescribeDBClusterSnapshots +type DescribeDBClusterSnapshotsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so you can retrieve the remaining results. Default: 100 + // Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeDBClusterSnapshotsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeDBClusterSnapshots +type DescribeDBClusterSnapshotsPaginator struct { + options DescribeDBClusterSnapshotsPaginatorOptions + client DescribeDBClusterSnapshotsAPIClient + params *DescribeDBClusterSnapshotsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeDBClusterSnapshotsPaginator returns a new +// DescribeDBClusterSnapshotsPaginator +func NewDescribeDBClusterSnapshotsPaginator(client DescribeDBClusterSnapshotsAPIClient, params *DescribeDBClusterSnapshotsInput, optFns ...func(*DescribeDBClusterSnapshotsPaginatorOptions)) *DescribeDBClusterSnapshotsPaginator { + options := DescribeDBClusterSnapshotsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeDBClusterSnapshotsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBClusterSnapshotsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeDBClusterSnapshots page. +func (p *DescribeDBClusterSnapshotsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBClusterSnapshotsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeDBClusterSnapshots(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeDBProxyTargetGroupsAPIClient is a client that implements the +// DescribeDBProxyTargetGroups operation. +type DescribeDBProxyTargetGroupsAPIClient interface { + DescribeDBProxyTargetGroups(context.Context, *DescribeDBProxyTargetGroupsInput, ...func(*Options)) (*DescribeDBProxyTargetGroupsOutput, error) +} + +var _ DescribeDBProxyTargetGroupsAPIClient = (*Client)(nil) + +// DescribeDBProxyTargetGroupsPaginatorOptions is the paginator options for +// DescribeDBProxyTargetGroups +type DescribeDBProxyTargetGroupsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeDBProxyTargetGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeDBProxyTargetGroups +type DescribeDBProxyTargetGroupsPaginator struct { + options DescribeDBProxyTargetGroupsPaginatorOptions + client DescribeDBProxyTargetGroupsAPIClient + params *DescribeDBProxyTargetGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeDBProxyTargetGroupsPaginator returns a new +// DescribeDBProxyTargetGroupsPaginator +func NewDescribeDBProxyTargetGroupsPaginator(client DescribeDBProxyTargetGroupsAPIClient, params *DescribeDBProxyTargetGroupsInput, optFns ...func(*DescribeDBProxyTargetGroupsPaginatorOptions)) *DescribeDBProxyTargetGroupsPaginator { + options := DescribeDBProxyTargetGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeDBProxyTargetGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBProxyTargetGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeDBProxyTargetGroups page. +func (p *DescribeDBProxyTargetGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBProxyTargetGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeDBProxyTargetGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeDBClusterEndpointsAPIClient is a client that implements the +// DescribeDBClusterEndpoints operation. +type DescribeDBClusterEndpointsAPIClient interface { + DescribeDBClusterEndpoints(context.Context, *DescribeDBClusterEndpointsInput, ...func(*Options)) (*DescribeDBClusterEndpointsOutput, error) +} + +var _ DescribeDBClusterEndpointsAPIClient = (*Client)(nil) + +// DescribeDBClusterEndpointsPaginatorOptions is the paginator options for +// DescribeDBClusterEndpoints +type DescribeDBClusterEndpointsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so you can retrieve the remaining results. Default: 100 + // Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeDBClusterEndpointsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeDBClusterEndpoints +type DescribeDBClusterEndpointsPaginator struct { + options DescribeDBClusterEndpointsPaginatorOptions + client DescribeDBClusterEndpointsAPIClient + params *DescribeDBClusterEndpointsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeDBClusterEndpointsPaginator returns a new +// DescribeDBClusterEndpointsPaginator +func NewDescribeDBClusterEndpointsPaginator(client DescribeDBClusterEndpointsAPIClient, params *DescribeDBClusterEndpointsInput, optFns ...func(*DescribeDBClusterEndpointsPaginatorOptions)) *DescribeDBClusterEndpointsPaginator { + options := DescribeDBClusterEndpointsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeDBClusterEndpointsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBClusterEndpointsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeDBClusterEndpoints page. +func (p *DescribeDBClusterEndpointsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBClusterEndpointsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeDBClusterEndpoints(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeDBClusterBacktracksAPIClient is a client that implements the +// DescribeDBClusterBacktracks operation. +type DescribeDBClusterBacktracksAPIClient interface { + DescribeDBClusterBacktracks(context.Context, *DescribeDBClusterBacktracksInput, ...func(*Options)) (*DescribeDBClusterBacktracksOutput, error) +} + +var _ DescribeDBClusterBacktracksAPIClient = (*Client)(nil) + +// DescribeDBClusterBacktracksPaginatorOptions is the paginator options for +// DescribeDBClusterBacktracks +type DescribeDBClusterBacktracksPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so you can retrieve the remaining results. Default: 100 + // Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeDBClusterBacktracksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeDBClusterBacktracks +type DescribeDBClusterBacktracksPaginator struct { + options DescribeDBClusterBacktracksPaginatorOptions + client DescribeDBClusterBacktracksAPIClient + params *DescribeDBClusterBacktracksInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeDBClusterBacktracksPaginator returns a new +// DescribeDBClusterBacktracksPaginator +func NewDescribeDBClusterBacktracksPaginator(client DescribeDBClusterBacktracksAPIClient, params *DescribeDBClusterBacktracksInput, optFns ...func(*DescribeDBClusterBacktracksPaginatorOptions)) *DescribeDBClusterBacktracksPaginator { + options := DescribeDBClusterBacktracksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeDBClusterBacktracksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBClusterBacktracksPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeDBClusterBacktracks page. +func (p *DescribeDBClusterBacktracksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBClusterBacktracksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeDBClusterBacktracks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeDBParametersAPIClient is a client that implements the +// DescribeDBParameters operation. +type DescribeDBParametersAPIClient interface { + DescribeDBParameters(context.Context, *DescribeDBParametersInput, ...func(*Options)) (*DescribeDBParametersOutput, error) +} + +var _ DescribeDBParametersAPIClient = (*Client)(nil) + +// DescribeDBParametersPaginatorOptions is the paginator options for +// DescribeDBParameters +type DescribeDBParametersPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // Default: 100 Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeDBParametersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeDBParameters +type DescribeDBParametersPaginator struct { + options DescribeDBParametersPaginatorOptions + client DescribeDBParametersAPIClient + params *DescribeDBParametersInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeDBParametersPaginator returns a new DescribeDBParametersPaginator +func NewDescribeDBParametersPaginator(client DescribeDBParametersAPIClient, params *DescribeDBParametersInput, optFns ...func(*DescribeDBParametersPaginatorOptions)) *DescribeDBParametersPaginator { + options := DescribeDBParametersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeDBParametersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBParametersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeDBParameters page. +func (p *DescribeDBParametersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBParametersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeDBParameters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeDBClustersAPIClient is a client that implements the DescribeDBClusters +// operation. +type DescribeDBClustersAPIClient interface { + DescribeDBClusters(context.Context, *DescribeDBClustersInput, ...func(*Options)) (*DescribeDBClustersOutput, error) +} + +var _ DescribeDBClustersAPIClient = (*Client)(nil) + +// DescribeDBClustersPaginatorOptions is the paginator options for +// DescribeDBClusters +type DescribeDBClustersPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so you can retrieve the remaining results. Default: 100 + // Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeDBClustersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeDBClusters +type DescribeDBClustersPaginator struct { + options DescribeDBClustersPaginatorOptions + client DescribeDBClustersAPIClient + params *DescribeDBClustersInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeDBClustersPaginator returns a new DescribeDBClustersPaginator +func NewDescribeDBClustersPaginator(client DescribeDBClustersAPIClient, params *DescribeDBClustersInput, optFns ...func(*DescribeDBClustersPaginatorOptions)) *DescribeDBClustersPaginator { + options := DescribeDBClustersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeDBClustersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBClustersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeDBClusters page. +func (p *DescribeDBClustersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBClustersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeDBClusters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeDBEngineVersionsAPIClient is a client that implements the +// DescribeDBEngineVersions operation. +type DescribeDBEngineVersionsAPIClient interface { + DescribeDBEngineVersions(context.Context, *DescribeDBEngineVersionsInput, ...func(*Options)) (*DescribeDBEngineVersionsOutput, error) +} + +var _ DescribeDBEngineVersionsAPIClient = (*Client)(nil) + +// DescribeDBEngineVersionsPaginatorOptions is the paginator options for +// DescribeDBEngineVersions +type DescribeDBEngineVersionsPaginatorOptions struct { + // The maximum number of records to include in the response. If more than the + // MaxRecords value is available, a pagination token called a marker is included in + // the response so you can retrieve the remaining results. Default: 100 + // Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeDBEngineVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeDBEngineVersions +type DescribeDBEngineVersionsPaginator struct { + options DescribeDBEngineVersionsPaginatorOptions + client DescribeDBEngineVersionsAPIClient + params *DescribeDBEngineVersionsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeDBEngineVersionsPaginator returns a new +// DescribeDBEngineVersionsPaginator +func NewDescribeDBEngineVersionsPaginator(client DescribeDBEngineVersionsAPIClient, params *DescribeDBEngineVersionsInput, optFns ...func(*DescribeDBEngineVersionsPaginatorOptions)) *DescribeDBEngineVersionsPaginator { + options := DescribeDBEngineVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeDBEngineVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBEngineVersionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeDBEngineVersions page. +func (p *DescribeDBEngineVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBEngineVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeDBEngineVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeEventSubscriptionsAPIClient is a client that implements the +// DescribeEventSubscriptions operation. +type DescribeEventSubscriptionsAPIClient interface { + DescribeEventSubscriptions(context.Context, *DescribeEventSubscriptionsInput, ...func(*Options)) (*DescribeEventSubscriptionsOutput, error) +} + +var _ DescribeEventSubscriptionsAPIClient = (*Client)(nil) + +// DescribeEventSubscriptionsPaginatorOptions is the paginator options for +// DescribeEventSubscriptions +type DescribeEventSubscriptionsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // Default: 100 Constraints: Minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeEventSubscriptionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeEventSubscriptions +type DescribeEventSubscriptionsPaginator struct { + options DescribeEventSubscriptionsPaginatorOptions + client DescribeEventSubscriptionsAPIClient + params *DescribeEventSubscriptionsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeEventSubscriptionsPaginator returns a new +// DescribeEventSubscriptionsPaginator +func NewDescribeEventSubscriptionsPaginator(client DescribeEventSubscriptionsAPIClient, params *DescribeEventSubscriptionsInput, optFns ...func(*DescribeEventSubscriptionsPaginatorOptions)) *DescribeEventSubscriptionsPaginator { + options := DescribeEventSubscriptionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeEventSubscriptionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEventSubscriptionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeEventSubscriptions page. +func (p *DescribeEventSubscriptionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEventSubscriptionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeEventSubscriptions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/rdsdata/go.sum b/service/rdsdata/go.sum index c669e324b14..32595049f96 100644 --- a/service/rdsdata/go.sum +++ b/service/rdsdata/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/redshift/go.sum b/service/redshift/go.sum index c669e324b14..32595049f96 100644 --- a/service/redshift/go.sum +++ b/service/redshift/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/redshift/paginators.go b/service/redshift/paginators.go new file mode 100644 index 00000000000..fbe0a417a1d --- /dev/null +++ b/service/redshift/paginators.go @@ -0,0 +1,1462 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshift + +import ( + "context" + "fmt" +) + +// DescribeNodeConfigurationOptionsAPIClient is a client that implements the +// DescribeNodeConfigurationOptions operation. +type DescribeNodeConfigurationOptionsAPIClient interface { + DescribeNodeConfigurationOptions(context.Context, *DescribeNodeConfigurationOptionsInput, ...func(*Options)) (*DescribeNodeConfigurationOptionsOutput, error) +} + +var _ DescribeNodeConfigurationOptionsAPIClient = (*Client)(nil) + +// DescribeNodeConfigurationOptionsPaginatorOptions is the paginator options for +// DescribeNodeConfigurationOptions +type DescribeNodeConfigurationOptionsPaginatorOptions struct { + // The maximum number of response records to return in each call. If the number of + // remaining response records exceeds the specified MaxRecords value, a value is + // returned in a marker field of the response. You can retrieve the next set of + // records by retrying the command with the returned marker value. Default: 500 + // Constraints: minimum 100, maximum 500. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeNodeConfigurationOptionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/redshift.DescribeNodeConfigurationOptions +type DescribeNodeConfigurationOptionsPaginator struct { + options DescribeNodeConfigurationOptionsPaginatorOptions + client DescribeNodeConfigurationOptionsAPIClient + params *DescribeNodeConfigurationOptionsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeNodeConfigurationOptionsPaginator returns a new +// DescribeNodeConfigurationOptionsPaginator +func NewDescribeNodeConfigurationOptionsPaginator(client DescribeNodeConfigurationOptionsAPIClient, params *DescribeNodeConfigurationOptionsInput, optFns ...func(*DescribeNodeConfigurationOptionsPaginatorOptions)) *DescribeNodeConfigurationOptionsPaginator { + options := DescribeNodeConfigurationOptionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeNodeConfigurationOptionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeNodeConfigurationOptionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeNodeConfigurationOptions page. +func (p *DescribeNodeConfigurationOptionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeNodeConfigurationOptionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeNodeConfigurationOptions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeHsmConfigurationsAPIClient is a client that implements the +// DescribeHsmConfigurations operation. +type DescribeHsmConfigurationsAPIClient interface { + DescribeHsmConfigurations(context.Context, *DescribeHsmConfigurationsInput, ...func(*Options)) (*DescribeHsmConfigurationsOutput, error) +} + +var _ DescribeHsmConfigurationsAPIClient = (*Client)(nil) + +// DescribeHsmConfigurationsPaginatorOptions is the paginator options for +// DescribeHsmConfigurations +type DescribeHsmConfigurationsPaginatorOptions struct { + // The maximum number of response records to return in each call. If the number of + // remaining response records exceeds the specified MaxRecords value, a value is + // returned in a marker field of the response. You can retrieve the next set of + // records by retrying the command with the returned marker value. Default: 100 + // Constraints: minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeHsmConfigurationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/redshift.DescribeHsmConfigurations +type DescribeHsmConfigurationsPaginator struct { + options DescribeHsmConfigurationsPaginatorOptions + client DescribeHsmConfigurationsAPIClient + params *DescribeHsmConfigurationsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeHsmConfigurationsPaginator returns a new +// DescribeHsmConfigurationsPaginator +func NewDescribeHsmConfigurationsPaginator(client DescribeHsmConfigurationsAPIClient, params *DescribeHsmConfigurationsInput, optFns ...func(*DescribeHsmConfigurationsPaginatorOptions)) *DescribeHsmConfigurationsPaginator { + options := DescribeHsmConfigurationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeHsmConfigurationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeHsmConfigurationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeHsmConfigurations page. +func (p *DescribeHsmConfigurationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeHsmConfigurationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeHsmConfigurations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeClusterParametersAPIClient is a client that implements the +// DescribeClusterParameters operation. +type DescribeClusterParametersAPIClient interface { + DescribeClusterParameters(context.Context, *DescribeClusterParametersInput, ...func(*Options)) (*DescribeClusterParametersOutput, error) +} + +var _ DescribeClusterParametersAPIClient = (*Client)(nil) + +// DescribeClusterParametersPaginatorOptions is the paginator options for +// DescribeClusterParameters +type DescribeClusterParametersPaginatorOptions struct { + // The maximum number of response records to return in each call. If the number of + // remaining response records exceeds the specified MaxRecords value, a value is + // returned in a marker field of the response. You can retrieve the next set of + // records by retrying the command with the returned marker value. Default: 100 + // Constraints: minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeClusterParametersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/redshift.DescribeClusterParameters +type DescribeClusterParametersPaginator struct { + options DescribeClusterParametersPaginatorOptions + client DescribeClusterParametersAPIClient + params *DescribeClusterParametersInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeClusterParametersPaginator returns a new +// DescribeClusterParametersPaginator +func NewDescribeClusterParametersPaginator(client DescribeClusterParametersAPIClient, params *DescribeClusterParametersInput, optFns ...func(*DescribeClusterParametersPaginatorOptions)) *DescribeClusterParametersPaginator { + options := DescribeClusterParametersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeClusterParametersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeClusterParametersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeClusterParameters page. +func (p *DescribeClusterParametersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeClusterParametersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeClusterParameters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeDefaultClusterParametersAPIClient is a client that implements the +// DescribeDefaultClusterParameters operation. +type DescribeDefaultClusterParametersAPIClient interface { + DescribeDefaultClusterParameters(context.Context, *DescribeDefaultClusterParametersInput, ...func(*Options)) (*DescribeDefaultClusterParametersOutput, error) +} + +var _ DescribeDefaultClusterParametersAPIClient = (*Client)(nil) + +// DescribeDefaultClusterParametersPaginatorOptions is the paginator options for +// DescribeDefaultClusterParameters +type DescribeDefaultClusterParametersPaginatorOptions struct { + // The maximum number of response records to return in each call. If the number of + // remaining response records exceeds the specified MaxRecords value, a value is + // returned in a marker field of the response. You can retrieve the next set of + // records by retrying the command with the returned marker value. Default: 100 + // Constraints: minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeDefaultClusterParametersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/redshift.DescribeDefaultClusterParameters +type DescribeDefaultClusterParametersPaginator struct { + options DescribeDefaultClusterParametersPaginatorOptions + client DescribeDefaultClusterParametersAPIClient + params *DescribeDefaultClusterParametersInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeDefaultClusterParametersPaginator returns a new +// DescribeDefaultClusterParametersPaginator +func NewDescribeDefaultClusterParametersPaginator(client DescribeDefaultClusterParametersAPIClient, params *DescribeDefaultClusterParametersInput, optFns ...func(*DescribeDefaultClusterParametersPaginatorOptions)) *DescribeDefaultClusterParametersPaginator { + options := DescribeDefaultClusterParametersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeDefaultClusterParametersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDefaultClusterParametersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeDefaultClusterParameters page. +func (p *DescribeDefaultClusterParametersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDefaultClusterParametersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeDefaultClusterParameters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + if result.DefaultClusterParameters != nil { + p.nextToken = result.DefaultClusterParameters.Marker + } + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeHsmClientCertificatesAPIClient is a client that implements the +// DescribeHsmClientCertificates operation. +type DescribeHsmClientCertificatesAPIClient interface { + DescribeHsmClientCertificates(context.Context, *DescribeHsmClientCertificatesInput, ...func(*Options)) (*DescribeHsmClientCertificatesOutput, error) +} + +var _ DescribeHsmClientCertificatesAPIClient = (*Client)(nil) + +// DescribeHsmClientCertificatesPaginatorOptions is the paginator options for +// DescribeHsmClientCertificates +type DescribeHsmClientCertificatesPaginatorOptions struct { + // The maximum number of response records to return in each call. If the number of + // remaining response records exceeds the specified MaxRecords value, a value is + // returned in a marker field of the response. You can retrieve the next set of + // records by retrying the command with the returned marker value. Default: 100 + // Constraints: minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeHsmClientCertificatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/redshift.DescribeHsmClientCertificates +type DescribeHsmClientCertificatesPaginator struct { + options DescribeHsmClientCertificatesPaginatorOptions + client DescribeHsmClientCertificatesAPIClient + params *DescribeHsmClientCertificatesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeHsmClientCertificatesPaginator returns a new +// DescribeHsmClientCertificatesPaginator +func NewDescribeHsmClientCertificatesPaginator(client DescribeHsmClientCertificatesAPIClient, params *DescribeHsmClientCertificatesInput, optFns ...func(*DescribeHsmClientCertificatesPaginatorOptions)) *DescribeHsmClientCertificatesPaginator { + options := DescribeHsmClientCertificatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeHsmClientCertificatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeHsmClientCertificatesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeHsmClientCertificates page. +func (p *DescribeHsmClientCertificatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeHsmClientCertificatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeHsmClientCertificates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeClusterVersionsAPIClient is a client that implements the +// DescribeClusterVersions operation. +type DescribeClusterVersionsAPIClient interface { + DescribeClusterVersions(context.Context, *DescribeClusterVersionsInput, ...func(*Options)) (*DescribeClusterVersionsOutput, error) +} + +var _ DescribeClusterVersionsAPIClient = (*Client)(nil) + +// DescribeClusterVersionsPaginatorOptions is the paginator options for +// DescribeClusterVersions +type DescribeClusterVersionsPaginatorOptions struct { + // The maximum number of response records to return in each call. If the number of + // remaining response records exceeds the specified MaxRecords value, a value is + // returned in a marker field of the response. You can retrieve the next set of + // records by retrying the command with the returned marker value. Default: 100 + // Constraints: minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeClusterVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/redshift.DescribeClusterVersions +type DescribeClusterVersionsPaginator struct { + options DescribeClusterVersionsPaginatorOptions + client DescribeClusterVersionsAPIClient + params *DescribeClusterVersionsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeClusterVersionsPaginator returns a new +// DescribeClusterVersionsPaginator +func NewDescribeClusterVersionsPaginator(client DescribeClusterVersionsAPIClient, params *DescribeClusterVersionsInput, optFns ...func(*DescribeClusterVersionsPaginatorOptions)) *DescribeClusterVersionsPaginator { + options := DescribeClusterVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeClusterVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeClusterVersionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeClusterVersions page. +func (p *DescribeClusterVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeClusterVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeClusterVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeEventSubscriptionsAPIClient is a client that implements the +// DescribeEventSubscriptions operation. +type DescribeEventSubscriptionsAPIClient interface { + DescribeEventSubscriptions(context.Context, *DescribeEventSubscriptionsInput, ...func(*Options)) (*DescribeEventSubscriptionsOutput, error) +} + +var _ DescribeEventSubscriptionsAPIClient = (*Client)(nil) + +// DescribeEventSubscriptionsPaginatorOptions is the paginator options for +// DescribeEventSubscriptions +type DescribeEventSubscriptionsPaginatorOptions struct { + // The maximum number of response records to return in each call. If the number of + // remaining response records exceeds the specified MaxRecords value, a value is + // returned in a marker field of the response. You can retrieve the next set of + // records by retrying the command with the returned marker value. Default: 100 + // Constraints: minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeEventSubscriptionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/redshift.DescribeEventSubscriptions +type DescribeEventSubscriptionsPaginator struct { + options DescribeEventSubscriptionsPaginatorOptions + client DescribeEventSubscriptionsAPIClient + params *DescribeEventSubscriptionsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeEventSubscriptionsPaginator returns a new +// DescribeEventSubscriptionsPaginator +func NewDescribeEventSubscriptionsPaginator(client DescribeEventSubscriptionsAPIClient, params *DescribeEventSubscriptionsInput, optFns ...func(*DescribeEventSubscriptionsPaginatorOptions)) *DescribeEventSubscriptionsPaginator { + options := DescribeEventSubscriptionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeEventSubscriptionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEventSubscriptionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeEventSubscriptions page. +func (p *DescribeEventSubscriptionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEventSubscriptionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeEventSubscriptions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeReservedNodesAPIClient is a client that implements the +// DescribeReservedNodes operation. +type DescribeReservedNodesAPIClient interface { + DescribeReservedNodes(context.Context, *DescribeReservedNodesInput, ...func(*Options)) (*DescribeReservedNodesOutput, error) +} + +var _ DescribeReservedNodesAPIClient = (*Client)(nil) + +// DescribeReservedNodesPaginatorOptions is the paginator options for +// DescribeReservedNodes +type DescribeReservedNodesPaginatorOptions struct { + // The maximum number of response records to return in each call. If the number of + // remaining response records exceeds the specified MaxRecords value, a value is + // returned in a marker field of the response. You can retrieve the next set of + // records by retrying the command with the returned marker value. Default: 100 + // Constraints: minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeReservedNodesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/redshift.DescribeReservedNodes +type DescribeReservedNodesPaginator struct { + options DescribeReservedNodesPaginatorOptions + client DescribeReservedNodesAPIClient + params *DescribeReservedNodesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeReservedNodesPaginator returns a new DescribeReservedNodesPaginator +func NewDescribeReservedNodesPaginator(client DescribeReservedNodesAPIClient, params *DescribeReservedNodesInput, optFns ...func(*DescribeReservedNodesPaginatorOptions)) *DescribeReservedNodesPaginator { + options := DescribeReservedNodesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeReservedNodesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeReservedNodesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeReservedNodes page. +func (p *DescribeReservedNodesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeReservedNodesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeReservedNodes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeClusterParameterGroupsAPIClient is a client that implements the +// DescribeClusterParameterGroups operation. +type DescribeClusterParameterGroupsAPIClient interface { + DescribeClusterParameterGroups(context.Context, *DescribeClusterParameterGroupsInput, ...func(*Options)) (*DescribeClusterParameterGroupsOutput, error) +} + +var _ DescribeClusterParameterGroupsAPIClient = (*Client)(nil) + +// DescribeClusterParameterGroupsPaginatorOptions is the paginator options for +// DescribeClusterParameterGroups +type DescribeClusterParameterGroupsPaginatorOptions struct { + // The maximum number of response records to return in each call. If the number of + // remaining response records exceeds the specified MaxRecords value, a value is + // returned in a marker field of the response. You can retrieve the next set of + // records by retrying the command with the returned marker value. Default: 100 + // Constraints: minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeClusterParameterGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/redshift.DescribeClusterParameterGroups +type DescribeClusterParameterGroupsPaginator struct { + options DescribeClusterParameterGroupsPaginatorOptions + client DescribeClusterParameterGroupsAPIClient + params *DescribeClusterParameterGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeClusterParameterGroupsPaginator returns a new +// DescribeClusterParameterGroupsPaginator +func NewDescribeClusterParameterGroupsPaginator(client DescribeClusterParameterGroupsAPIClient, params *DescribeClusterParameterGroupsInput, optFns ...func(*DescribeClusterParameterGroupsPaginatorOptions)) *DescribeClusterParameterGroupsPaginator { + options := DescribeClusterParameterGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeClusterParameterGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeClusterParameterGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeClusterParameterGroups page. +func (p *DescribeClusterParameterGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeClusterParameterGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeClusterParameterGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeScheduledActionsAPIClient is a client that implements the +// DescribeScheduledActions operation. +type DescribeScheduledActionsAPIClient interface { + DescribeScheduledActions(context.Context, *DescribeScheduledActionsInput, ...func(*Options)) (*DescribeScheduledActionsOutput, error) +} + +var _ DescribeScheduledActionsAPIClient = (*Client)(nil) + +// DescribeScheduledActionsPaginatorOptions is the paginator options for +// DescribeScheduledActions +type DescribeScheduledActionsPaginatorOptions struct { + // The maximum number of response records to return in each call. If the number of + // remaining response records exceeds the specified MaxRecords value, a value is + // returned in a marker field of the response. You can retrieve the next set of + // records by retrying the command with the returned marker value. Default: 100 + // Constraints: minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeScheduledActionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/redshift.DescribeScheduledActions +type DescribeScheduledActionsPaginator struct { + options DescribeScheduledActionsPaginatorOptions + client DescribeScheduledActionsAPIClient + params *DescribeScheduledActionsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeScheduledActionsPaginator returns a new +// DescribeScheduledActionsPaginator +func NewDescribeScheduledActionsPaginator(client DescribeScheduledActionsAPIClient, params *DescribeScheduledActionsInput, optFns ...func(*DescribeScheduledActionsPaginatorOptions)) *DescribeScheduledActionsPaginator { + options := DescribeScheduledActionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeScheduledActionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeScheduledActionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeScheduledActions page. +func (p *DescribeScheduledActionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeScheduledActionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeScheduledActions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeClustersAPIClient is a client that implements the DescribeClusters +// operation. +type DescribeClustersAPIClient interface { + DescribeClusters(context.Context, *DescribeClustersInput, ...func(*Options)) (*DescribeClustersOutput, error) +} + +var _ DescribeClustersAPIClient = (*Client)(nil) + +// DescribeClustersPaginatorOptions is the paginator options for DescribeClusters +type DescribeClustersPaginatorOptions struct { + // The maximum number of response records to return in each call. If the number of + // remaining response records exceeds the specified MaxRecords value, a value is + // returned in a marker field of the response. You can retrieve the next set of + // records by retrying the command with the returned marker value. Default: 100 + // Constraints: minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeClustersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/redshift.DescribeClusters +type DescribeClustersPaginator struct { + options DescribeClustersPaginatorOptions + client DescribeClustersAPIClient + params *DescribeClustersInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeClustersPaginator returns a new DescribeClustersPaginator +func NewDescribeClustersPaginator(client DescribeClustersAPIClient, params *DescribeClustersInput, optFns ...func(*DescribeClustersPaginatorOptions)) *DescribeClustersPaginator { + options := DescribeClustersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeClustersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeClustersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeClusters page. +func (p *DescribeClustersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeClustersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeClusters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeEventsAPIClient is a client that implements the DescribeEvents +// operation. +type DescribeEventsAPIClient interface { + DescribeEvents(context.Context, *DescribeEventsInput, ...func(*Options)) (*DescribeEventsOutput, error) +} + +var _ DescribeEventsAPIClient = (*Client)(nil) + +// DescribeEventsPaginatorOptions is the paginator options for DescribeEvents +type DescribeEventsPaginatorOptions struct { + // The maximum number of response records to return in each call. If the number of + // remaining response records exceeds the specified MaxRecords value, a value is + // returned in a marker field of the response. You can retrieve the next set of + // records by retrying the command with the returned marker value. Default: 100 + // Constraints: minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeEventsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/redshift.DescribeEvents +type DescribeEventsPaginator struct { + options DescribeEventsPaginatorOptions + client DescribeEventsAPIClient + params *DescribeEventsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeEventsPaginator returns a new DescribeEventsPaginator +func NewDescribeEventsPaginator(client DescribeEventsAPIClient, params *DescribeEventsInput, optFns ...func(*DescribeEventsPaginatorOptions)) *DescribeEventsPaginator { + options := DescribeEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeEventsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEventsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeEvents page. +func (p *DescribeEventsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEventsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeEvents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeClusterSecurityGroupsAPIClient is a client that implements the +// DescribeClusterSecurityGroups operation. +type DescribeClusterSecurityGroupsAPIClient interface { + DescribeClusterSecurityGroups(context.Context, *DescribeClusterSecurityGroupsInput, ...func(*Options)) (*DescribeClusterSecurityGroupsOutput, error) +} + +var _ DescribeClusterSecurityGroupsAPIClient = (*Client)(nil) + +// DescribeClusterSecurityGroupsPaginatorOptions is the paginator options for +// DescribeClusterSecurityGroups +type DescribeClusterSecurityGroupsPaginatorOptions struct { + // The maximum number of response records to return in each call. If the number of + // remaining response records exceeds the specified MaxRecords value, a value is + // returned in a marker field of the response. You can retrieve the next set of + // records by retrying the command with the returned marker value. Default: 100 + // Constraints: minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeClusterSecurityGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/redshift.DescribeClusterSecurityGroups +type DescribeClusterSecurityGroupsPaginator struct { + options DescribeClusterSecurityGroupsPaginatorOptions + client DescribeClusterSecurityGroupsAPIClient + params *DescribeClusterSecurityGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeClusterSecurityGroupsPaginator returns a new +// DescribeClusterSecurityGroupsPaginator +func NewDescribeClusterSecurityGroupsPaginator(client DescribeClusterSecurityGroupsAPIClient, params *DescribeClusterSecurityGroupsInput, optFns ...func(*DescribeClusterSecurityGroupsPaginatorOptions)) *DescribeClusterSecurityGroupsPaginator { + options := DescribeClusterSecurityGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeClusterSecurityGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeClusterSecurityGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeClusterSecurityGroups page. +func (p *DescribeClusterSecurityGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeClusterSecurityGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeClusterSecurityGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeUsageLimitsAPIClient is a client that implements the DescribeUsageLimits +// operation. +type DescribeUsageLimitsAPIClient interface { + DescribeUsageLimits(context.Context, *DescribeUsageLimitsInput, ...func(*Options)) (*DescribeUsageLimitsOutput, error) +} + +var _ DescribeUsageLimitsAPIClient = (*Client)(nil) + +// DescribeUsageLimitsPaginatorOptions is the paginator options for +// DescribeUsageLimits +type DescribeUsageLimitsPaginatorOptions struct { + // The maximum number of response records to return in each call. If the number of + // remaining response records exceeds the specified MaxRecords value, a value is + // returned in a marker field of the response. You can retrieve the next set of + // records by retrying the command with the returned marker value. Default: 100 + // Constraints: minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeUsageLimitsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/redshift.DescribeUsageLimits +type DescribeUsageLimitsPaginator struct { + options DescribeUsageLimitsPaginatorOptions + client DescribeUsageLimitsAPIClient + params *DescribeUsageLimitsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeUsageLimitsPaginator returns a new DescribeUsageLimitsPaginator +func NewDescribeUsageLimitsPaginator(client DescribeUsageLimitsAPIClient, params *DescribeUsageLimitsInput, optFns ...func(*DescribeUsageLimitsPaginatorOptions)) *DescribeUsageLimitsPaginator { + options := DescribeUsageLimitsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeUsageLimitsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeUsageLimitsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeUsageLimits page. +func (p *DescribeUsageLimitsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeUsageLimitsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeUsageLimits(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeOrderableClusterOptionsAPIClient is a client that implements the +// DescribeOrderableClusterOptions operation. +type DescribeOrderableClusterOptionsAPIClient interface { + DescribeOrderableClusterOptions(context.Context, *DescribeOrderableClusterOptionsInput, ...func(*Options)) (*DescribeOrderableClusterOptionsOutput, error) +} + +var _ DescribeOrderableClusterOptionsAPIClient = (*Client)(nil) + +// DescribeOrderableClusterOptionsPaginatorOptions is the paginator options for +// DescribeOrderableClusterOptions +type DescribeOrderableClusterOptionsPaginatorOptions struct { + // The maximum number of response records to return in each call. If the number of + // remaining response records exceeds the specified MaxRecords value, a value is + // returned in a marker field of the response. You can retrieve the next set of + // records by retrying the command with the returned marker value. Default: 100 + // Constraints: minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeOrderableClusterOptionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/redshift.DescribeOrderableClusterOptions +type DescribeOrderableClusterOptionsPaginator struct { + options DescribeOrderableClusterOptionsPaginatorOptions + client DescribeOrderableClusterOptionsAPIClient + params *DescribeOrderableClusterOptionsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeOrderableClusterOptionsPaginator returns a new +// DescribeOrderableClusterOptionsPaginator +func NewDescribeOrderableClusterOptionsPaginator(client DescribeOrderableClusterOptionsAPIClient, params *DescribeOrderableClusterOptionsInput, optFns ...func(*DescribeOrderableClusterOptionsPaginatorOptions)) *DescribeOrderableClusterOptionsPaginator { + options := DescribeOrderableClusterOptionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeOrderableClusterOptionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeOrderableClusterOptionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeOrderableClusterOptions page. +func (p *DescribeOrderableClusterOptionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeOrderableClusterOptionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeOrderableClusterOptions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeReservedNodeOfferingsAPIClient is a client that implements the +// DescribeReservedNodeOfferings operation. +type DescribeReservedNodeOfferingsAPIClient interface { + DescribeReservedNodeOfferings(context.Context, *DescribeReservedNodeOfferingsInput, ...func(*Options)) (*DescribeReservedNodeOfferingsOutput, error) +} + +var _ DescribeReservedNodeOfferingsAPIClient = (*Client)(nil) + +// DescribeReservedNodeOfferingsPaginatorOptions is the paginator options for +// DescribeReservedNodeOfferings +type DescribeReservedNodeOfferingsPaginatorOptions struct { + // The maximum number of response records to return in each call. If the number of + // remaining response records exceeds the specified MaxRecords value, a value is + // returned in a marker field of the response. You can retrieve the next set of + // records by retrying the command with the returned marker value. Default: 100 + // Constraints: minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeReservedNodeOfferingsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/redshift.DescribeReservedNodeOfferings +type DescribeReservedNodeOfferingsPaginator struct { + options DescribeReservedNodeOfferingsPaginatorOptions + client DescribeReservedNodeOfferingsAPIClient + params *DescribeReservedNodeOfferingsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeReservedNodeOfferingsPaginator returns a new +// DescribeReservedNodeOfferingsPaginator +func NewDescribeReservedNodeOfferingsPaginator(client DescribeReservedNodeOfferingsAPIClient, params *DescribeReservedNodeOfferingsInput, optFns ...func(*DescribeReservedNodeOfferingsPaginatorOptions)) *DescribeReservedNodeOfferingsPaginator { + options := DescribeReservedNodeOfferingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeReservedNodeOfferingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeReservedNodeOfferingsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeReservedNodeOfferings page. +func (p *DescribeReservedNodeOfferingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeReservedNodeOfferingsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeReservedNodeOfferings(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeClusterSubnetGroupsAPIClient is a client that implements the +// DescribeClusterSubnetGroups operation. +type DescribeClusterSubnetGroupsAPIClient interface { + DescribeClusterSubnetGroups(context.Context, *DescribeClusterSubnetGroupsInput, ...func(*Options)) (*DescribeClusterSubnetGroupsOutput, error) +} + +var _ DescribeClusterSubnetGroupsAPIClient = (*Client)(nil) + +// DescribeClusterSubnetGroupsPaginatorOptions is the paginator options for +// DescribeClusterSubnetGroups +type DescribeClusterSubnetGroupsPaginatorOptions struct { + // The maximum number of response records to return in each call. If the number of + // remaining response records exceeds the specified MaxRecords value, a value is + // returned in a marker field of the response. You can retrieve the next set of + // records by retrying the command with the returned marker value. Default: 100 + // Constraints: minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeClusterSubnetGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/redshift.DescribeClusterSubnetGroups +type DescribeClusterSubnetGroupsPaginator struct { + options DescribeClusterSubnetGroupsPaginatorOptions + client DescribeClusterSubnetGroupsAPIClient + params *DescribeClusterSubnetGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeClusterSubnetGroupsPaginator returns a new +// DescribeClusterSubnetGroupsPaginator +func NewDescribeClusterSubnetGroupsPaginator(client DescribeClusterSubnetGroupsAPIClient, params *DescribeClusterSubnetGroupsInput, optFns ...func(*DescribeClusterSubnetGroupsPaginatorOptions)) *DescribeClusterSubnetGroupsPaginator { + options := DescribeClusterSubnetGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeClusterSubnetGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeClusterSubnetGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeClusterSubnetGroups page. +func (p *DescribeClusterSubnetGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeClusterSubnetGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeClusterSubnetGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeClusterSnapshotsAPIClient is a client that implements the +// DescribeClusterSnapshots operation. +type DescribeClusterSnapshotsAPIClient interface { + DescribeClusterSnapshots(context.Context, *DescribeClusterSnapshotsInput, ...func(*Options)) (*DescribeClusterSnapshotsOutput, error) +} + +var _ DescribeClusterSnapshotsAPIClient = (*Client)(nil) + +// DescribeClusterSnapshotsPaginatorOptions is the paginator options for +// DescribeClusterSnapshots +type DescribeClusterSnapshotsPaginatorOptions struct { + // The maximum number of response records to return in each call. If the number of + // remaining response records exceeds the specified MaxRecords value, a value is + // returned in a marker field of the response. You can retrieve the next set of + // records by retrying the command with the returned marker value. Default: 100 + // Constraints: minimum 20, maximum 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeClusterSnapshotsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/redshift.DescribeClusterSnapshots +type DescribeClusterSnapshotsPaginator struct { + options DescribeClusterSnapshotsPaginatorOptions + client DescribeClusterSnapshotsAPIClient + params *DescribeClusterSnapshotsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeClusterSnapshotsPaginator returns a new +// DescribeClusterSnapshotsPaginator +func NewDescribeClusterSnapshotsPaginator(client DescribeClusterSnapshotsAPIClient, params *DescribeClusterSnapshotsInput, optFns ...func(*DescribeClusterSnapshotsPaginatorOptions)) *DescribeClusterSnapshotsPaginator { + options := DescribeClusterSnapshotsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeClusterSnapshotsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeClusterSnapshotsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeClusterSnapshots page. +func (p *DescribeClusterSnapshotsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeClusterSnapshotsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxRecords = p.options.Limit + result, err := p.client.DescribeClusterSnapshots(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/redshiftdata/go.sum b/service/redshiftdata/go.sum index c669e324b14..32595049f96 100644 --- a/service/redshiftdata/go.sum +++ b/service/redshiftdata/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/redshiftdata/paginators.go b/service/redshiftdata/paginators.go new file mode 100644 index 00000000000..9624e59b111 --- /dev/null +++ b/service/redshiftdata/paginators.go @@ -0,0 +1,461 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshiftdata + +import ( + "context" + "fmt" +) + +// ListSchemasAPIClient is a client that implements the ListSchemas operation. +type ListSchemasAPIClient interface { + ListSchemas(context.Context, *ListSchemasInput, ...func(*Options)) (*ListSchemasOutput, error) +} + +var _ ListSchemasAPIClient = (*Client)(nil) + +// ListSchemasPaginatorOptions is the paginator options for ListSchemas +type ListSchemasPaginatorOptions struct { + // The maximum number of schemas to return in the response. If more schemas exist + // than fit in one response, then NextToken is returned to page through the + // results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListSchemasPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/redshiftdata.ListSchemas +type ListSchemasPaginator struct { + options ListSchemasPaginatorOptions + client ListSchemasAPIClient + params *ListSchemasInput + nextToken *string + firstPage bool + done bool +} + +// NewListSchemasPaginator returns a new ListSchemasPaginator +func NewListSchemasPaginator(client ListSchemasAPIClient, params *ListSchemasInput, optFns ...func(*ListSchemasPaginatorOptions)) *ListSchemasPaginator { + options := ListSchemasPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListSchemasPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSchemasPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListSchemas page. +func (p *ListSchemasPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSchemasOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListSchemas(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDatabasesAPIClient is a client that implements the ListDatabases operation. +type ListDatabasesAPIClient interface { + ListDatabases(context.Context, *ListDatabasesInput, ...func(*Options)) (*ListDatabasesOutput, error) +} + +var _ ListDatabasesAPIClient = (*Client)(nil) + +// ListDatabasesPaginatorOptions is the paginator options for ListDatabases +type ListDatabasesPaginatorOptions struct { + // The maximum number of databases to return in the response. If more databases + // exist than fit in one response, then NextToken is returned to page through the + // results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDatabasesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/redshiftdata.ListDatabases +type ListDatabasesPaginator struct { + options ListDatabasesPaginatorOptions + client ListDatabasesAPIClient + params *ListDatabasesInput + nextToken *string + firstPage bool + done bool +} + +// NewListDatabasesPaginator returns a new ListDatabasesPaginator +func NewListDatabasesPaginator(client ListDatabasesAPIClient, params *ListDatabasesInput, optFns ...func(*ListDatabasesPaginatorOptions)) *ListDatabasesPaginator { + options := ListDatabasesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDatabasesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDatabasesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDatabases page. +func (p *ListDatabasesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDatabasesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListDatabases(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetStatementResultAPIClient is a client that implements the GetStatementResult +// operation. +type GetStatementResultAPIClient interface { + GetStatementResult(context.Context, *GetStatementResultInput, ...func(*Options)) (*GetStatementResultOutput, error) +} + +var _ GetStatementResultAPIClient = (*Client)(nil) + +// GetStatementResultPaginatorOptions is the paginator options for +// GetStatementResult +type GetStatementResultPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetStatementResultPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/redshiftdata.GetStatementResult +type GetStatementResultPaginator struct { + options GetStatementResultPaginatorOptions + client GetStatementResultAPIClient + params *GetStatementResultInput + nextToken *string + firstPage bool + done bool +} + +// NewGetStatementResultPaginator returns a new GetStatementResultPaginator +func NewGetStatementResultPaginator(client GetStatementResultAPIClient, params *GetStatementResultInput, optFns ...func(*GetStatementResultPaginatorOptions)) *GetStatementResultPaginator { + options := GetStatementResultPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetStatementResultPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetStatementResultPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetStatementResult page. +func (p *GetStatementResultPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetStatementResultOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.GetStatementResult(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListStatementsAPIClient is a client that implements the ListStatements +// operation. +type ListStatementsAPIClient interface { + ListStatements(context.Context, *ListStatementsInput, ...func(*Options)) (*ListStatementsOutput, error) +} + +var _ ListStatementsAPIClient = (*Client)(nil) + +// ListStatementsPaginatorOptions is the paginator options for ListStatements +type ListStatementsPaginatorOptions struct { + // The maximum number of SQL statements to return in the response. If more SQL + // statements exist than fit in one response, then NextToken is returned to page + // through the results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListStatementsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/redshiftdata.ListStatements +type ListStatementsPaginator struct { + options ListStatementsPaginatorOptions + client ListStatementsAPIClient + params *ListStatementsInput + nextToken *string + firstPage bool + done bool +} + +// NewListStatementsPaginator returns a new ListStatementsPaginator +func NewListStatementsPaginator(client ListStatementsAPIClient, params *ListStatementsInput, optFns ...func(*ListStatementsPaginatorOptions)) *ListStatementsPaginator { + options := ListStatementsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListStatementsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListStatementsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListStatements page. +func (p *ListStatementsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListStatementsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListStatements(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTablesAPIClient is a client that implements the ListTables operation. +type ListTablesAPIClient interface { + ListTables(context.Context, *ListTablesInput, ...func(*Options)) (*ListTablesOutput, error) +} + +var _ ListTablesAPIClient = (*Client)(nil) + +// ListTablesPaginatorOptions is the paginator options for ListTables +type ListTablesPaginatorOptions struct { + // The maximum number of tables to return in the response. If more tables exist + // than fit in one response, then NextToken is returned to page through the + // results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTablesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/redshiftdata.ListTables +type ListTablesPaginator struct { + options ListTablesPaginatorOptions + client ListTablesAPIClient + params *ListTablesInput + nextToken *string + firstPage bool + done bool +} + +// NewListTablesPaginator returns a new ListTablesPaginator +func NewListTablesPaginator(client ListTablesAPIClient, params *ListTablesInput, optFns ...func(*ListTablesPaginatorOptions)) *ListTablesPaginator { + options := ListTablesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTablesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTablesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTables page. +func (p *ListTablesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTablesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListTables(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeTableAPIClient is a client that implements the DescribeTable operation. +type DescribeTableAPIClient interface { + DescribeTable(context.Context, *DescribeTableInput, ...func(*Options)) (*DescribeTableOutput, error) +} + +var _ DescribeTableAPIClient = (*Client)(nil) + +// DescribeTablePaginatorOptions is the paginator options for DescribeTable +type DescribeTablePaginatorOptions struct { + // The maximum number of tables to return in the response. If more tables exist + // than fit in one response, then NextToken is returned to page through the + // results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeTablePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/redshiftdata.DescribeTable +type DescribeTablePaginator struct { + options DescribeTablePaginatorOptions + client DescribeTableAPIClient + params *DescribeTableInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeTablePaginator returns a new DescribeTablePaginator +func NewDescribeTablePaginator(client DescribeTableAPIClient, params *DescribeTableInput, optFns ...func(*DescribeTablePaginatorOptions)) *DescribeTablePaginator { + options := DescribeTablePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeTablePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeTablePaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeTable page. +func (p *DescribeTablePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTableOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeTable(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/rekognition/go.sum b/service/rekognition/go.sum index c669e324b14..32595049f96 100644 --- a/service/rekognition/go.sum +++ b/service/rekognition/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/rekognition/paginators.go b/service/rekognition/paginators.go new file mode 100644 index 00000000000..117d06d4f6e --- /dev/null +++ b/service/rekognition/paginators.go @@ -0,0 +1,1007 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rekognition + +import ( + "context" + "fmt" +) + +// ListCollectionsAPIClient is a client that implements the ListCollections +// operation. +type ListCollectionsAPIClient interface { + ListCollections(context.Context, *ListCollectionsInput, ...func(*Options)) (*ListCollectionsOutput, error) +} + +var _ ListCollectionsAPIClient = (*Client)(nil) + +// ListCollectionsPaginatorOptions is the paginator options for ListCollections +type ListCollectionsPaginatorOptions struct { + // Maximum number of collection IDs to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListCollectionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rekognition.ListCollections +type ListCollectionsPaginator struct { + options ListCollectionsPaginatorOptions + client ListCollectionsAPIClient + params *ListCollectionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListCollectionsPaginator returns a new ListCollectionsPaginator +func NewListCollectionsPaginator(client ListCollectionsAPIClient, params *ListCollectionsInput, optFns ...func(*ListCollectionsPaginatorOptions)) *ListCollectionsPaginator { + options := ListCollectionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListCollectionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCollectionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListCollections page. +func (p *ListCollectionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCollectionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListCollections(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetTextDetectionAPIClient is a client that implements the GetTextDetection +// operation. +type GetTextDetectionAPIClient interface { + GetTextDetection(context.Context, *GetTextDetectionInput, ...func(*Options)) (*GetTextDetectionOutput, error) +} + +var _ GetTextDetectionAPIClient = (*Client)(nil) + +// GetTextDetectionPaginatorOptions is the paginator options for GetTextDetection +type GetTextDetectionPaginatorOptions struct { + // Maximum number of results to return per paginated call. The largest value you + // can specify is 1000. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetTextDetectionPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rekognition.GetTextDetection +type GetTextDetectionPaginator struct { + options GetTextDetectionPaginatorOptions + client GetTextDetectionAPIClient + params *GetTextDetectionInput + nextToken *string + firstPage bool + done bool +} + +// NewGetTextDetectionPaginator returns a new GetTextDetectionPaginator +func NewGetTextDetectionPaginator(client GetTextDetectionAPIClient, params *GetTextDetectionInput, optFns ...func(*GetTextDetectionPaginatorOptions)) *GetTextDetectionPaginator { + options := GetTextDetectionPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetTextDetectionPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetTextDetectionPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetTextDetection page. +func (p *GetTextDetectionPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetTextDetectionOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetTextDetection(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListStreamProcessorsAPIClient is a client that implements the +// ListStreamProcessors operation. +type ListStreamProcessorsAPIClient interface { + ListStreamProcessors(context.Context, *ListStreamProcessorsInput, ...func(*Options)) (*ListStreamProcessorsOutput, error) +} + +var _ ListStreamProcessorsAPIClient = (*Client)(nil) + +// ListStreamProcessorsPaginatorOptions is the paginator options for +// ListStreamProcessors +type ListStreamProcessorsPaginatorOptions struct { + // Maximum number of stream processors you want Amazon Rekognition Video to return + // in the response. The default is 1000. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListStreamProcessorsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rekognition.ListStreamProcessors +type ListStreamProcessorsPaginator struct { + options ListStreamProcessorsPaginatorOptions + client ListStreamProcessorsAPIClient + params *ListStreamProcessorsInput + nextToken *string + firstPage bool + done bool +} + +// NewListStreamProcessorsPaginator returns a new ListStreamProcessorsPaginator +func NewListStreamProcessorsPaginator(client ListStreamProcessorsAPIClient, params *ListStreamProcessorsInput, optFns ...func(*ListStreamProcessorsPaginatorOptions)) *ListStreamProcessorsPaginator { + options := ListStreamProcessorsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListStreamProcessorsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListStreamProcessorsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListStreamProcessors page. +func (p *ListStreamProcessorsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListStreamProcessorsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListStreamProcessors(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetContentModerationAPIClient is a client that implements the +// GetContentModeration operation. +type GetContentModerationAPIClient interface { + GetContentModeration(context.Context, *GetContentModerationInput, ...func(*Options)) (*GetContentModerationOutput, error) +} + +var _ GetContentModerationAPIClient = (*Client)(nil) + +// GetContentModerationPaginatorOptions is the paginator options for +// GetContentModeration +type GetContentModerationPaginatorOptions struct { + // Maximum number of results to return per paginated call. The largest value you + // can specify is 1000. If you specify a value greater than 1000, a maximum of 1000 + // results is returned. The default value is 1000. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetContentModerationPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rekognition.GetContentModeration +type GetContentModerationPaginator struct { + options GetContentModerationPaginatorOptions + client GetContentModerationAPIClient + params *GetContentModerationInput + nextToken *string + firstPage bool + done bool +} + +// NewGetContentModerationPaginator returns a new GetContentModerationPaginator +func NewGetContentModerationPaginator(client GetContentModerationAPIClient, params *GetContentModerationInput, optFns ...func(*GetContentModerationPaginatorOptions)) *GetContentModerationPaginator { + options := GetContentModerationPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetContentModerationPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetContentModerationPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetContentModeration page. +func (p *GetContentModerationPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetContentModerationOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetContentModeration(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetPersonTrackingAPIClient is a client that implements the GetPersonTracking +// operation. +type GetPersonTrackingAPIClient interface { + GetPersonTracking(context.Context, *GetPersonTrackingInput, ...func(*Options)) (*GetPersonTrackingOutput, error) +} + +var _ GetPersonTrackingAPIClient = (*Client)(nil) + +// GetPersonTrackingPaginatorOptions is the paginator options for GetPersonTracking +type GetPersonTrackingPaginatorOptions struct { + // Maximum number of results to return per paginated call. The largest value you + // can specify is 1000. If you specify a value greater than 1000, a maximum of 1000 + // results is returned. The default value is 1000. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetPersonTrackingPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rekognition.GetPersonTracking +type GetPersonTrackingPaginator struct { + options GetPersonTrackingPaginatorOptions + client GetPersonTrackingAPIClient + params *GetPersonTrackingInput + nextToken *string + firstPage bool + done bool +} + +// NewGetPersonTrackingPaginator returns a new GetPersonTrackingPaginator +func NewGetPersonTrackingPaginator(client GetPersonTrackingAPIClient, params *GetPersonTrackingInput, optFns ...func(*GetPersonTrackingPaginatorOptions)) *GetPersonTrackingPaginator { + options := GetPersonTrackingPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetPersonTrackingPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetPersonTrackingPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetPersonTracking page. +func (p *GetPersonTrackingPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetPersonTrackingOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetPersonTracking(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeProjectsAPIClient is a client that implements the DescribeProjects +// operation. +type DescribeProjectsAPIClient interface { + DescribeProjects(context.Context, *DescribeProjectsInput, ...func(*Options)) (*DescribeProjectsOutput, error) +} + +var _ DescribeProjectsAPIClient = (*Client)(nil) + +// DescribeProjectsPaginatorOptions is the paginator options for DescribeProjects +type DescribeProjectsPaginatorOptions struct { + // The maximum number of results to return per paginated call. The largest value + // you can specify is 100. If you specify a value greater than 100, a + // ValidationException error occurs. The default value is 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeProjectsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rekognition.DescribeProjects +type DescribeProjectsPaginator struct { + options DescribeProjectsPaginatorOptions + client DescribeProjectsAPIClient + params *DescribeProjectsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeProjectsPaginator returns a new DescribeProjectsPaginator +func NewDescribeProjectsPaginator(client DescribeProjectsAPIClient, params *DescribeProjectsInput, optFns ...func(*DescribeProjectsPaginatorOptions)) *DescribeProjectsPaginator { + options := DescribeProjectsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeProjectsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeProjectsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeProjects page. +func (p *DescribeProjectsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeProjectsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeProjects(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetCelebrityRecognitionAPIClient is a client that implements the +// GetCelebrityRecognition operation. +type GetCelebrityRecognitionAPIClient interface { + GetCelebrityRecognition(context.Context, *GetCelebrityRecognitionInput, ...func(*Options)) (*GetCelebrityRecognitionOutput, error) +} + +var _ GetCelebrityRecognitionAPIClient = (*Client)(nil) + +// GetCelebrityRecognitionPaginatorOptions is the paginator options for +// GetCelebrityRecognition +type GetCelebrityRecognitionPaginatorOptions struct { + // Maximum number of results to return per paginated call. The largest value you + // can specify is 1000. If you specify a value greater than 1000, a maximum of 1000 + // results is returned. The default value is 1000. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetCelebrityRecognitionPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rekognition.GetCelebrityRecognition +type GetCelebrityRecognitionPaginator struct { + options GetCelebrityRecognitionPaginatorOptions + client GetCelebrityRecognitionAPIClient + params *GetCelebrityRecognitionInput + nextToken *string + firstPage bool + done bool +} + +// NewGetCelebrityRecognitionPaginator returns a new +// GetCelebrityRecognitionPaginator +func NewGetCelebrityRecognitionPaginator(client GetCelebrityRecognitionAPIClient, params *GetCelebrityRecognitionInput, optFns ...func(*GetCelebrityRecognitionPaginatorOptions)) *GetCelebrityRecognitionPaginator { + options := GetCelebrityRecognitionPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetCelebrityRecognitionPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetCelebrityRecognitionPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetCelebrityRecognition page. +func (p *GetCelebrityRecognitionPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetCelebrityRecognitionOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetCelebrityRecognition(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetFaceSearchAPIClient is a client that implements the GetFaceSearch operation. +type GetFaceSearchAPIClient interface { + GetFaceSearch(context.Context, *GetFaceSearchInput, ...func(*Options)) (*GetFaceSearchOutput, error) +} + +var _ GetFaceSearchAPIClient = (*Client)(nil) + +// GetFaceSearchPaginatorOptions is the paginator options for GetFaceSearch +type GetFaceSearchPaginatorOptions struct { + // Maximum number of results to return per paginated call. The largest value you + // can specify is 1000. If you specify a value greater than 1000, a maximum of 1000 + // results is returned. The default value is 1000. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetFaceSearchPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rekognition.GetFaceSearch +type GetFaceSearchPaginator struct { + options GetFaceSearchPaginatorOptions + client GetFaceSearchAPIClient + params *GetFaceSearchInput + nextToken *string + firstPage bool + done bool +} + +// NewGetFaceSearchPaginator returns a new GetFaceSearchPaginator +func NewGetFaceSearchPaginator(client GetFaceSearchAPIClient, params *GetFaceSearchInput, optFns ...func(*GetFaceSearchPaginatorOptions)) *GetFaceSearchPaginator { + options := GetFaceSearchPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetFaceSearchPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetFaceSearchPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetFaceSearch page. +func (p *GetFaceSearchPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetFaceSearchOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetFaceSearch(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetFaceDetectionAPIClient is a client that implements the GetFaceDetection +// operation. +type GetFaceDetectionAPIClient interface { + GetFaceDetection(context.Context, *GetFaceDetectionInput, ...func(*Options)) (*GetFaceDetectionOutput, error) +} + +var _ GetFaceDetectionAPIClient = (*Client)(nil) + +// GetFaceDetectionPaginatorOptions is the paginator options for GetFaceDetection +type GetFaceDetectionPaginatorOptions struct { + // Maximum number of results to return per paginated call. The largest value you + // can specify is 1000. If you specify a value greater than 1000, a maximum of 1000 + // results is returned. The default value is 1000. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetFaceDetectionPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rekognition.GetFaceDetection +type GetFaceDetectionPaginator struct { + options GetFaceDetectionPaginatorOptions + client GetFaceDetectionAPIClient + params *GetFaceDetectionInput + nextToken *string + firstPage bool + done bool +} + +// NewGetFaceDetectionPaginator returns a new GetFaceDetectionPaginator +func NewGetFaceDetectionPaginator(client GetFaceDetectionAPIClient, params *GetFaceDetectionInput, optFns ...func(*GetFaceDetectionPaginatorOptions)) *GetFaceDetectionPaginator { + options := GetFaceDetectionPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetFaceDetectionPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetFaceDetectionPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetFaceDetection page. +func (p *GetFaceDetectionPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetFaceDetectionOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetFaceDetection(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetSegmentDetectionAPIClient is a client that implements the GetSegmentDetection +// operation. +type GetSegmentDetectionAPIClient interface { + GetSegmentDetection(context.Context, *GetSegmentDetectionInput, ...func(*Options)) (*GetSegmentDetectionOutput, error) +} + +var _ GetSegmentDetectionAPIClient = (*Client)(nil) + +// GetSegmentDetectionPaginatorOptions is the paginator options for +// GetSegmentDetection +type GetSegmentDetectionPaginatorOptions struct { + // Maximum number of results to return per paginated call. The largest value you + // can specify is 1000. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetSegmentDetectionPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rekognition.GetSegmentDetection +type GetSegmentDetectionPaginator struct { + options GetSegmentDetectionPaginatorOptions + client GetSegmentDetectionAPIClient + params *GetSegmentDetectionInput + nextToken *string + firstPage bool + done bool +} + +// NewGetSegmentDetectionPaginator returns a new GetSegmentDetectionPaginator +func NewGetSegmentDetectionPaginator(client GetSegmentDetectionAPIClient, params *GetSegmentDetectionInput, optFns ...func(*GetSegmentDetectionPaginatorOptions)) *GetSegmentDetectionPaginator { + options := GetSegmentDetectionPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetSegmentDetectionPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetSegmentDetectionPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetSegmentDetection page. +func (p *GetSegmentDetectionPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetSegmentDetectionOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetSegmentDetection(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListFacesAPIClient is a client that implements the ListFaces operation. +type ListFacesAPIClient interface { + ListFaces(context.Context, *ListFacesInput, ...func(*Options)) (*ListFacesOutput, error) +} + +var _ ListFacesAPIClient = (*Client)(nil) + +// ListFacesPaginatorOptions is the paginator options for ListFaces +type ListFacesPaginatorOptions struct { + // Maximum number of faces to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListFacesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rekognition.ListFaces +type ListFacesPaginator struct { + options ListFacesPaginatorOptions + client ListFacesAPIClient + params *ListFacesInput + nextToken *string + firstPage bool + done bool +} + +// NewListFacesPaginator returns a new ListFacesPaginator +func NewListFacesPaginator(client ListFacesAPIClient, params *ListFacesInput, optFns ...func(*ListFacesPaginatorOptions)) *ListFacesPaginator { + options := ListFacesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListFacesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListFacesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListFaces page. +func (p *ListFacesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFacesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListFaces(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeProjectVersionsAPIClient is a client that implements the +// DescribeProjectVersions operation. +type DescribeProjectVersionsAPIClient interface { + DescribeProjectVersions(context.Context, *DescribeProjectVersionsInput, ...func(*Options)) (*DescribeProjectVersionsOutput, error) +} + +var _ DescribeProjectVersionsAPIClient = (*Client)(nil) + +// DescribeProjectVersionsPaginatorOptions is the paginator options for +// DescribeProjectVersions +type DescribeProjectVersionsPaginatorOptions struct { + // The maximum number of results to return per paginated call. The largest value + // you can specify is 100. If you specify a value greater than 100, a + // ValidationException error occurs. The default value is 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeProjectVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rekognition.DescribeProjectVersions +type DescribeProjectVersionsPaginator struct { + options DescribeProjectVersionsPaginatorOptions + client DescribeProjectVersionsAPIClient + params *DescribeProjectVersionsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeProjectVersionsPaginator returns a new +// DescribeProjectVersionsPaginator +func NewDescribeProjectVersionsPaginator(client DescribeProjectVersionsAPIClient, params *DescribeProjectVersionsInput, optFns ...func(*DescribeProjectVersionsPaginatorOptions)) *DescribeProjectVersionsPaginator { + options := DescribeProjectVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeProjectVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeProjectVersionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeProjectVersions page. +func (p *DescribeProjectVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeProjectVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeProjectVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetLabelDetectionAPIClient is a client that implements the GetLabelDetection +// operation. +type GetLabelDetectionAPIClient interface { + GetLabelDetection(context.Context, *GetLabelDetectionInput, ...func(*Options)) (*GetLabelDetectionOutput, error) +} + +var _ GetLabelDetectionAPIClient = (*Client)(nil) + +// GetLabelDetectionPaginatorOptions is the paginator options for GetLabelDetection +type GetLabelDetectionPaginatorOptions struct { + // Maximum number of results to return per paginated call. The largest value you + // can specify is 1000. If you specify a value greater than 1000, a maximum of 1000 + // results is returned. The default value is 1000. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetLabelDetectionPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rekognition.GetLabelDetection +type GetLabelDetectionPaginator struct { + options GetLabelDetectionPaginatorOptions + client GetLabelDetectionAPIClient + params *GetLabelDetectionInput + nextToken *string + firstPage bool + done bool +} + +// NewGetLabelDetectionPaginator returns a new GetLabelDetectionPaginator +func NewGetLabelDetectionPaginator(client GetLabelDetectionAPIClient, params *GetLabelDetectionInput, optFns ...func(*GetLabelDetectionPaginatorOptions)) *GetLabelDetectionPaginator { + options := GetLabelDetectionPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetLabelDetectionPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetLabelDetectionPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetLabelDetection page. +func (p *GetLabelDetectionPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetLabelDetectionOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetLabelDetection(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/resourcegroups/go.sum b/service/resourcegroups/go.sum index c669e324b14..32595049f96 100644 --- a/service/resourcegroups/go.sum +++ b/service/resourcegroups/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/resourcegroups/paginators.go b/service/resourcegroups/paginators.go new file mode 100644 index 00000000000..31cc59117f5 --- /dev/null +++ b/service/resourcegroups/paginators.go @@ -0,0 +1,257 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resourcegroups + +import ( + "context" + "fmt" +) + +// ListGroupsAPIClient is a client that implements the ListGroups operation. +type ListGroupsAPIClient interface { + ListGroups(context.Context, *ListGroupsInput, ...func(*Options)) (*ListGroupsOutput, error) +} + +var _ ListGroupsAPIClient = (*Client)(nil) + +// ListGroupsPaginatorOptions is the paginator options for ListGroups +type ListGroupsPaginatorOptions struct { + // The total number of results that you want included on each page of the response. + // If you do not include this parameter, it defaults to a value that is specific to + // the operation. If additional items exist beyond the maximum you specify, the + // NextToken response element is present and has a value (is not null). Include + // that value as the NextToken request parameter in the next call to the operation + // to get the next part of the results. Note that the service might return fewer + // results than the maximum even when there are more results available. You should + // check NextToken after every operation to ensure that you receive all of the + // results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/resourcegroups.ListGroups +type ListGroupsPaginator struct { + options ListGroupsPaginatorOptions + client ListGroupsAPIClient + params *ListGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewListGroupsPaginator returns a new ListGroupsPaginator +func NewListGroupsPaginator(client ListGroupsAPIClient, params *ListGroupsInput, optFns ...func(*ListGroupsPaginatorOptions)) *ListGroupsPaginator { + options := ListGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListGroups page. +func (p *ListGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// SearchResourcesAPIClient is a client that implements the SearchResources +// operation. +type SearchResourcesAPIClient interface { + SearchResources(context.Context, *SearchResourcesInput, ...func(*Options)) (*SearchResourcesOutput, error) +} + +var _ SearchResourcesAPIClient = (*Client)(nil) + +// SearchResourcesPaginatorOptions is the paginator options for SearchResources +type SearchResourcesPaginatorOptions struct { + // The total number of results that you want included on each page of the response. + // If you do not include this parameter, it defaults to a value that is specific to + // the operation. If additional items exist beyond the maximum you specify, the + // NextToken response element is present and has a value (is not null). Include + // that value as the NextToken request parameter in the next call to the operation + // to get the next part of the results. Note that the service might return fewer + // results than the maximum even when there are more results available. You should + // check NextToken after every operation to ensure that you receive all of the + // results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// SearchResourcesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/resourcegroups.SearchResources +type SearchResourcesPaginator struct { + options SearchResourcesPaginatorOptions + client SearchResourcesAPIClient + params *SearchResourcesInput + nextToken *string + firstPage bool + done bool +} + +// NewSearchResourcesPaginator returns a new SearchResourcesPaginator +func NewSearchResourcesPaginator(client SearchResourcesAPIClient, params *SearchResourcesInput, optFns ...func(*SearchResourcesPaginatorOptions)) *SearchResourcesPaginator { + options := SearchResourcesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &SearchResourcesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchResourcesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next SearchResources page. +func (p *SearchResourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchResourcesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.SearchResources(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListGroupResourcesAPIClient is a client that implements the ListGroupResources +// operation. +type ListGroupResourcesAPIClient interface { + ListGroupResources(context.Context, *ListGroupResourcesInput, ...func(*Options)) (*ListGroupResourcesOutput, error) +} + +var _ ListGroupResourcesAPIClient = (*Client)(nil) + +// ListGroupResourcesPaginatorOptions is the paginator options for +// ListGroupResources +type ListGroupResourcesPaginatorOptions struct { + // The total number of results that you want included on each page of the response. + // If you do not include this parameter, it defaults to a value that is specific to + // the operation. If additional items exist beyond the maximum you specify, the + // NextToken response element is present and has a value (is not null). Include + // that value as the NextToken request parameter in the next call to the operation + // to get the next part of the results. Note that the service might return fewer + // results than the maximum even when there are more results available. You should + // check NextToken after every operation to ensure that you receive all of the + // results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListGroupResourcesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/resourcegroups.ListGroupResources +type ListGroupResourcesPaginator struct { + options ListGroupResourcesPaginatorOptions + client ListGroupResourcesAPIClient + params *ListGroupResourcesInput + nextToken *string + firstPage bool + done bool +} + +// NewListGroupResourcesPaginator returns a new ListGroupResourcesPaginator +func NewListGroupResourcesPaginator(client ListGroupResourcesAPIClient, params *ListGroupResourcesInput, optFns ...func(*ListGroupResourcesPaginatorOptions)) *ListGroupResourcesPaginator { + options := ListGroupResourcesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListGroupResourcesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListGroupResourcesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListGroupResources page. +func (p *ListGroupResourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListGroupResourcesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListGroupResources(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/resourcegroupstaggingapi/go.sum b/service/resourcegroupstaggingapi/go.sum index c669e324b14..32595049f96 100644 --- a/service/resourcegroupstaggingapi/go.sum +++ b/service/resourcegroupstaggingapi/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/resourcegroupstaggingapi/paginators.go b/service/resourcegroupstaggingapi/paginators.go new file mode 100644 index 00000000000..894775e0543 --- /dev/null +++ b/service/resourcegroupstaggingapi/paginators.go @@ -0,0 +1,300 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resourcegroupstaggingapi + +import ( + "context" + "fmt" +) + +// GetTagValuesAPIClient is a client that implements the GetTagValues operation. +type GetTagValuesAPIClient interface { + GetTagValues(context.Context, *GetTagValuesInput, ...func(*Options)) (*GetTagValuesOutput, error) +} + +var _ GetTagValuesAPIClient = (*Client)(nil) + +// GetTagValuesPaginatorOptions is the paginator options for GetTagValues +type GetTagValuesPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetTagValuesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi.GetTagValues +type GetTagValuesPaginator struct { + options GetTagValuesPaginatorOptions + client GetTagValuesAPIClient + params *GetTagValuesInput + nextToken *string + firstPage bool + done bool +} + +// NewGetTagValuesPaginator returns a new GetTagValuesPaginator +func NewGetTagValuesPaginator(client GetTagValuesAPIClient, params *GetTagValuesInput, optFns ...func(*GetTagValuesPaginatorOptions)) *GetTagValuesPaginator { + options := GetTagValuesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetTagValuesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetTagValuesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetTagValues page. +func (p *GetTagValuesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetTagValuesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PaginationToken = p.nextToken + result, err := p.client.GetTagValues(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.PaginationToken + if p.options.StopOnDuplicateToken && params.PaginationToken != nil && p.nextToken != nil && *params.PaginationToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetResourcesAPIClient is a client that implements the GetResources operation. +type GetResourcesAPIClient interface { + GetResources(context.Context, *GetResourcesInput, ...func(*Options)) (*GetResourcesOutput, error) +} + +var _ GetResourcesAPIClient = (*Client)(nil) + +// GetResourcesPaginatorOptions is the paginator options for GetResources +type GetResourcesPaginatorOptions struct { + // A limit that restricts the number of resources returned by GetResources in + // paginated output. You can set ResourcesPerPage to a minimum of 1 item and the + // maximum of 100 items. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetResourcesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi.GetResources +type GetResourcesPaginator struct { + options GetResourcesPaginatorOptions + client GetResourcesAPIClient + params *GetResourcesInput + nextToken *string + firstPage bool + done bool +} + +// NewGetResourcesPaginator returns a new GetResourcesPaginator +func NewGetResourcesPaginator(client GetResourcesAPIClient, params *GetResourcesInput, optFns ...func(*GetResourcesPaginatorOptions)) *GetResourcesPaginator { + options := GetResourcesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetResourcesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetResourcesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetResources page. +func (p *GetResourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetResourcesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PaginationToken = p.nextToken + params.ResourcesPerPage = p.options.Limit + result, err := p.client.GetResources(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.PaginationToken + if p.options.StopOnDuplicateToken && params.PaginationToken != nil && p.nextToken != nil && *params.PaginationToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetTagKeysAPIClient is a client that implements the GetTagKeys operation. +type GetTagKeysAPIClient interface { + GetTagKeys(context.Context, *GetTagKeysInput, ...func(*Options)) (*GetTagKeysOutput, error) +} + +var _ GetTagKeysAPIClient = (*Client)(nil) + +// GetTagKeysPaginatorOptions is the paginator options for GetTagKeys +type GetTagKeysPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetTagKeysPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi.GetTagKeys +type GetTagKeysPaginator struct { + options GetTagKeysPaginatorOptions + client GetTagKeysAPIClient + params *GetTagKeysInput + nextToken *string + firstPage bool + done bool +} + +// NewGetTagKeysPaginator returns a new GetTagKeysPaginator +func NewGetTagKeysPaginator(client GetTagKeysAPIClient, params *GetTagKeysInput, optFns ...func(*GetTagKeysPaginatorOptions)) *GetTagKeysPaginator { + options := GetTagKeysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetTagKeysPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetTagKeysPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetTagKeys page. +func (p *GetTagKeysPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetTagKeysOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PaginationToken = p.nextToken + result, err := p.client.GetTagKeys(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.PaginationToken + if p.options.StopOnDuplicateToken && params.PaginationToken != nil && p.nextToken != nil && *params.PaginationToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetComplianceSummaryAPIClient is a client that implements the +// GetComplianceSummary operation. +type GetComplianceSummaryAPIClient interface { + GetComplianceSummary(context.Context, *GetComplianceSummaryInput, ...func(*Options)) (*GetComplianceSummaryOutput, error) +} + +var _ GetComplianceSummaryAPIClient = (*Client)(nil) + +// GetComplianceSummaryPaginatorOptions is the paginator options for +// GetComplianceSummary +type GetComplianceSummaryPaginatorOptions struct { + // A limit that restricts the number of results that are returned per page. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetComplianceSummaryPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi.GetComplianceSummary +type GetComplianceSummaryPaginator struct { + options GetComplianceSummaryPaginatorOptions + client GetComplianceSummaryAPIClient + params *GetComplianceSummaryInput + nextToken *string + firstPage bool + done bool +} + +// NewGetComplianceSummaryPaginator returns a new GetComplianceSummaryPaginator +func NewGetComplianceSummaryPaginator(client GetComplianceSummaryAPIClient, params *GetComplianceSummaryInput, optFns ...func(*GetComplianceSummaryPaginatorOptions)) *GetComplianceSummaryPaginator { + options := GetComplianceSummaryPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetComplianceSummaryPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetComplianceSummaryPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetComplianceSummary page. +func (p *GetComplianceSummaryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetComplianceSummaryOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PaginationToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetComplianceSummary(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.PaginationToken + if p.options.StopOnDuplicateToken && params.PaginationToken != nil && p.nextToken != nil && *params.PaginationToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/robomaker/go.sum b/service/robomaker/go.sum index c669e324b14..32595049f96 100644 --- a/service/robomaker/go.sum +++ b/service/robomaker/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/robomaker/paginators.go b/service/robomaker/paginators.go new file mode 100644 index 00000000000..9d9b6c30621 --- /dev/null +++ b/service/robomaker/paginators.go @@ -0,0 +1,895 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package robomaker + +import ( + "context" + "fmt" +) + +// ListWorldTemplatesAPIClient is a client that implements the ListWorldTemplates +// operation. +type ListWorldTemplatesAPIClient interface { + ListWorldTemplates(context.Context, *ListWorldTemplatesInput, ...func(*Options)) (*ListWorldTemplatesOutput, error) +} + +var _ ListWorldTemplatesAPIClient = (*Client)(nil) + +// ListWorldTemplatesPaginatorOptions is the paginator options for +// ListWorldTemplates +type ListWorldTemplatesPaginatorOptions struct { + // When this parameter is used, ListWorldTemplates only returns maxResults results + // in a single page along with a nextToken response element. The remaining results + // of the initial request can be seen by sending another ListWorldTemplates request + // with the returned nextToken value. This value can be between 1 and 100. If this + // parameter is not used, then ListWorldTemplates returns up to 100 results and a + // nextToken value if applicable. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListWorldTemplatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/robomaker.ListWorldTemplates +type ListWorldTemplatesPaginator struct { + options ListWorldTemplatesPaginatorOptions + client ListWorldTemplatesAPIClient + params *ListWorldTemplatesInput + nextToken *string + firstPage bool + done bool +} + +// NewListWorldTemplatesPaginator returns a new ListWorldTemplatesPaginator +func NewListWorldTemplatesPaginator(client ListWorldTemplatesAPIClient, params *ListWorldTemplatesInput, optFns ...func(*ListWorldTemplatesPaginatorOptions)) *ListWorldTemplatesPaginator { + options := ListWorldTemplatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListWorldTemplatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListWorldTemplatesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListWorldTemplates page. +func (p *ListWorldTemplatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListWorldTemplatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListWorldTemplates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListFleetsAPIClient is a client that implements the ListFleets operation. +type ListFleetsAPIClient interface { + ListFleets(context.Context, *ListFleetsInput, ...func(*Options)) (*ListFleetsOutput, error) +} + +var _ ListFleetsAPIClient = (*Client)(nil) + +// ListFleetsPaginatorOptions is the paginator options for ListFleets +type ListFleetsPaginatorOptions struct { + // When this parameter is used, ListFleets only returns maxResults results in a + // single page along with a nextToken response element. The remaining results of + // the initial request can be seen by sending another ListFleets request with the + // returned nextToken value. This value can be between 1 and 200. If this parameter + // is not used, then ListFleets returns up to 200 results and a nextToken value if + // applicable. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListFleetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/robomaker.ListFleets +type ListFleetsPaginator struct { + options ListFleetsPaginatorOptions + client ListFleetsAPIClient + params *ListFleetsInput + nextToken *string + firstPage bool + done bool +} + +// NewListFleetsPaginator returns a new ListFleetsPaginator +func NewListFleetsPaginator(client ListFleetsAPIClient, params *ListFleetsInput, optFns ...func(*ListFleetsPaginatorOptions)) *ListFleetsPaginator { + options := ListFleetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListFleetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListFleetsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListFleets page. +func (p *ListFleetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFleetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListFleets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDeploymentJobsAPIClient is a client that implements the ListDeploymentJobs +// operation. +type ListDeploymentJobsAPIClient interface { + ListDeploymentJobs(context.Context, *ListDeploymentJobsInput, ...func(*Options)) (*ListDeploymentJobsOutput, error) +} + +var _ ListDeploymentJobsAPIClient = (*Client)(nil) + +// ListDeploymentJobsPaginatorOptions is the paginator options for +// ListDeploymentJobs +type ListDeploymentJobsPaginatorOptions struct { + // When this parameter is used, ListDeploymentJobs only returns maxResults results + // in a single page along with a nextToken response element. The remaining results + // of the initial request can be seen by sending another ListDeploymentJobs request + // with the returned nextToken value. This value can be between 1 and 200. If this + // parameter is not used, then ListDeploymentJobs returns up to 200 results and a + // nextToken value if applicable. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDeploymentJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/robomaker.ListDeploymentJobs +type ListDeploymentJobsPaginator struct { + options ListDeploymentJobsPaginatorOptions + client ListDeploymentJobsAPIClient + params *ListDeploymentJobsInput + nextToken *string + firstPage bool + done bool +} + +// NewListDeploymentJobsPaginator returns a new ListDeploymentJobsPaginator +func NewListDeploymentJobsPaginator(client ListDeploymentJobsAPIClient, params *ListDeploymentJobsInput, optFns ...func(*ListDeploymentJobsPaginatorOptions)) *ListDeploymentJobsPaginator { + options := ListDeploymentJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDeploymentJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDeploymentJobsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDeploymentJobs page. +func (p *ListDeploymentJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDeploymentJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListDeploymentJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListWorldExportJobsAPIClient is a client that implements the ListWorldExportJobs +// operation. +type ListWorldExportJobsAPIClient interface { + ListWorldExportJobs(context.Context, *ListWorldExportJobsInput, ...func(*Options)) (*ListWorldExportJobsOutput, error) +} + +var _ ListWorldExportJobsAPIClient = (*Client)(nil) + +// ListWorldExportJobsPaginatorOptions is the paginator options for +// ListWorldExportJobs +type ListWorldExportJobsPaginatorOptions struct { + // When this parameter is used, ListWorldExportJobs only returns maxResults results + // in a single page along with a nextToken response element. The remaining results + // of the initial request can be seen by sending another ListWorldExportJobs + // request with the returned nextToken value. This value can be between 1 and 100. + // If this parameter is not used, then ListWorldExportJobs returns up to 100 + // results and a nextToken value if applicable. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListWorldExportJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/robomaker.ListWorldExportJobs +type ListWorldExportJobsPaginator struct { + options ListWorldExportJobsPaginatorOptions + client ListWorldExportJobsAPIClient + params *ListWorldExportJobsInput + nextToken *string + firstPage bool + done bool +} + +// NewListWorldExportJobsPaginator returns a new ListWorldExportJobsPaginator +func NewListWorldExportJobsPaginator(client ListWorldExportJobsAPIClient, params *ListWorldExportJobsInput, optFns ...func(*ListWorldExportJobsPaginatorOptions)) *ListWorldExportJobsPaginator { + options := ListWorldExportJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListWorldExportJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListWorldExportJobsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListWorldExportJobs page. +func (p *ListWorldExportJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListWorldExportJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListWorldExportJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListSimulationJobsAPIClient is a client that implements the ListSimulationJobs +// operation. +type ListSimulationJobsAPIClient interface { + ListSimulationJobs(context.Context, *ListSimulationJobsInput, ...func(*Options)) (*ListSimulationJobsOutput, error) +} + +var _ ListSimulationJobsAPIClient = (*Client)(nil) + +// ListSimulationJobsPaginatorOptions is the paginator options for +// ListSimulationJobs +type ListSimulationJobsPaginatorOptions struct { + // When this parameter is used, ListSimulationJobs only returns maxResults results + // in a single page along with a nextToken response element. The remaining results + // of the initial request can be seen by sending another ListSimulationJobs request + // with the returned nextToken value. This value can be between 1 and 1000. If this + // parameter is not used, then ListSimulationJobs returns up to 1000 results and a + // nextToken value if applicable. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListSimulationJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/robomaker.ListSimulationJobs +type ListSimulationJobsPaginator struct { + options ListSimulationJobsPaginatorOptions + client ListSimulationJobsAPIClient + params *ListSimulationJobsInput + nextToken *string + firstPage bool + done bool +} + +// NewListSimulationJobsPaginator returns a new ListSimulationJobsPaginator +func NewListSimulationJobsPaginator(client ListSimulationJobsAPIClient, params *ListSimulationJobsInput, optFns ...func(*ListSimulationJobsPaginatorOptions)) *ListSimulationJobsPaginator { + options := ListSimulationJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListSimulationJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSimulationJobsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListSimulationJobs page. +func (p *ListSimulationJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSimulationJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListSimulationJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListRobotApplicationsAPIClient is a client that implements the +// ListRobotApplications operation. +type ListRobotApplicationsAPIClient interface { + ListRobotApplications(context.Context, *ListRobotApplicationsInput, ...func(*Options)) (*ListRobotApplicationsOutput, error) +} + +var _ ListRobotApplicationsAPIClient = (*Client)(nil) + +// ListRobotApplicationsPaginatorOptions is the paginator options for +// ListRobotApplications +type ListRobotApplicationsPaginatorOptions struct { + // When this parameter is used, ListRobotApplications only returns maxResults + // results in a single page along with a nextToken response element. The remaining + // results of the initial request can be seen by sending another + // ListRobotApplications request with the returned nextToken value. This value can + // be between 1 and 100. If this parameter is not used, then ListRobotApplications + // returns up to 100 results and a nextToken value if applicable. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListRobotApplicationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/robomaker.ListRobotApplications +type ListRobotApplicationsPaginator struct { + options ListRobotApplicationsPaginatorOptions + client ListRobotApplicationsAPIClient + params *ListRobotApplicationsInput + nextToken *string + firstPage bool + done bool +} + +// NewListRobotApplicationsPaginator returns a new ListRobotApplicationsPaginator +func NewListRobotApplicationsPaginator(client ListRobotApplicationsAPIClient, params *ListRobotApplicationsInput, optFns ...func(*ListRobotApplicationsPaginatorOptions)) *ListRobotApplicationsPaginator { + options := ListRobotApplicationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListRobotApplicationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRobotApplicationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListRobotApplications page. +func (p *ListRobotApplicationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRobotApplicationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListRobotApplications(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListSimulationJobBatchesAPIClient is a client that implements the +// ListSimulationJobBatches operation. +type ListSimulationJobBatchesAPIClient interface { + ListSimulationJobBatches(context.Context, *ListSimulationJobBatchesInput, ...func(*Options)) (*ListSimulationJobBatchesOutput, error) +} + +var _ ListSimulationJobBatchesAPIClient = (*Client)(nil) + +// ListSimulationJobBatchesPaginatorOptions is the paginator options for +// ListSimulationJobBatches +type ListSimulationJobBatchesPaginatorOptions struct { + // When this parameter is used, ListSimulationJobBatches only returns maxResults + // results in a single page along with a nextToken response element. The remaining + // results of the initial request can be seen by sending another + // ListSimulationJobBatches request with the returned nextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListSimulationJobBatchesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/robomaker.ListSimulationJobBatches +type ListSimulationJobBatchesPaginator struct { + options ListSimulationJobBatchesPaginatorOptions + client ListSimulationJobBatchesAPIClient + params *ListSimulationJobBatchesInput + nextToken *string + firstPage bool + done bool +} + +// NewListSimulationJobBatchesPaginator returns a new +// ListSimulationJobBatchesPaginator +func NewListSimulationJobBatchesPaginator(client ListSimulationJobBatchesAPIClient, params *ListSimulationJobBatchesInput, optFns ...func(*ListSimulationJobBatchesPaginatorOptions)) *ListSimulationJobBatchesPaginator { + options := ListSimulationJobBatchesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListSimulationJobBatchesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSimulationJobBatchesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListSimulationJobBatches page. +func (p *ListSimulationJobBatchesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSimulationJobBatchesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListSimulationJobBatches(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListRobotsAPIClient is a client that implements the ListRobots operation. +type ListRobotsAPIClient interface { + ListRobots(context.Context, *ListRobotsInput, ...func(*Options)) (*ListRobotsOutput, error) +} + +var _ ListRobotsAPIClient = (*Client)(nil) + +// ListRobotsPaginatorOptions is the paginator options for ListRobots +type ListRobotsPaginatorOptions struct { + // When this parameter is used, ListRobots only returns maxResults results in a + // single page along with a nextToken response element. The remaining results of + // the initial request can be seen by sending another ListRobots request with the + // returned nextToken value. This value can be between 1 and 200. If this parameter + // is not used, then ListRobots returns up to 200 results and a nextToken value if + // applicable. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListRobotsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/robomaker.ListRobots +type ListRobotsPaginator struct { + options ListRobotsPaginatorOptions + client ListRobotsAPIClient + params *ListRobotsInput + nextToken *string + firstPage bool + done bool +} + +// NewListRobotsPaginator returns a new ListRobotsPaginator +func NewListRobotsPaginator(client ListRobotsAPIClient, params *ListRobotsInput, optFns ...func(*ListRobotsPaginatorOptions)) *ListRobotsPaginator { + options := ListRobotsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListRobotsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRobotsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListRobots page. +func (p *ListRobotsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRobotsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListRobots(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListWorldsAPIClient is a client that implements the ListWorlds operation. +type ListWorldsAPIClient interface { + ListWorlds(context.Context, *ListWorldsInput, ...func(*Options)) (*ListWorldsOutput, error) +} + +var _ ListWorldsAPIClient = (*Client)(nil) + +// ListWorldsPaginatorOptions is the paginator options for ListWorlds +type ListWorldsPaginatorOptions struct { + // When this parameter is used, ListWorlds only returns maxResults results in a + // single page along with a nextToken response element. The remaining results of + // the initial request can be seen by sending another ListWorlds request with the + // returned nextToken value. This value can be between 1 and 100. If this parameter + // is not used, then ListWorlds returns up to 100 results and a nextToken value if + // applicable. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListWorldsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/robomaker.ListWorlds +type ListWorldsPaginator struct { + options ListWorldsPaginatorOptions + client ListWorldsAPIClient + params *ListWorldsInput + nextToken *string + firstPage bool + done bool +} + +// NewListWorldsPaginator returns a new ListWorldsPaginator +func NewListWorldsPaginator(client ListWorldsAPIClient, params *ListWorldsInput, optFns ...func(*ListWorldsPaginatorOptions)) *ListWorldsPaginator { + options := ListWorldsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListWorldsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListWorldsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListWorlds page. +func (p *ListWorldsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListWorldsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListWorlds(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListSimulationApplicationsAPIClient is a client that implements the +// ListSimulationApplications operation. +type ListSimulationApplicationsAPIClient interface { + ListSimulationApplications(context.Context, *ListSimulationApplicationsInput, ...func(*Options)) (*ListSimulationApplicationsOutput, error) +} + +var _ ListSimulationApplicationsAPIClient = (*Client)(nil) + +// ListSimulationApplicationsPaginatorOptions is the paginator options for +// ListSimulationApplications +type ListSimulationApplicationsPaginatorOptions struct { + // When this parameter is used, ListSimulationApplications only returns maxResults + // results in a single page along with a nextToken response element. The remaining + // results of the initial request can be seen by sending another + // ListSimulationApplications request with the returned nextToken value. This value + // can be between 1 and 100. If this parameter is not used, then + // ListSimulationApplications returns up to 100 results and a nextToken value if + // applicable. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListSimulationApplicationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/robomaker.ListSimulationApplications +type ListSimulationApplicationsPaginator struct { + options ListSimulationApplicationsPaginatorOptions + client ListSimulationApplicationsAPIClient + params *ListSimulationApplicationsInput + nextToken *string + firstPage bool + done bool +} + +// NewListSimulationApplicationsPaginator returns a new +// ListSimulationApplicationsPaginator +func NewListSimulationApplicationsPaginator(client ListSimulationApplicationsAPIClient, params *ListSimulationApplicationsInput, optFns ...func(*ListSimulationApplicationsPaginatorOptions)) *ListSimulationApplicationsPaginator { + options := ListSimulationApplicationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListSimulationApplicationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSimulationApplicationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListSimulationApplications page. +func (p *ListSimulationApplicationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSimulationApplicationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListSimulationApplications(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListWorldGenerationJobsAPIClient is a client that implements the +// ListWorldGenerationJobs operation. +type ListWorldGenerationJobsAPIClient interface { + ListWorldGenerationJobs(context.Context, *ListWorldGenerationJobsInput, ...func(*Options)) (*ListWorldGenerationJobsOutput, error) +} + +var _ ListWorldGenerationJobsAPIClient = (*Client)(nil) + +// ListWorldGenerationJobsPaginatorOptions is the paginator options for +// ListWorldGenerationJobs +type ListWorldGenerationJobsPaginatorOptions struct { + // When this parameter is used, ListWorldGeneratorJobs only returns maxResults + // results in a single page along with a nextToken response element. The remaining + // results of the initial request can be seen by sending another + // ListWorldGeneratorJobs request with the returned nextToken value. This value can + // be between 1 and 100. If this parameter is not used, then ListWorldGeneratorJobs + // returns up to 100 results and a nextToken value if applicable. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListWorldGenerationJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/robomaker.ListWorldGenerationJobs +type ListWorldGenerationJobsPaginator struct { + options ListWorldGenerationJobsPaginatorOptions + client ListWorldGenerationJobsAPIClient + params *ListWorldGenerationJobsInput + nextToken *string + firstPage bool + done bool +} + +// NewListWorldGenerationJobsPaginator returns a new +// ListWorldGenerationJobsPaginator +func NewListWorldGenerationJobsPaginator(client ListWorldGenerationJobsAPIClient, params *ListWorldGenerationJobsInput, optFns ...func(*ListWorldGenerationJobsPaginatorOptions)) *ListWorldGenerationJobsPaginator { + options := ListWorldGenerationJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListWorldGenerationJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListWorldGenerationJobsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListWorldGenerationJobs page. +func (p *ListWorldGenerationJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListWorldGenerationJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListWorldGenerationJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/route53/go.sum b/service/route53/go.sum index c669e324b14..32595049f96 100644 --- a/service/route53/go.sum +++ b/service/route53/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/route53domains/go.sum b/service/route53domains/go.sum index c669e324b14..32595049f96 100644 --- a/service/route53domains/go.sum +++ b/service/route53domains/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/route53domains/paginators.go b/service/route53domains/paginators.go new file mode 100644 index 00000000000..6e15566af92 --- /dev/null +++ b/service/route53domains/paginators.go @@ -0,0 +1,157 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package route53domains + +import ( + "context" + "fmt" +) + +// ListDomainsAPIClient is a client that implements the ListDomains operation. +type ListDomainsAPIClient interface { + ListDomains(context.Context, *ListDomainsInput, ...func(*Options)) (*ListDomainsOutput, error) +} + +var _ ListDomainsAPIClient = (*Client)(nil) + +// ListDomainsPaginatorOptions is the paginator options for ListDomains +type ListDomainsPaginatorOptions struct { + // Number of domains to be returned. Default: 20 + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDomainsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/route53domains.ListDomains +type ListDomainsPaginator struct { + options ListDomainsPaginatorOptions + client ListDomainsAPIClient + params *ListDomainsInput + nextToken *string + firstPage bool + done bool +} + +// NewListDomainsPaginator returns a new ListDomainsPaginator +func NewListDomainsPaginator(client ListDomainsAPIClient, params *ListDomainsInput, optFns ...func(*ListDomainsPaginatorOptions)) *ListDomainsPaginator { + options := ListDomainsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDomainsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDomainsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDomains page. +func (p *ListDomainsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDomainsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxItems = p.options.Limit + result, err := p.client.ListDomains(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextPageMarker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListOperationsAPIClient is a client that implements the ListOperations +// operation. +type ListOperationsAPIClient interface { + ListOperations(context.Context, *ListOperationsInput, ...func(*Options)) (*ListOperationsOutput, error) +} + +var _ ListOperationsAPIClient = (*Client)(nil) + +// ListOperationsPaginatorOptions is the paginator options for ListOperations +type ListOperationsPaginatorOptions struct { + // Number of domains to be returned. Default: 20 + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListOperationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/route53domains.ListOperations +type ListOperationsPaginator struct { + options ListOperationsPaginatorOptions + client ListOperationsAPIClient + params *ListOperationsInput + nextToken *string + firstPage bool + done bool +} + +// NewListOperationsPaginator returns a new ListOperationsPaginator +func NewListOperationsPaginator(client ListOperationsAPIClient, params *ListOperationsInput, optFns ...func(*ListOperationsPaginatorOptions)) *ListOperationsPaginator { + options := ListOperationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListOperationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListOperationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListOperations page. +func (p *ListOperationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListOperationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.MaxItems = p.options.Limit + result, err := p.client.ListOperations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextPageMarker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/route53resolver/go.sum b/service/route53resolver/go.sum index c669e324b14..32595049f96 100644 --- a/service/route53resolver/go.sum +++ b/service/route53resolver/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/route53resolver/paginators.go b/service/route53resolver/paginators.go new file mode 100644 index 00000000000..424e8531e72 --- /dev/null +++ b/service/route53resolver/paginators.go @@ -0,0 +1,558 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package route53resolver + +import ( + "context" + "fmt" +) + +// ListResolverEndpointIpAddressesAPIClient is a client that implements the +// ListResolverEndpointIpAddresses operation. +type ListResolverEndpointIpAddressesAPIClient interface { + ListResolverEndpointIpAddresses(context.Context, *ListResolverEndpointIpAddressesInput, ...func(*Options)) (*ListResolverEndpointIpAddressesOutput, error) +} + +var _ ListResolverEndpointIpAddressesAPIClient = (*Client)(nil) + +// ListResolverEndpointIpAddressesPaginatorOptions is the paginator options for +// ListResolverEndpointIpAddresses +type ListResolverEndpointIpAddressesPaginatorOptions struct { + // The maximum number of IP addresses that you want to return in the response to a + // ListResolverEndpointIpAddresses request. If you don't specify a value for + // MaxResults, Resolver returns up to 100 IP addresses. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListResolverEndpointIpAddressesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/route53resolver.ListResolverEndpointIpAddresses +type ListResolverEndpointIpAddressesPaginator struct { + options ListResolverEndpointIpAddressesPaginatorOptions + client ListResolverEndpointIpAddressesAPIClient + params *ListResolverEndpointIpAddressesInput + nextToken *string + firstPage bool + done bool +} + +// NewListResolverEndpointIpAddressesPaginator returns a new +// ListResolverEndpointIpAddressesPaginator +func NewListResolverEndpointIpAddressesPaginator(client ListResolverEndpointIpAddressesAPIClient, params *ListResolverEndpointIpAddressesInput, optFns ...func(*ListResolverEndpointIpAddressesPaginatorOptions)) *ListResolverEndpointIpAddressesPaginator { + options := ListResolverEndpointIpAddressesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListResolverEndpointIpAddressesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListResolverEndpointIpAddressesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListResolverEndpointIpAddresses page. +func (p *ListResolverEndpointIpAddressesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListResolverEndpointIpAddressesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListResolverEndpointIpAddresses(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListResolverEndpointsAPIClient is a client that implements the +// ListResolverEndpoints operation. +type ListResolverEndpointsAPIClient interface { + ListResolverEndpoints(context.Context, *ListResolverEndpointsInput, ...func(*Options)) (*ListResolverEndpointsOutput, error) +} + +var _ ListResolverEndpointsAPIClient = (*Client)(nil) + +// ListResolverEndpointsPaginatorOptions is the paginator options for +// ListResolverEndpoints +type ListResolverEndpointsPaginatorOptions struct { + // The maximum number of Resolver endpoints that you want to return in the response + // to a ListResolverEndpoints request. If you don't specify a value for MaxResults, + // Resolver returns up to 100 Resolver endpoints. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListResolverEndpointsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/route53resolver.ListResolverEndpoints +type ListResolverEndpointsPaginator struct { + options ListResolverEndpointsPaginatorOptions + client ListResolverEndpointsAPIClient + params *ListResolverEndpointsInput + nextToken *string + firstPage bool + done bool +} + +// NewListResolverEndpointsPaginator returns a new ListResolverEndpointsPaginator +func NewListResolverEndpointsPaginator(client ListResolverEndpointsAPIClient, params *ListResolverEndpointsInput, optFns ...func(*ListResolverEndpointsPaginatorOptions)) *ListResolverEndpointsPaginator { + options := ListResolverEndpointsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListResolverEndpointsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListResolverEndpointsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListResolverEndpoints page. +func (p *ListResolverEndpointsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListResolverEndpointsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListResolverEndpoints(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTagsForResourceAPIClient is a client that implements the ListTagsForResource +// operation. +type ListTagsForResourceAPIClient interface { + ListTagsForResource(context.Context, *ListTagsForResourceInput, ...func(*Options)) (*ListTagsForResourceOutput, error) +} + +var _ ListTagsForResourceAPIClient = (*Client)(nil) + +// ListTagsForResourcePaginatorOptions is the paginator options for +// ListTagsForResource +type ListTagsForResourcePaginatorOptions struct { + // The maximum number of tags that you want to return in the response to a + // ListTagsForResource request. If you don't specify a value for MaxResults, + // Resolver returns up to 100 tags. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTagsForResourcePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/route53resolver.ListTagsForResource +type ListTagsForResourcePaginator struct { + options ListTagsForResourcePaginatorOptions + client ListTagsForResourceAPIClient + params *ListTagsForResourceInput + nextToken *string + firstPage bool + done bool +} + +// NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator +func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator { + options := ListTagsForResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTagsForResourcePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTagsForResourcePaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTagsForResource page. +func (p *ListTagsForResourcePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListTagsForResource(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListResolverRulesAPIClient is a client that implements the ListResolverRules +// operation. +type ListResolverRulesAPIClient interface { + ListResolverRules(context.Context, *ListResolverRulesInput, ...func(*Options)) (*ListResolverRulesOutput, error) +} + +var _ ListResolverRulesAPIClient = (*Client)(nil) + +// ListResolverRulesPaginatorOptions is the paginator options for ListResolverRules +type ListResolverRulesPaginatorOptions struct { + // The maximum number of Resolver rules that you want to return in the response to + // a ListResolverRules request. If you don't specify a value for MaxResults, + // Resolver returns up to 100 Resolver rules. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListResolverRulesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/route53resolver.ListResolverRules +type ListResolverRulesPaginator struct { + options ListResolverRulesPaginatorOptions + client ListResolverRulesAPIClient + params *ListResolverRulesInput + nextToken *string + firstPage bool + done bool +} + +// NewListResolverRulesPaginator returns a new ListResolverRulesPaginator +func NewListResolverRulesPaginator(client ListResolverRulesAPIClient, params *ListResolverRulesInput, optFns ...func(*ListResolverRulesPaginatorOptions)) *ListResolverRulesPaginator { + options := ListResolverRulesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListResolverRulesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListResolverRulesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListResolverRules page. +func (p *ListResolverRulesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListResolverRulesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListResolverRules(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListResolverRuleAssociationsAPIClient is a client that implements the +// ListResolverRuleAssociations operation. +type ListResolverRuleAssociationsAPIClient interface { + ListResolverRuleAssociations(context.Context, *ListResolverRuleAssociationsInput, ...func(*Options)) (*ListResolverRuleAssociationsOutput, error) +} + +var _ ListResolverRuleAssociationsAPIClient = (*Client)(nil) + +// ListResolverRuleAssociationsPaginatorOptions is the paginator options for +// ListResolverRuleAssociations +type ListResolverRuleAssociationsPaginatorOptions struct { + // The maximum number of rule associations that you want to return in the response + // to a ListResolverRuleAssociations request. If you don't specify a value for + // MaxResults, Resolver returns up to 100 rule associations. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListResolverRuleAssociationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/route53resolver.ListResolverRuleAssociations +type ListResolverRuleAssociationsPaginator struct { + options ListResolverRuleAssociationsPaginatorOptions + client ListResolverRuleAssociationsAPIClient + params *ListResolverRuleAssociationsInput + nextToken *string + firstPage bool + done bool +} + +// NewListResolverRuleAssociationsPaginator returns a new +// ListResolverRuleAssociationsPaginator +func NewListResolverRuleAssociationsPaginator(client ListResolverRuleAssociationsAPIClient, params *ListResolverRuleAssociationsInput, optFns ...func(*ListResolverRuleAssociationsPaginatorOptions)) *ListResolverRuleAssociationsPaginator { + options := ListResolverRuleAssociationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListResolverRuleAssociationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListResolverRuleAssociationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListResolverRuleAssociations page. +func (p *ListResolverRuleAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListResolverRuleAssociationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListResolverRuleAssociations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListResolverQueryLogConfigsAPIClient is a client that implements the +// ListResolverQueryLogConfigs operation. +type ListResolverQueryLogConfigsAPIClient interface { + ListResolverQueryLogConfigs(context.Context, *ListResolverQueryLogConfigsInput, ...func(*Options)) (*ListResolverQueryLogConfigsOutput, error) +} + +var _ ListResolverQueryLogConfigsAPIClient = (*Client)(nil) + +// ListResolverQueryLogConfigsPaginatorOptions is the paginator options for +// ListResolverQueryLogConfigs +type ListResolverQueryLogConfigsPaginatorOptions struct { + // The maximum number of query logging configurations that you want to return in + // the response to a ListResolverQueryLogConfigs request. If you don't specify a + // value for MaxResults, Resolver returns up to 100 query logging configurations. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListResolverQueryLogConfigsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/route53resolver.ListResolverQueryLogConfigs +type ListResolverQueryLogConfigsPaginator struct { + options ListResolverQueryLogConfigsPaginatorOptions + client ListResolverQueryLogConfigsAPIClient + params *ListResolverQueryLogConfigsInput + nextToken *string + firstPage bool + done bool +} + +// NewListResolverQueryLogConfigsPaginator returns a new +// ListResolverQueryLogConfigsPaginator +func NewListResolverQueryLogConfigsPaginator(client ListResolverQueryLogConfigsAPIClient, params *ListResolverQueryLogConfigsInput, optFns ...func(*ListResolverQueryLogConfigsPaginatorOptions)) *ListResolverQueryLogConfigsPaginator { + options := ListResolverQueryLogConfigsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListResolverQueryLogConfigsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListResolverQueryLogConfigsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListResolverQueryLogConfigs page. +func (p *ListResolverQueryLogConfigsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListResolverQueryLogConfigsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListResolverQueryLogConfigs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListResolverQueryLogConfigAssociationsAPIClient is a client that implements the +// ListResolverQueryLogConfigAssociations operation. +type ListResolverQueryLogConfigAssociationsAPIClient interface { + ListResolverQueryLogConfigAssociations(context.Context, *ListResolverQueryLogConfigAssociationsInput, ...func(*Options)) (*ListResolverQueryLogConfigAssociationsOutput, error) +} + +var _ ListResolverQueryLogConfigAssociationsAPIClient = (*Client)(nil) + +// ListResolverQueryLogConfigAssociationsPaginatorOptions is the paginator options +// for ListResolverQueryLogConfigAssociations +type ListResolverQueryLogConfigAssociationsPaginatorOptions struct { + // The maximum number of query logging associations that you want to return in the + // response to a ListResolverQueryLogConfigAssociations request. If you don't + // specify a value for MaxResults, Resolver returns up to 100 query logging + // associations. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListResolverQueryLogConfigAssociationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/route53resolver.ListResolverQueryLogConfigAssociations +type ListResolverQueryLogConfigAssociationsPaginator struct { + options ListResolverQueryLogConfigAssociationsPaginatorOptions + client ListResolverQueryLogConfigAssociationsAPIClient + params *ListResolverQueryLogConfigAssociationsInput + nextToken *string + firstPage bool + done bool +} + +// NewListResolverQueryLogConfigAssociationsPaginator returns a new +// ListResolverQueryLogConfigAssociationsPaginator +func NewListResolverQueryLogConfigAssociationsPaginator(client ListResolverQueryLogConfigAssociationsAPIClient, params *ListResolverQueryLogConfigAssociationsInput, optFns ...func(*ListResolverQueryLogConfigAssociationsPaginatorOptions)) *ListResolverQueryLogConfigAssociationsPaginator { + options := ListResolverQueryLogConfigAssociationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListResolverQueryLogConfigAssociationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListResolverQueryLogConfigAssociationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListResolverQueryLogConfigAssociations page. +func (p *ListResolverQueryLogConfigAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListResolverQueryLogConfigAssociationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListResolverQueryLogConfigAssociations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/s3/go.sum b/service/s3/go.sum index c669e324b14..5912fa6728c 100644 --- a/service/s3/go.sum +++ b/service/s3/go.sum @@ -1,3 +1,6 @@ +github.com/awslabs/smithy-go v0.3.0/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/s3/internal/configtesting/go.sum b/service/s3/internal/configtesting/go.sum index c669e324b14..5912fa6728c 100644 --- a/service/s3/internal/configtesting/go.sum +++ b/service/s3/internal/configtesting/go.sum @@ -1,3 +1,6 @@ +github.com/awslabs/smithy-go v0.3.0/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/s3/paginators.go b/service/s3/paginators.go new file mode 100644 index 00000000000..90372af9320 --- /dev/null +++ b/service/s3/paginators.go @@ -0,0 +1,84 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package s3 + +import ( + "context" + "fmt" +) + +// ListObjectsV2APIClient is a client that implements the ListObjectsV2 operation. +type ListObjectsV2APIClient interface { + ListObjectsV2(context.Context, *ListObjectsV2Input, ...func(*Options)) (*ListObjectsV2Output, error) +} + +var _ ListObjectsV2APIClient = (*Client)(nil) + +// ListObjectsV2PaginatorOptions is the paginator options for ListObjectsV2 +type ListObjectsV2PaginatorOptions struct { + // Sets the maximum number of keys returned in the response. By default the API + // returns up to 1,000 key names. The response might contain fewer keys but will + // never contain more. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListObjectsV2Paginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/s3.ListObjectsV2 +type ListObjectsV2Paginator struct { + options ListObjectsV2PaginatorOptions + client ListObjectsV2APIClient + params *ListObjectsV2Input + nextToken *string + firstPage bool + done bool +} + +// NewListObjectsV2Paginator returns a new ListObjectsV2Paginator +func NewListObjectsV2Paginator(client ListObjectsV2APIClient, params *ListObjectsV2Input, optFns ...func(*ListObjectsV2PaginatorOptions)) *ListObjectsV2Paginator { + options := ListObjectsV2PaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListObjectsV2Paginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListObjectsV2Paginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListObjectsV2 page. +func (p *ListObjectsV2Paginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListObjectsV2Output, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.ContinuationToken = p.nextToken + params.MaxKeys = p.options.Limit + result, err := p.client.ListObjectsV2(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextContinuationToken + if p.options.StopOnDuplicateToken && params.ContinuationToken != nil && p.nextToken != nil && *params.ContinuationToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/s3control/go.sum b/service/s3control/go.sum index c669e324b14..32595049f96 100644 --- a/service/s3control/go.sum +++ b/service/s3control/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/s3control/paginators.go b/service/s3control/paginators.go new file mode 100644 index 00000000000..16a69e1e41b --- /dev/null +++ b/service/s3control/paginators.go @@ -0,0 +1,239 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package s3control + +import ( + "context" + "fmt" +) + +// ListRegionalBucketsAPIClient is a client that implements the ListRegionalBuckets +// operation. +type ListRegionalBucketsAPIClient interface { + ListRegionalBuckets(context.Context, *ListRegionalBucketsInput, ...func(*Options)) (*ListRegionalBucketsOutput, error) +} + +var _ ListRegionalBucketsAPIClient = (*Client)(nil) + +// ListRegionalBucketsPaginatorOptions is the paginator options for +// ListRegionalBuckets +type ListRegionalBucketsPaginatorOptions struct { + // + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListRegionalBucketsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/s3control.ListRegionalBuckets +type ListRegionalBucketsPaginator struct { + options ListRegionalBucketsPaginatorOptions + client ListRegionalBucketsAPIClient + params *ListRegionalBucketsInput + nextToken *string + firstPage bool + done bool +} + +// NewListRegionalBucketsPaginator returns a new ListRegionalBucketsPaginator +func NewListRegionalBucketsPaginator(client ListRegionalBucketsAPIClient, params *ListRegionalBucketsInput, optFns ...func(*ListRegionalBucketsPaginatorOptions)) *ListRegionalBucketsPaginator { + options := ListRegionalBucketsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListRegionalBucketsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRegionalBucketsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListRegionalBuckets page. +func (p *ListRegionalBucketsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRegionalBucketsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListRegionalBuckets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListAccessPointsAPIClient is a client that implements the ListAccessPoints +// operation. +type ListAccessPointsAPIClient interface { + ListAccessPoints(context.Context, *ListAccessPointsInput, ...func(*Options)) (*ListAccessPointsOutput, error) +} + +var _ ListAccessPointsAPIClient = (*Client)(nil) + +// ListAccessPointsPaginatorOptions is the paginator options for ListAccessPoints +type ListAccessPointsPaginatorOptions struct { + // The maximum number of access points that you want to include in the list. If the + // specified bucket has more than this number of access points, then the response + // will include a continuation token in the NextToken field that you can use to + // retrieve the next page of access points. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAccessPointsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/s3control.ListAccessPoints +type ListAccessPointsPaginator struct { + options ListAccessPointsPaginatorOptions + client ListAccessPointsAPIClient + params *ListAccessPointsInput + nextToken *string + firstPage bool + done bool +} + +// NewListAccessPointsPaginator returns a new ListAccessPointsPaginator +func NewListAccessPointsPaginator(client ListAccessPointsAPIClient, params *ListAccessPointsInput, optFns ...func(*ListAccessPointsPaginatorOptions)) *ListAccessPointsPaginator { + options := ListAccessPointsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAccessPointsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAccessPointsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAccessPoints page. +func (p *ListAccessPointsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccessPointsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListAccessPoints(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListJobsAPIClient is a client that implements the ListJobs operation. +type ListJobsAPIClient interface { + ListJobs(context.Context, *ListJobsInput, ...func(*Options)) (*ListJobsOutput, error) +} + +var _ ListJobsAPIClient = (*Client)(nil) + +// ListJobsPaginatorOptions is the paginator options for ListJobs +type ListJobsPaginatorOptions struct { + // The maximum number of jobs that Amazon S3 will include in the List Jobs + // response. If there are more jobs than this number, the response will include a + // pagination token in the NextToken field to enable you to retrieve the next page + // of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/s3control.ListJobs +type ListJobsPaginator struct { + options ListJobsPaginatorOptions + client ListJobsAPIClient + params *ListJobsInput + nextToken *string + firstPage bool + done bool +} + +// NewListJobsPaginator returns a new ListJobsPaginator +func NewListJobsPaginator(client ListJobsAPIClient, params *ListJobsInput, optFns ...func(*ListJobsPaginatorOptions)) *ListJobsPaginator { + options := ListJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListJobsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListJobs page. +func (p *ListJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/s3outposts/go.sum b/service/s3outposts/go.sum index c669e324b14..32595049f96 100644 --- a/service/s3outposts/go.sum +++ b/service/s3outposts/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/s3outposts/paginators.go b/service/s3outposts/paginators.go new file mode 100644 index 00000000000..301aa76e5ae --- /dev/null +++ b/service/s3outposts/paginators.go @@ -0,0 +1,82 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package s3outposts + +import ( + "context" + "fmt" +) + +// ListEndpointsAPIClient is a client that implements the ListEndpoints operation. +type ListEndpointsAPIClient interface { + ListEndpoints(context.Context, *ListEndpointsInput, ...func(*Options)) (*ListEndpointsOutput, error) +} + +var _ ListEndpointsAPIClient = (*Client)(nil) + +// ListEndpointsPaginatorOptions is the paginator options for ListEndpoints +type ListEndpointsPaginatorOptions struct { + // The max number of endpoints that can be returned on the request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListEndpointsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/s3outposts.ListEndpoints +type ListEndpointsPaginator struct { + options ListEndpointsPaginatorOptions + client ListEndpointsAPIClient + params *ListEndpointsInput + nextToken *string + firstPage bool + done bool +} + +// NewListEndpointsPaginator returns a new ListEndpointsPaginator +func NewListEndpointsPaginator(client ListEndpointsAPIClient, params *ListEndpointsInput, optFns ...func(*ListEndpointsPaginatorOptions)) *ListEndpointsPaginator { + options := ListEndpointsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListEndpointsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListEndpointsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListEndpoints page. +func (p *ListEndpointsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEndpointsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListEndpoints(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/sagemaker/go.sum b/service/sagemaker/go.sum index c669e324b14..32595049f96 100644 --- a/service/sagemaker/go.sum +++ b/service/sagemaker/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/sagemaker/paginators.go b/service/sagemaker/paginators.go new file mode 100644 index 00000000000..5476c0efc84 --- /dev/null +++ b/service/sagemaker/paginators.go @@ -0,0 +1,2655 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sagemaker + +import ( + "context" + "fmt" +) + +// ListLabelingJobsAPIClient is a client that implements the ListLabelingJobs +// operation. +type ListLabelingJobsAPIClient interface { + ListLabelingJobs(context.Context, *ListLabelingJobsInput, ...func(*Options)) (*ListLabelingJobsOutput, error) +} + +var _ ListLabelingJobsAPIClient = (*Client)(nil) + +// ListLabelingJobsPaginatorOptions is the paginator options for ListLabelingJobs +type ListLabelingJobsPaginatorOptions struct { + // The maximum number of labeling jobs to return in each page of the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListLabelingJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListLabelingJobs +type ListLabelingJobsPaginator struct { + options ListLabelingJobsPaginatorOptions + client ListLabelingJobsAPIClient + params *ListLabelingJobsInput + nextToken *string + firstPage bool + done bool +} + +// NewListLabelingJobsPaginator returns a new ListLabelingJobsPaginator +func NewListLabelingJobsPaginator(client ListLabelingJobsAPIClient, params *ListLabelingJobsInput, optFns ...func(*ListLabelingJobsPaginatorOptions)) *ListLabelingJobsPaginator { + options := ListLabelingJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListLabelingJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListLabelingJobsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListLabelingJobs page. +func (p *ListLabelingJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListLabelingJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListLabelingJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListNotebookInstancesAPIClient is a client that implements the +// ListNotebookInstances operation. +type ListNotebookInstancesAPIClient interface { + ListNotebookInstances(context.Context, *ListNotebookInstancesInput, ...func(*Options)) (*ListNotebookInstancesOutput, error) +} + +var _ ListNotebookInstancesAPIClient = (*Client)(nil) + +// ListNotebookInstancesPaginatorOptions is the paginator options for +// ListNotebookInstances +type ListNotebookInstancesPaginatorOptions struct { + // The maximum number of notebook instances to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListNotebookInstancesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListNotebookInstances +type ListNotebookInstancesPaginator struct { + options ListNotebookInstancesPaginatorOptions + client ListNotebookInstancesAPIClient + params *ListNotebookInstancesInput + nextToken *string + firstPage bool + done bool +} + +// NewListNotebookInstancesPaginator returns a new ListNotebookInstancesPaginator +func NewListNotebookInstancesPaginator(client ListNotebookInstancesAPIClient, params *ListNotebookInstancesInput, optFns ...func(*ListNotebookInstancesPaginatorOptions)) *ListNotebookInstancesPaginator { + options := ListNotebookInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListNotebookInstancesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListNotebookInstancesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListNotebookInstances page. +func (p *ListNotebookInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListNotebookInstancesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListNotebookInstances(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListWorkforcesAPIClient is a client that implements the ListWorkforces +// operation. +type ListWorkforcesAPIClient interface { + ListWorkforces(context.Context, *ListWorkforcesInput, ...func(*Options)) (*ListWorkforcesOutput, error) +} + +var _ ListWorkforcesAPIClient = (*Client)(nil) + +// ListWorkforcesPaginatorOptions is the paginator options for ListWorkforces +type ListWorkforcesPaginatorOptions struct { + // The maximum number of workforces returned in the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListWorkforcesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListWorkforces +type ListWorkforcesPaginator struct { + options ListWorkforcesPaginatorOptions + client ListWorkforcesAPIClient + params *ListWorkforcesInput + nextToken *string + firstPage bool + done bool +} + +// NewListWorkforcesPaginator returns a new ListWorkforcesPaginator +func NewListWorkforcesPaginator(client ListWorkforcesAPIClient, params *ListWorkforcesInput, optFns ...func(*ListWorkforcesPaginatorOptions)) *ListWorkforcesPaginator { + options := ListWorkforcesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListWorkforcesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListWorkforcesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListWorkforces page. +func (p *ListWorkforcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListWorkforcesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListWorkforces(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTrainingJobsForHyperParameterTuningJobAPIClient is a client that implements +// the ListTrainingJobsForHyperParameterTuningJob operation. +type ListTrainingJobsForHyperParameterTuningJobAPIClient interface { + ListTrainingJobsForHyperParameterTuningJob(context.Context, *ListTrainingJobsForHyperParameterTuningJobInput, ...func(*Options)) (*ListTrainingJobsForHyperParameterTuningJobOutput, error) +} + +var _ ListTrainingJobsForHyperParameterTuningJobAPIClient = (*Client)(nil) + +// ListTrainingJobsForHyperParameterTuningJobPaginatorOptions is the paginator +// options for ListTrainingJobsForHyperParameterTuningJob +type ListTrainingJobsForHyperParameterTuningJobPaginatorOptions struct { + // The maximum number of training jobs to return. The default value is 10. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTrainingJobsForHyperParameterTuningJobPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListTrainingJobsForHyperParameterTuningJob +type ListTrainingJobsForHyperParameterTuningJobPaginator struct { + options ListTrainingJobsForHyperParameterTuningJobPaginatorOptions + client ListTrainingJobsForHyperParameterTuningJobAPIClient + params *ListTrainingJobsForHyperParameterTuningJobInput + nextToken *string + firstPage bool + done bool +} + +// NewListTrainingJobsForHyperParameterTuningJobPaginator returns a new +// ListTrainingJobsForHyperParameterTuningJobPaginator +func NewListTrainingJobsForHyperParameterTuningJobPaginator(client ListTrainingJobsForHyperParameterTuningJobAPIClient, params *ListTrainingJobsForHyperParameterTuningJobInput, optFns ...func(*ListTrainingJobsForHyperParameterTuningJobPaginatorOptions)) *ListTrainingJobsForHyperParameterTuningJobPaginator { + options := ListTrainingJobsForHyperParameterTuningJobPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTrainingJobsForHyperParameterTuningJobPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTrainingJobsForHyperParameterTuningJobPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTrainingJobsForHyperParameterTuningJob page. +func (p *ListTrainingJobsForHyperParameterTuningJobPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTrainingJobsForHyperParameterTuningJobOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListTrainingJobsForHyperParameterTuningJob(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListProcessingJobsAPIClient is a client that implements the ListProcessingJobs +// operation. +type ListProcessingJobsAPIClient interface { + ListProcessingJobs(context.Context, *ListProcessingJobsInput, ...func(*Options)) (*ListProcessingJobsOutput, error) +} + +var _ ListProcessingJobsAPIClient = (*Client)(nil) + +// ListProcessingJobsPaginatorOptions is the paginator options for +// ListProcessingJobs +type ListProcessingJobsPaginatorOptions struct { + // The maximum number of processing jobs to return in the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListProcessingJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListProcessingJobs +type ListProcessingJobsPaginator struct { + options ListProcessingJobsPaginatorOptions + client ListProcessingJobsAPIClient + params *ListProcessingJobsInput + nextToken *string + firstPage bool + done bool +} + +// NewListProcessingJobsPaginator returns a new ListProcessingJobsPaginator +func NewListProcessingJobsPaginator(client ListProcessingJobsAPIClient, params *ListProcessingJobsInput, optFns ...func(*ListProcessingJobsPaginatorOptions)) *ListProcessingJobsPaginator { + options := ListProcessingJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListProcessingJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListProcessingJobsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListProcessingJobs page. +func (p *ListProcessingJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProcessingJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListProcessingJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// SearchAPIClient is a client that implements the Search operation. +type SearchAPIClient interface { + Search(context.Context, *SearchInput, ...func(*Options)) (*SearchOutput, error) +} + +var _ SearchAPIClient = (*Client)(nil) + +// SearchPaginatorOptions is the paginator options for Search +type SearchPaginatorOptions struct { + // The maximum number of results to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// SearchPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.Search +type SearchPaginator struct { + options SearchPaginatorOptions + client SearchAPIClient + params *SearchInput + nextToken *string + firstPage bool + done bool +} + +// NewSearchPaginator returns a new SearchPaginator +func NewSearchPaginator(client SearchAPIClient, params *SearchInput, optFns ...func(*SearchPaginatorOptions)) *SearchPaginator { + options := SearchPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &SearchPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next Search page. +func (p *SearchPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.Search(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListAlgorithmsAPIClient is a client that implements the ListAlgorithms +// operation. +type ListAlgorithmsAPIClient interface { + ListAlgorithms(context.Context, *ListAlgorithmsInput, ...func(*Options)) (*ListAlgorithmsOutput, error) +} + +var _ ListAlgorithmsAPIClient = (*Client)(nil) + +// ListAlgorithmsPaginatorOptions is the paginator options for ListAlgorithms +type ListAlgorithmsPaginatorOptions struct { + // The maximum number of algorithms to return in the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAlgorithmsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListAlgorithms +type ListAlgorithmsPaginator struct { + options ListAlgorithmsPaginatorOptions + client ListAlgorithmsAPIClient + params *ListAlgorithmsInput + nextToken *string + firstPage bool + done bool +} + +// NewListAlgorithmsPaginator returns a new ListAlgorithmsPaginator +func NewListAlgorithmsPaginator(client ListAlgorithmsAPIClient, params *ListAlgorithmsInput, optFns ...func(*ListAlgorithmsPaginatorOptions)) *ListAlgorithmsPaginator { + options := ListAlgorithmsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAlgorithmsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAlgorithmsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAlgorithms page. +func (p *ListAlgorithmsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAlgorithmsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListAlgorithms(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTransformJobsAPIClient is a client that implements the ListTransformJobs +// operation. +type ListTransformJobsAPIClient interface { + ListTransformJobs(context.Context, *ListTransformJobsInput, ...func(*Options)) (*ListTransformJobsOutput, error) +} + +var _ ListTransformJobsAPIClient = (*Client)(nil) + +// ListTransformJobsPaginatorOptions is the paginator options for ListTransformJobs +type ListTransformJobsPaginatorOptions struct { + // The maximum number of transform jobs to return in the response. The default + // value is 10. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTransformJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListTransformJobs +type ListTransformJobsPaginator struct { + options ListTransformJobsPaginatorOptions + client ListTransformJobsAPIClient + params *ListTransformJobsInput + nextToken *string + firstPage bool + done bool +} + +// NewListTransformJobsPaginator returns a new ListTransformJobsPaginator +func NewListTransformJobsPaginator(client ListTransformJobsAPIClient, params *ListTransformJobsInput, optFns ...func(*ListTransformJobsPaginatorOptions)) *ListTransformJobsPaginator { + options := ListTransformJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTransformJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTransformJobsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTransformJobs page. +func (p *ListTransformJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTransformJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListTransformJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListCodeRepositoriesAPIClient is a client that implements the +// ListCodeRepositories operation. +type ListCodeRepositoriesAPIClient interface { + ListCodeRepositories(context.Context, *ListCodeRepositoriesInput, ...func(*Options)) (*ListCodeRepositoriesOutput, error) +} + +var _ ListCodeRepositoriesAPIClient = (*Client)(nil) + +// ListCodeRepositoriesPaginatorOptions is the paginator options for +// ListCodeRepositories +type ListCodeRepositoriesPaginatorOptions struct { + // The maximum number of Git repositories to return in the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListCodeRepositoriesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListCodeRepositories +type ListCodeRepositoriesPaginator struct { + options ListCodeRepositoriesPaginatorOptions + client ListCodeRepositoriesAPIClient + params *ListCodeRepositoriesInput + nextToken *string + firstPage bool + done bool +} + +// NewListCodeRepositoriesPaginator returns a new ListCodeRepositoriesPaginator +func NewListCodeRepositoriesPaginator(client ListCodeRepositoriesAPIClient, params *ListCodeRepositoriesInput, optFns ...func(*ListCodeRepositoriesPaginatorOptions)) *ListCodeRepositoriesPaginator { + options := ListCodeRepositoriesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListCodeRepositoriesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCodeRepositoriesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListCodeRepositories page. +func (p *ListCodeRepositoriesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCodeRepositoriesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListCodeRepositories(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListAppsAPIClient is a client that implements the ListApps operation. +type ListAppsAPIClient interface { + ListApps(context.Context, *ListAppsInput, ...func(*Options)) (*ListAppsOutput, error) +} + +var _ ListAppsAPIClient = (*Client)(nil) + +// ListAppsPaginatorOptions is the paginator options for ListApps +type ListAppsPaginatorOptions struct { + // Returns a list up to a specified limit. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAppsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListApps +type ListAppsPaginator struct { + options ListAppsPaginatorOptions + client ListAppsAPIClient + params *ListAppsInput + nextToken *string + firstPage bool + done bool +} + +// NewListAppsPaginator returns a new ListAppsPaginator +func NewListAppsPaginator(client ListAppsAPIClient, params *ListAppsInput, optFns ...func(*ListAppsPaginatorOptions)) *ListAppsPaginator { + options := ListAppsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAppsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAppsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListApps page. +func (p *ListAppsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAppsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListApps(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListEndpointConfigsAPIClient is a client that implements the ListEndpointConfigs +// operation. +type ListEndpointConfigsAPIClient interface { + ListEndpointConfigs(context.Context, *ListEndpointConfigsInput, ...func(*Options)) (*ListEndpointConfigsOutput, error) +} + +var _ ListEndpointConfigsAPIClient = (*Client)(nil) + +// ListEndpointConfigsPaginatorOptions is the paginator options for +// ListEndpointConfigs +type ListEndpointConfigsPaginatorOptions struct { + // The maximum number of training jobs to return in the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListEndpointConfigsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListEndpointConfigs +type ListEndpointConfigsPaginator struct { + options ListEndpointConfigsPaginatorOptions + client ListEndpointConfigsAPIClient + params *ListEndpointConfigsInput + nextToken *string + firstPage bool + done bool +} + +// NewListEndpointConfigsPaginator returns a new ListEndpointConfigsPaginator +func NewListEndpointConfigsPaginator(client ListEndpointConfigsAPIClient, params *ListEndpointConfigsInput, optFns ...func(*ListEndpointConfigsPaginatorOptions)) *ListEndpointConfigsPaginator { + options := ListEndpointConfigsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListEndpointConfigsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListEndpointConfigsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListEndpointConfigs page. +func (p *ListEndpointConfigsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEndpointConfigsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListEndpointConfigs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListFlowDefinitionsAPIClient is a client that implements the ListFlowDefinitions +// operation. +type ListFlowDefinitionsAPIClient interface { + ListFlowDefinitions(context.Context, *ListFlowDefinitionsInput, ...func(*Options)) (*ListFlowDefinitionsOutput, error) +} + +var _ ListFlowDefinitionsAPIClient = (*Client)(nil) + +// ListFlowDefinitionsPaginatorOptions is the paginator options for +// ListFlowDefinitions +type ListFlowDefinitionsPaginatorOptions struct { + // The total number of items to return. If the total number of available items is + // more than the value specified in MaxResults, then a NextToken will be provided + // in the output that you can use to resume pagination. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListFlowDefinitionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListFlowDefinitions +type ListFlowDefinitionsPaginator struct { + options ListFlowDefinitionsPaginatorOptions + client ListFlowDefinitionsAPIClient + params *ListFlowDefinitionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListFlowDefinitionsPaginator returns a new ListFlowDefinitionsPaginator +func NewListFlowDefinitionsPaginator(client ListFlowDefinitionsAPIClient, params *ListFlowDefinitionsInput, optFns ...func(*ListFlowDefinitionsPaginatorOptions)) *ListFlowDefinitionsPaginator { + options := ListFlowDefinitionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListFlowDefinitionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListFlowDefinitionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListFlowDefinitions page. +func (p *ListFlowDefinitionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFlowDefinitionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListFlowDefinitions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTrialsAPIClient is a client that implements the ListTrials operation. +type ListTrialsAPIClient interface { + ListTrials(context.Context, *ListTrialsInput, ...func(*Options)) (*ListTrialsOutput, error) +} + +var _ ListTrialsAPIClient = (*Client)(nil) + +// ListTrialsPaginatorOptions is the paginator options for ListTrials +type ListTrialsPaginatorOptions struct { + // The maximum number of trials to return in the response. The default value is 10. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTrialsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListTrials +type ListTrialsPaginator struct { + options ListTrialsPaginatorOptions + client ListTrialsAPIClient + params *ListTrialsInput + nextToken *string + firstPage bool + done bool +} + +// NewListTrialsPaginator returns a new ListTrialsPaginator +func NewListTrialsPaginator(client ListTrialsAPIClient, params *ListTrialsInput, optFns ...func(*ListTrialsPaginatorOptions)) *ListTrialsPaginator { + options := ListTrialsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTrialsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTrialsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTrials page. +func (p *ListTrialsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTrialsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListTrials(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListModelPackagesAPIClient is a client that implements the ListModelPackages +// operation. +type ListModelPackagesAPIClient interface { + ListModelPackages(context.Context, *ListModelPackagesInput, ...func(*Options)) (*ListModelPackagesOutput, error) +} + +var _ ListModelPackagesAPIClient = (*Client)(nil) + +// ListModelPackagesPaginatorOptions is the paginator options for ListModelPackages +type ListModelPackagesPaginatorOptions struct { + // The maximum number of model packages to return in the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListModelPackagesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListModelPackages +type ListModelPackagesPaginator struct { + options ListModelPackagesPaginatorOptions + client ListModelPackagesAPIClient + params *ListModelPackagesInput + nextToken *string + firstPage bool + done bool +} + +// NewListModelPackagesPaginator returns a new ListModelPackagesPaginator +func NewListModelPackagesPaginator(client ListModelPackagesAPIClient, params *ListModelPackagesInput, optFns ...func(*ListModelPackagesPaginatorOptions)) *ListModelPackagesPaginator { + options := ListModelPackagesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListModelPackagesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListModelPackagesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListModelPackages page. +func (p *ListModelPackagesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListModelPackagesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListModelPackages(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListNotebookInstanceLifecycleConfigsAPIClient is a client that implements the +// ListNotebookInstanceLifecycleConfigs operation. +type ListNotebookInstanceLifecycleConfigsAPIClient interface { + ListNotebookInstanceLifecycleConfigs(context.Context, *ListNotebookInstanceLifecycleConfigsInput, ...func(*Options)) (*ListNotebookInstanceLifecycleConfigsOutput, error) +} + +var _ ListNotebookInstanceLifecycleConfigsAPIClient = (*Client)(nil) + +// ListNotebookInstanceLifecycleConfigsPaginatorOptions is the paginator options +// for ListNotebookInstanceLifecycleConfigs +type ListNotebookInstanceLifecycleConfigsPaginatorOptions struct { + // The maximum number of lifecycle configurations to return in the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListNotebookInstanceLifecycleConfigsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListNotebookInstanceLifecycleConfigs +type ListNotebookInstanceLifecycleConfigsPaginator struct { + options ListNotebookInstanceLifecycleConfigsPaginatorOptions + client ListNotebookInstanceLifecycleConfigsAPIClient + params *ListNotebookInstanceLifecycleConfigsInput + nextToken *string + firstPage bool + done bool +} + +// NewListNotebookInstanceLifecycleConfigsPaginator returns a new +// ListNotebookInstanceLifecycleConfigsPaginator +func NewListNotebookInstanceLifecycleConfigsPaginator(client ListNotebookInstanceLifecycleConfigsAPIClient, params *ListNotebookInstanceLifecycleConfigsInput, optFns ...func(*ListNotebookInstanceLifecycleConfigsPaginatorOptions)) *ListNotebookInstanceLifecycleConfigsPaginator { + options := ListNotebookInstanceLifecycleConfigsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListNotebookInstanceLifecycleConfigsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListNotebookInstanceLifecycleConfigsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListNotebookInstanceLifecycleConfigs page. +func (p *ListNotebookInstanceLifecycleConfigsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListNotebookInstanceLifecycleConfigsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListNotebookInstanceLifecycleConfigs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListImagesAPIClient is a client that implements the ListImages operation. +type ListImagesAPIClient interface { + ListImages(context.Context, *ListImagesInput, ...func(*Options)) (*ListImagesOutput, error) +} + +var _ ListImagesAPIClient = (*Client)(nil) + +// ListImagesPaginatorOptions is the paginator options for ListImages +type ListImagesPaginatorOptions struct { + // The maximum number of images to return in the response. The default value is 10. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListImagesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListImages +type ListImagesPaginator struct { + options ListImagesPaginatorOptions + client ListImagesAPIClient + params *ListImagesInput + nextToken *string + firstPage bool + done bool +} + +// NewListImagesPaginator returns a new ListImagesPaginator +func NewListImagesPaginator(client ListImagesAPIClient, params *ListImagesInput, optFns ...func(*ListImagesPaginatorOptions)) *ListImagesPaginator { + options := ListImagesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListImagesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListImagesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListImages page. +func (p *ListImagesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListImagesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListImages(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDomainsAPIClient is a client that implements the ListDomains operation. +type ListDomainsAPIClient interface { + ListDomains(context.Context, *ListDomainsInput, ...func(*Options)) (*ListDomainsOutput, error) +} + +var _ ListDomainsAPIClient = (*Client)(nil) + +// ListDomainsPaginatorOptions is the paginator options for ListDomains +type ListDomainsPaginatorOptions struct { + // Returns a list up to a specified limit. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDomainsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListDomains +type ListDomainsPaginator struct { + options ListDomainsPaginatorOptions + client ListDomainsAPIClient + params *ListDomainsInput + nextToken *string + firstPage bool + done bool +} + +// NewListDomainsPaginator returns a new ListDomainsPaginator +func NewListDomainsPaginator(client ListDomainsAPIClient, params *ListDomainsInput, optFns ...func(*ListDomainsPaginatorOptions)) *ListDomainsPaginator { + options := ListDomainsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDomainsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDomainsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDomains page. +func (p *ListDomainsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDomainsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListDomains(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListCompilationJobsAPIClient is a client that implements the ListCompilationJobs +// operation. +type ListCompilationJobsAPIClient interface { + ListCompilationJobs(context.Context, *ListCompilationJobsInput, ...func(*Options)) (*ListCompilationJobsOutput, error) +} + +var _ ListCompilationJobsAPIClient = (*Client)(nil) + +// ListCompilationJobsPaginatorOptions is the paginator options for +// ListCompilationJobs +type ListCompilationJobsPaginatorOptions struct { + // The maximum number of model compilation jobs to return in the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListCompilationJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListCompilationJobs +type ListCompilationJobsPaginator struct { + options ListCompilationJobsPaginatorOptions + client ListCompilationJobsAPIClient + params *ListCompilationJobsInput + nextToken *string + firstPage bool + done bool +} + +// NewListCompilationJobsPaginator returns a new ListCompilationJobsPaginator +func NewListCompilationJobsPaginator(client ListCompilationJobsAPIClient, params *ListCompilationJobsInput, optFns ...func(*ListCompilationJobsPaginatorOptions)) *ListCompilationJobsPaginator { + options := ListCompilationJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListCompilationJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCompilationJobsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListCompilationJobs page. +func (p *ListCompilationJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCompilationJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListCompilationJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListUserProfilesAPIClient is a client that implements the ListUserProfiles +// operation. +type ListUserProfilesAPIClient interface { + ListUserProfiles(context.Context, *ListUserProfilesInput, ...func(*Options)) (*ListUserProfilesOutput, error) +} + +var _ ListUserProfilesAPIClient = (*Client)(nil) + +// ListUserProfilesPaginatorOptions is the paginator options for ListUserProfiles +type ListUserProfilesPaginatorOptions struct { + // Returns a list up to a specified limit. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListUserProfilesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListUserProfiles +type ListUserProfilesPaginator struct { + options ListUserProfilesPaginatorOptions + client ListUserProfilesAPIClient + params *ListUserProfilesInput + nextToken *string + firstPage bool + done bool +} + +// NewListUserProfilesPaginator returns a new ListUserProfilesPaginator +func NewListUserProfilesPaginator(client ListUserProfilesAPIClient, params *ListUserProfilesInput, optFns ...func(*ListUserProfilesPaginatorOptions)) *ListUserProfilesPaginator { + options := ListUserProfilesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListUserProfilesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListUserProfilesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListUserProfiles page. +func (p *ListUserProfilesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListUserProfilesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListUserProfiles(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListModelsAPIClient is a client that implements the ListModels operation. +type ListModelsAPIClient interface { + ListModels(context.Context, *ListModelsInput, ...func(*Options)) (*ListModelsOutput, error) +} + +var _ ListModelsAPIClient = (*Client)(nil) + +// ListModelsPaginatorOptions is the paginator options for ListModels +type ListModelsPaginatorOptions struct { + // The maximum number of models to return in the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListModelsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListModels +type ListModelsPaginator struct { + options ListModelsPaginatorOptions + client ListModelsAPIClient + params *ListModelsInput + nextToken *string + firstPage bool + done bool +} + +// NewListModelsPaginator returns a new ListModelsPaginator +func NewListModelsPaginator(client ListModelsAPIClient, params *ListModelsInput, optFns ...func(*ListModelsPaginatorOptions)) *ListModelsPaginator { + options := ListModelsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListModelsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListModelsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListModels page. +func (p *ListModelsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListModelsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListModels(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListWorkteamsAPIClient is a client that implements the ListWorkteams operation. +type ListWorkteamsAPIClient interface { + ListWorkteams(context.Context, *ListWorkteamsInput, ...func(*Options)) (*ListWorkteamsOutput, error) +} + +var _ ListWorkteamsAPIClient = (*Client)(nil) + +// ListWorkteamsPaginatorOptions is the paginator options for ListWorkteams +type ListWorkteamsPaginatorOptions struct { + // The maximum number of work teams to return in each page of the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListWorkteamsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListWorkteams +type ListWorkteamsPaginator struct { + options ListWorkteamsPaginatorOptions + client ListWorkteamsAPIClient + params *ListWorkteamsInput + nextToken *string + firstPage bool + done bool +} + +// NewListWorkteamsPaginator returns a new ListWorkteamsPaginator +func NewListWorkteamsPaginator(client ListWorkteamsAPIClient, params *ListWorkteamsInput, optFns ...func(*ListWorkteamsPaginatorOptions)) *ListWorkteamsPaginator { + options := ListWorkteamsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListWorkteamsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListWorkteamsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListWorkteams page. +func (p *ListWorkteamsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListWorkteamsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListWorkteams(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListExperimentsAPIClient is a client that implements the ListExperiments +// operation. +type ListExperimentsAPIClient interface { + ListExperiments(context.Context, *ListExperimentsInput, ...func(*Options)) (*ListExperimentsOutput, error) +} + +var _ ListExperimentsAPIClient = (*Client)(nil) + +// ListExperimentsPaginatorOptions is the paginator options for ListExperiments +type ListExperimentsPaginatorOptions struct { + // The maximum number of experiments to return in the response. The default value + // is 10. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListExperimentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListExperiments +type ListExperimentsPaginator struct { + options ListExperimentsPaginatorOptions + client ListExperimentsAPIClient + params *ListExperimentsInput + nextToken *string + firstPage bool + done bool +} + +// NewListExperimentsPaginator returns a new ListExperimentsPaginator +func NewListExperimentsPaginator(client ListExperimentsAPIClient, params *ListExperimentsInput, optFns ...func(*ListExperimentsPaginatorOptions)) *ListExperimentsPaginator { + options := ListExperimentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListExperimentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListExperimentsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListExperiments page. +func (p *ListExperimentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListExperimentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListExperiments(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListCandidatesForAutoMLJobAPIClient is a client that implements the +// ListCandidatesForAutoMLJob operation. +type ListCandidatesForAutoMLJobAPIClient interface { + ListCandidatesForAutoMLJob(context.Context, *ListCandidatesForAutoMLJobInput, ...func(*Options)) (*ListCandidatesForAutoMLJobOutput, error) +} + +var _ ListCandidatesForAutoMLJobAPIClient = (*Client)(nil) + +// ListCandidatesForAutoMLJobPaginatorOptions is the paginator options for +// ListCandidatesForAutoMLJob +type ListCandidatesForAutoMLJobPaginatorOptions struct { + // List the job's Candidates up to a specified limit. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListCandidatesForAutoMLJobPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListCandidatesForAutoMLJob +type ListCandidatesForAutoMLJobPaginator struct { + options ListCandidatesForAutoMLJobPaginatorOptions + client ListCandidatesForAutoMLJobAPIClient + params *ListCandidatesForAutoMLJobInput + nextToken *string + firstPage bool + done bool +} + +// NewListCandidatesForAutoMLJobPaginator returns a new +// ListCandidatesForAutoMLJobPaginator +func NewListCandidatesForAutoMLJobPaginator(client ListCandidatesForAutoMLJobAPIClient, params *ListCandidatesForAutoMLJobInput, optFns ...func(*ListCandidatesForAutoMLJobPaginatorOptions)) *ListCandidatesForAutoMLJobPaginator { + options := ListCandidatesForAutoMLJobPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListCandidatesForAutoMLJobPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCandidatesForAutoMLJobPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListCandidatesForAutoMLJob page. +func (p *ListCandidatesForAutoMLJobPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCandidatesForAutoMLJobOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListCandidatesForAutoMLJob(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListHumanTaskUisAPIClient is a client that implements the ListHumanTaskUis +// operation. +type ListHumanTaskUisAPIClient interface { + ListHumanTaskUis(context.Context, *ListHumanTaskUisInput, ...func(*Options)) (*ListHumanTaskUisOutput, error) +} + +var _ ListHumanTaskUisAPIClient = (*Client)(nil) + +// ListHumanTaskUisPaginatorOptions is the paginator options for ListHumanTaskUis +type ListHumanTaskUisPaginatorOptions struct { + // The total number of items to return. If the total number of available items is + // more than the value specified in MaxResults, then a NextToken will be provided + // in the output that you can use to resume pagination. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListHumanTaskUisPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListHumanTaskUis +type ListHumanTaskUisPaginator struct { + options ListHumanTaskUisPaginatorOptions + client ListHumanTaskUisAPIClient + params *ListHumanTaskUisInput + nextToken *string + firstPage bool + done bool +} + +// NewListHumanTaskUisPaginator returns a new ListHumanTaskUisPaginator +func NewListHumanTaskUisPaginator(client ListHumanTaskUisAPIClient, params *ListHumanTaskUisInput, optFns ...func(*ListHumanTaskUisPaginatorOptions)) *ListHumanTaskUisPaginator { + options := ListHumanTaskUisPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListHumanTaskUisPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListHumanTaskUisPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListHumanTaskUis page. +func (p *ListHumanTaskUisPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListHumanTaskUisOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListHumanTaskUis(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListEndpointsAPIClient is a client that implements the ListEndpoints operation. +type ListEndpointsAPIClient interface { + ListEndpoints(context.Context, *ListEndpointsInput, ...func(*Options)) (*ListEndpointsOutput, error) +} + +var _ ListEndpointsAPIClient = (*Client)(nil) + +// ListEndpointsPaginatorOptions is the paginator options for ListEndpoints +type ListEndpointsPaginatorOptions struct { + // The maximum number of endpoints to return in the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListEndpointsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListEndpoints +type ListEndpointsPaginator struct { + options ListEndpointsPaginatorOptions + client ListEndpointsAPIClient + params *ListEndpointsInput + nextToken *string + firstPage bool + done bool +} + +// NewListEndpointsPaginator returns a new ListEndpointsPaginator +func NewListEndpointsPaginator(client ListEndpointsAPIClient, params *ListEndpointsInput, optFns ...func(*ListEndpointsPaginatorOptions)) *ListEndpointsPaginator { + options := ListEndpointsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListEndpointsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListEndpointsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListEndpoints page. +func (p *ListEndpointsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEndpointsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListEndpoints(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTrainingJobsAPIClient is a client that implements the ListTrainingJobs +// operation. +type ListTrainingJobsAPIClient interface { + ListTrainingJobs(context.Context, *ListTrainingJobsInput, ...func(*Options)) (*ListTrainingJobsOutput, error) +} + +var _ ListTrainingJobsAPIClient = (*Client)(nil) + +// ListTrainingJobsPaginatorOptions is the paginator options for ListTrainingJobs +type ListTrainingJobsPaginatorOptions struct { + // The maximum number of training jobs to return in the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTrainingJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListTrainingJobs +type ListTrainingJobsPaginator struct { + options ListTrainingJobsPaginatorOptions + client ListTrainingJobsAPIClient + params *ListTrainingJobsInput + nextToken *string + firstPage bool + done bool +} + +// NewListTrainingJobsPaginator returns a new ListTrainingJobsPaginator +func NewListTrainingJobsPaginator(client ListTrainingJobsAPIClient, params *ListTrainingJobsInput, optFns ...func(*ListTrainingJobsPaginatorOptions)) *ListTrainingJobsPaginator { + options := ListTrainingJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTrainingJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTrainingJobsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTrainingJobs page. +func (p *ListTrainingJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTrainingJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListTrainingJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTrialComponentsAPIClient is a client that implements the ListTrialComponents +// operation. +type ListTrialComponentsAPIClient interface { + ListTrialComponents(context.Context, *ListTrialComponentsInput, ...func(*Options)) (*ListTrialComponentsOutput, error) +} + +var _ ListTrialComponentsAPIClient = (*Client)(nil) + +// ListTrialComponentsPaginatorOptions is the paginator options for +// ListTrialComponents +type ListTrialComponentsPaginatorOptions struct { + // The maximum number of components to return in the response. The default value is + // 10. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTrialComponentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListTrialComponents +type ListTrialComponentsPaginator struct { + options ListTrialComponentsPaginatorOptions + client ListTrialComponentsAPIClient + params *ListTrialComponentsInput + nextToken *string + firstPage bool + done bool +} + +// NewListTrialComponentsPaginator returns a new ListTrialComponentsPaginator +func NewListTrialComponentsPaginator(client ListTrialComponentsAPIClient, params *ListTrialComponentsInput, optFns ...func(*ListTrialComponentsPaginatorOptions)) *ListTrialComponentsPaginator { + options := ListTrialComponentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTrialComponentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTrialComponentsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTrialComponents page. +func (p *ListTrialComponentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTrialComponentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListTrialComponents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTagsAPIClient is a client that implements the ListTags operation. +type ListTagsAPIClient interface { + ListTags(context.Context, *ListTagsInput, ...func(*Options)) (*ListTagsOutput, error) +} + +var _ ListTagsAPIClient = (*Client)(nil) + +// ListTagsPaginatorOptions is the paginator options for ListTags +type ListTagsPaginatorOptions struct { + // Maximum number of tags to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTagsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListTags +type ListTagsPaginator struct { + options ListTagsPaginatorOptions + client ListTagsAPIClient + params *ListTagsInput + nextToken *string + firstPage bool + done bool +} + +// NewListTagsPaginator returns a new ListTagsPaginator +func NewListTagsPaginator(client ListTagsAPIClient, params *ListTagsInput, optFns ...func(*ListTagsPaginatorOptions)) *ListTagsPaginator { + options := ListTagsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTagsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTagsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTags page. +func (p *ListTagsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTagsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListTags(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListMonitoringSchedulesAPIClient is a client that implements the +// ListMonitoringSchedules operation. +type ListMonitoringSchedulesAPIClient interface { + ListMonitoringSchedules(context.Context, *ListMonitoringSchedulesInput, ...func(*Options)) (*ListMonitoringSchedulesOutput, error) +} + +var _ ListMonitoringSchedulesAPIClient = (*Client)(nil) + +// ListMonitoringSchedulesPaginatorOptions is the paginator options for +// ListMonitoringSchedules +type ListMonitoringSchedulesPaginatorOptions struct { + // The maximum number of jobs to return in the response. The default value is 10. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListMonitoringSchedulesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListMonitoringSchedules +type ListMonitoringSchedulesPaginator struct { + options ListMonitoringSchedulesPaginatorOptions + client ListMonitoringSchedulesAPIClient + params *ListMonitoringSchedulesInput + nextToken *string + firstPage bool + done bool +} + +// NewListMonitoringSchedulesPaginator returns a new +// ListMonitoringSchedulesPaginator +func NewListMonitoringSchedulesPaginator(client ListMonitoringSchedulesAPIClient, params *ListMonitoringSchedulesInput, optFns ...func(*ListMonitoringSchedulesPaginatorOptions)) *ListMonitoringSchedulesPaginator { + options := ListMonitoringSchedulesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListMonitoringSchedulesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMonitoringSchedulesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListMonitoringSchedules page. +func (p *ListMonitoringSchedulesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMonitoringSchedulesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListMonitoringSchedules(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListImageVersionsAPIClient is a client that implements the ListImageVersions +// operation. +type ListImageVersionsAPIClient interface { + ListImageVersions(context.Context, *ListImageVersionsInput, ...func(*Options)) (*ListImageVersionsOutput, error) +} + +var _ ListImageVersionsAPIClient = (*Client)(nil) + +// ListImageVersionsPaginatorOptions is the paginator options for ListImageVersions +type ListImageVersionsPaginatorOptions struct { + // The maximum number of versions to return in the response. The default value is + // 10. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListImageVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListImageVersions +type ListImageVersionsPaginator struct { + options ListImageVersionsPaginatorOptions + client ListImageVersionsAPIClient + params *ListImageVersionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListImageVersionsPaginator returns a new ListImageVersionsPaginator +func NewListImageVersionsPaginator(client ListImageVersionsAPIClient, params *ListImageVersionsInput, optFns ...func(*ListImageVersionsPaginatorOptions)) *ListImageVersionsPaginator { + options := ListImageVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListImageVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListImageVersionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListImageVersions page. +func (p *ListImageVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListImageVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListImageVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListMonitoringExecutionsAPIClient is a client that implements the +// ListMonitoringExecutions operation. +type ListMonitoringExecutionsAPIClient interface { + ListMonitoringExecutions(context.Context, *ListMonitoringExecutionsInput, ...func(*Options)) (*ListMonitoringExecutionsOutput, error) +} + +var _ ListMonitoringExecutionsAPIClient = (*Client)(nil) + +// ListMonitoringExecutionsPaginatorOptions is the paginator options for +// ListMonitoringExecutions +type ListMonitoringExecutionsPaginatorOptions struct { + // The maximum number of jobs to return in the response. The default value is 10. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListMonitoringExecutionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListMonitoringExecutions +type ListMonitoringExecutionsPaginator struct { + options ListMonitoringExecutionsPaginatorOptions + client ListMonitoringExecutionsAPIClient + params *ListMonitoringExecutionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListMonitoringExecutionsPaginator returns a new +// ListMonitoringExecutionsPaginator +func NewListMonitoringExecutionsPaginator(client ListMonitoringExecutionsAPIClient, params *ListMonitoringExecutionsInput, optFns ...func(*ListMonitoringExecutionsPaginatorOptions)) *ListMonitoringExecutionsPaginator { + options := ListMonitoringExecutionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListMonitoringExecutionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMonitoringExecutionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListMonitoringExecutions page. +func (p *ListMonitoringExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMonitoringExecutionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListMonitoringExecutions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListHyperParameterTuningJobsAPIClient is a client that implements the +// ListHyperParameterTuningJobs operation. +type ListHyperParameterTuningJobsAPIClient interface { + ListHyperParameterTuningJobs(context.Context, *ListHyperParameterTuningJobsInput, ...func(*Options)) (*ListHyperParameterTuningJobsOutput, error) +} + +var _ ListHyperParameterTuningJobsAPIClient = (*Client)(nil) + +// ListHyperParameterTuningJobsPaginatorOptions is the paginator options for +// ListHyperParameterTuningJobs +type ListHyperParameterTuningJobsPaginatorOptions struct { + // The maximum number of tuning jobs to return. The default value is 10. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListHyperParameterTuningJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListHyperParameterTuningJobs +type ListHyperParameterTuningJobsPaginator struct { + options ListHyperParameterTuningJobsPaginatorOptions + client ListHyperParameterTuningJobsAPIClient + params *ListHyperParameterTuningJobsInput + nextToken *string + firstPage bool + done bool +} + +// NewListHyperParameterTuningJobsPaginator returns a new +// ListHyperParameterTuningJobsPaginator +func NewListHyperParameterTuningJobsPaginator(client ListHyperParameterTuningJobsAPIClient, params *ListHyperParameterTuningJobsInput, optFns ...func(*ListHyperParameterTuningJobsPaginatorOptions)) *ListHyperParameterTuningJobsPaginator { + options := ListHyperParameterTuningJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListHyperParameterTuningJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListHyperParameterTuningJobsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListHyperParameterTuningJobs page. +func (p *ListHyperParameterTuningJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListHyperParameterTuningJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListHyperParameterTuningJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListAutoMLJobsAPIClient is a client that implements the ListAutoMLJobs +// operation. +type ListAutoMLJobsAPIClient interface { + ListAutoMLJobs(context.Context, *ListAutoMLJobsInput, ...func(*Options)) (*ListAutoMLJobsOutput, error) +} + +var _ ListAutoMLJobsAPIClient = (*Client)(nil) + +// ListAutoMLJobsPaginatorOptions is the paginator options for ListAutoMLJobs +type ListAutoMLJobsPaginatorOptions struct { + // Request a list of jobs up to a specified limit. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAutoMLJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListAutoMLJobs +type ListAutoMLJobsPaginator struct { + options ListAutoMLJobsPaginatorOptions + client ListAutoMLJobsAPIClient + params *ListAutoMLJobsInput + nextToken *string + firstPage bool + done bool +} + +// NewListAutoMLJobsPaginator returns a new ListAutoMLJobsPaginator +func NewListAutoMLJobsPaginator(client ListAutoMLJobsAPIClient, params *ListAutoMLJobsInput, optFns ...func(*ListAutoMLJobsPaginatorOptions)) *ListAutoMLJobsPaginator { + options := ListAutoMLJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAutoMLJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAutoMLJobsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAutoMLJobs page. +func (p *ListAutoMLJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAutoMLJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListAutoMLJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListSubscribedWorkteamsAPIClient is a client that implements the +// ListSubscribedWorkteams operation. +type ListSubscribedWorkteamsAPIClient interface { + ListSubscribedWorkteams(context.Context, *ListSubscribedWorkteamsInput, ...func(*Options)) (*ListSubscribedWorkteamsOutput, error) +} + +var _ ListSubscribedWorkteamsAPIClient = (*Client)(nil) + +// ListSubscribedWorkteamsPaginatorOptions is the paginator options for +// ListSubscribedWorkteams +type ListSubscribedWorkteamsPaginatorOptions struct { + // The maximum number of work teams to return in each page of the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListSubscribedWorkteamsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListSubscribedWorkteams +type ListSubscribedWorkteamsPaginator struct { + options ListSubscribedWorkteamsPaginatorOptions + client ListSubscribedWorkteamsAPIClient + params *ListSubscribedWorkteamsInput + nextToken *string + firstPage bool + done bool +} + +// NewListSubscribedWorkteamsPaginator returns a new +// ListSubscribedWorkteamsPaginator +func NewListSubscribedWorkteamsPaginator(client ListSubscribedWorkteamsAPIClient, params *ListSubscribedWorkteamsInput, optFns ...func(*ListSubscribedWorkteamsPaginatorOptions)) *ListSubscribedWorkteamsPaginator { + options := ListSubscribedWorkteamsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListSubscribedWorkteamsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSubscribedWorkteamsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListSubscribedWorkteams page. +func (p *ListSubscribedWorkteamsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSubscribedWorkteamsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListSubscribedWorkteams(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListLabelingJobsForWorkteamAPIClient is a client that implements the +// ListLabelingJobsForWorkteam operation. +type ListLabelingJobsForWorkteamAPIClient interface { + ListLabelingJobsForWorkteam(context.Context, *ListLabelingJobsForWorkteamInput, ...func(*Options)) (*ListLabelingJobsForWorkteamOutput, error) +} + +var _ ListLabelingJobsForWorkteamAPIClient = (*Client)(nil) + +// ListLabelingJobsForWorkteamPaginatorOptions is the paginator options for +// ListLabelingJobsForWorkteam +type ListLabelingJobsForWorkteamPaginatorOptions struct { + // The maximum number of labeling jobs to return in each page of the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListLabelingJobsForWorkteamPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListLabelingJobsForWorkteam +type ListLabelingJobsForWorkteamPaginator struct { + options ListLabelingJobsForWorkteamPaginatorOptions + client ListLabelingJobsForWorkteamAPIClient + params *ListLabelingJobsForWorkteamInput + nextToken *string + firstPage bool + done bool +} + +// NewListLabelingJobsForWorkteamPaginator returns a new +// ListLabelingJobsForWorkteamPaginator +func NewListLabelingJobsForWorkteamPaginator(client ListLabelingJobsForWorkteamAPIClient, params *ListLabelingJobsForWorkteamInput, optFns ...func(*ListLabelingJobsForWorkteamPaginatorOptions)) *ListLabelingJobsForWorkteamPaginator { + options := ListLabelingJobsForWorkteamPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListLabelingJobsForWorkteamPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListLabelingJobsForWorkteamPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListLabelingJobsForWorkteam page. +func (p *ListLabelingJobsForWorkteamPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListLabelingJobsForWorkteamOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListLabelingJobsForWorkteam(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/sagemakera2iruntime/go.sum b/service/sagemakera2iruntime/go.sum index c669e324b14..32595049f96 100644 --- a/service/sagemakera2iruntime/go.sum +++ b/service/sagemakera2iruntime/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/sagemakera2iruntime/paginators.go b/service/sagemakera2iruntime/paginators.go new file mode 100644 index 00000000000..c2026a59704 --- /dev/null +++ b/service/sagemakera2iruntime/paginators.go @@ -0,0 +1,85 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sagemakera2iruntime + +import ( + "context" + "fmt" +) + +// ListHumanLoopsAPIClient is a client that implements the ListHumanLoops +// operation. +type ListHumanLoopsAPIClient interface { + ListHumanLoops(context.Context, *ListHumanLoopsInput, ...func(*Options)) (*ListHumanLoopsOutput, error) +} + +var _ ListHumanLoopsAPIClient = (*Client)(nil) + +// ListHumanLoopsPaginatorOptions is the paginator options for ListHumanLoops +type ListHumanLoopsPaginatorOptions struct { + // The total number of items to return. If the total number of available items is + // more than the value specified in MaxResults, then a NextToken is returned in the + // output. You can use this token to display the next page of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListHumanLoopsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemakera2iruntime.ListHumanLoops +type ListHumanLoopsPaginator struct { + options ListHumanLoopsPaginatorOptions + client ListHumanLoopsAPIClient + params *ListHumanLoopsInput + nextToken *string + firstPage bool + done bool +} + +// NewListHumanLoopsPaginator returns a new ListHumanLoopsPaginator +func NewListHumanLoopsPaginator(client ListHumanLoopsAPIClient, params *ListHumanLoopsInput, optFns ...func(*ListHumanLoopsPaginatorOptions)) *ListHumanLoopsPaginator { + options := ListHumanLoopsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListHumanLoopsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListHumanLoopsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListHumanLoops page. +func (p *ListHumanLoopsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListHumanLoopsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListHumanLoops(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/sagemakerruntime/go.sum b/service/sagemakerruntime/go.sum index c669e324b14..32595049f96 100644 --- a/service/sagemakerruntime/go.sum +++ b/service/sagemakerruntime/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/savingsplans/go.sum b/service/savingsplans/go.sum index c669e324b14..32595049f96 100644 --- a/service/savingsplans/go.sum +++ b/service/savingsplans/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/schemas/go.sum b/service/schemas/go.sum index c669e324b14..32595049f96 100644 --- a/service/schemas/go.sum +++ b/service/schemas/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/schemas/paginators.go b/service/schemas/paginators.go new file mode 100644 index 00000000000..117275d9a37 --- /dev/null +++ b/service/schemas/paginators.go @@ -0,0 +1,377 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package schemas + +import ( + "context" + "fmt" +) + +// ListDiscoverersAPIClient is a client that implements the ListDiscoverers +// operation. +type ListDiscoverersAPIClient interface { + ListDiscoverers(context.Context, *ListDiscoverersInput, ...func(*Options)) (*ListDiscoverersOutput, error) +} + +var _ ListDiscoverersAPIClient = (*Client)(nil) + +// ListDiscoverersPaginatorOptions is the paginator options for ListDiscoverers +type ListDiscoverersPaginatorOptions struct { + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDiscoverersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/schemas.ListDiscoverers +type ListDiscoverersPaginator struct { + options ListDiscoverersPaginatorOptions + client ListDiscoverersAPIClient + params *ListDiscoverersInput + nextToken *string + firstPage bool + done bool +} + +// NewListDiscoverersPaginator returns a new ListDiscoverersPaginator +func NewListDiscoverersPaginator(client ListDiscoverersAPIClient, params *ListDiscoverersInput, optFns ...func(*ListDiscoverersPaginatorOptions)) *ListDiscoverersPaginator { + options := ListDiscoverersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDiscoverersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDiscoverersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDiscoverers page. +func (p *ListDiscoverersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDiscoverersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.ListDiscoverers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// SearchSchemasAPIClient is a client that implements the SearchSchemas operation. +type SearchSchemasAPIClient interface { + SearchSchemas(context.Context, *SearchSchemasInput, ...func(*Options)) (*SearchSchemasOutput, error) +} + +var _ SearchSchemasAPIClient = (*Client)(nil) + +// SearchSchemasPaginatorOptions is the paginator options for SearchSchemas +type SearchSchemasPaginatorOptions struct { + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// SearchSchemasPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/schemas.SearchSchemas +type SearchSchemasPaginator struct { + options SearchSchemasPaginatorOptions + client SearchSchemasAPIClient + params *SearchSchemasInput + nextToken *string + firstPage bool + done bool +} + +// NewSearchSchemasPaginator returns a new SearchSchemasPaginator +func NewSearchSchemasPaginator(client SearchSchemasAPIClient, params *SearchSchemasInput, optFns ...func(*SearchSchemasPaginatorOptions)) *SearchSchemasPaginator { + options := SearchSchemasPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &SearchSchemasPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchSchemasPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next SearchSchemas page. +func (p *SearchSchemasPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchSchemasOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.SearchSchemas(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListRegistriesAPIClient is a client that implements the ListRegistries +// operation. +type ListRegistriesAPIClient interface { + ListRegistries(context.Context, *ListRegistriesInput, ...func(*Options)) (*ListRegistriesOutput, error) +} + +var _ ListRegistriesAPIClient = (*Client)(nil) + +// ListRegistriesPaginatorOptions is the paginator options for ListRegistries +type ListRegistriesPaginatorOptions struct { + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListRegistriesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/schemas.ListRegistries +type ListRegistriesPaginator struct { + options ListRegistriesPaginatorOptions + client ListRegistriesAPIClient + params *ListRegistriesInput + nextToken *string + firstPage bool + done bool +} + +// NewListRegistriesPaginator returns a new ListRegistriesPaginator +func NewListRegistriesPaginator(client ListRegistriesAPIClient, params *ListRegistriesInput, optFns ...func(*ListRegistriesPaginatorOptions)) *ListRegistriesPaginator { + options := ListRegistriesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListRegistriesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRegistriesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListRegistries page. +func (p *ListRegistriesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRegistriesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.ListRegistries(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListSchemaVersionsAPIClient is a client that implements the ListSchemaVersions +// operation. +type ListSchemaVersionsAPIClient interface { + ListSchemaVersions(context.Context, *ListSchemaVersionsInput, ...func(*Options)) (*ListSchemaVersionsOutput, error) +} + +var _ ListSchemaVersionsAPIClient = (*Client)(nil) + +// ListSchemaVersionsPaginatorOptions is the paginator options for +// ListSchemaVersions +type ListSchemaVersionsPaginatorOptions struct { + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListSchemaVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/schemas.ListSchemaVersions +type ListSchemaVersionsPaginator struct { + options ListSchemaVersionsPaginatorOptions + client ListSchemaVersionsAPIClient + params *ListSchemaVersionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListSchemaVersionsPaginator returns a new ListSchemaVersionsPaginator +func NewListSchemaVersionsPaginator(client ListSchemaVersionsAPIClient, params *ListSchemaVersionsInput, optFns ...func(*ListSchemaVersionsPaginatorOptions)) *ListSchemaVersionsPaginator { + options := ListSchemaVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListSchemaVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSchemaVersionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListSchemaVersions page. +func (p *ListSchemaVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSchemaVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.ListSchemaVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListSchemasAPIClient is a client that implements the ListSchemas operation. +type ListSchemasAPIClient interface { + ListSchemas(context.Context, *ListSchemasInput, ...func(*Options)) (*ListSchemasOutput, error) +} + +var _ ListSchemasAPIClient = (*Client)(nil) + +// ListSchemasPaginatorOptions is the paginator options for ListSchemas +type ListSchemasPaginatorOptions struct { + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListSchemasPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/schemas.ListSchemas +type ListSchemasPaginator struct { + options ListSchemasPaginatorOptions + client ListSchemasAPIClient + params *ListSchemasInput + nextToken *string + firstPage bool + done bool +} + +// NewListSchemasPaginator returns a new ListSchemasPaginator +func NewListSchemasPaginator(client ListSchemasAPIClient, params *ListSchemasInput, optFns ...func(*ListSchemasPaginatorOptions)) *ListSchemasPaginator { + options := ListSchemasPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListSchemasPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSchemasPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListSchemas page. +func (p *ListSchemasPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSchemasOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.ListSchemas(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/secretsmanager/go.sum b/service/secretsmanager/go.sum index c669e324b14..32595049f96 100644 --- a/service/secretsmanager/go.sum +++ b/service/secretsmanager/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/secretsmanager/paginators.go b/service/secretsmanager/paginators.go new file mode 100644 index 00000000000..298c8bd0d80 --- /dev/null +++ b/service/secretsmanager/paginators.go @@ -0,0 +1,174 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package secretsmanager + +import ( + "context" + "fmt" +) + +// ListSecretVersionIdsAPIClient is a client that implements the +// ListSecretVersionIds operation. +type ListSecretVersionIdsAPIClient interface { + ListSecretVersionIds(context.Context, *ListSecretVersionIdsInput, ...func(*Options)) (*ListSecretVersionIdsOutput, error) +} + +var _ ListSecretVersionIdsAPIClient = (*Client)(nil) + +// ListSecretVersionIdsPaginatorOptions is the paginator options for +// ListSecretVersionIds +type ListSecretVersionIdsPaginatorOptions struct { + // (Optional) Limits the number of results you want to include in the response. If + // you don't include this parameter, it defaults to a value that's specific to the + // operation. If additional items exist beyond the maximum you specify, the + // NextToken response element is present and has a value (isn't null). Include that + // value as the NextToken request parameter in the next call to the operation to + // get the next part of the results. Note that Secrets Manager might return fewer + // results than the maximum even when there are more results available. You should + // check NextToken after every operation to ensure that you receive all of the + // results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListSecretVersionIdsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/secretsmanager.ListSecretVersionIds +type ListSecretVersionIdsPaginator struct { + options ListSecretVersionIdsPaginatorOptions + client ListSecretVersionIdsAPIClient + params *ListSecretVersionIdsInput + nextToken *string + firstPage bool + done bool +} + +// NewListSecretVersionIdsPaginator returns a new ListSecretVersionIdsPaginator +func NewListSecretVersionIdsPaginator(client ListSecretVersionIdsAPIClient, params *ListSecretVersionIdsInput, optFns ...func(*ListSecretVersionIdsPaginatorOptions)) *ListSecretVersionIdsPaginator { + options := ListSecretVersionIdsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListSecretVersionIdsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSecretVersionIdsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListSecretVersionIds page. +func (p *ListSecretVersionIdsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSecretVersionIdsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListSecretVersionIds(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListSecretsAPIClient is a client that implements the ListSecrets operation. +type ListSecretsAPIClient interface { + ListSecrets(context.Context, *ListSecretsInput, ...func(*Options)) (*ListSecretsOutput, error) +} + +var _ ListSecretsAPIClient = (*Client)(nil) + +// ListSecretsPaginatorOptions is the paginator options for ListSecrets +type ListSecretsPaginatorOptions struct { + // (Optional) Limits the number of results you want to include in the response. If + // you don't include this parameter, it defaults to a value that's specific to the + // operation. If additional items exist beyond the maximum you specify, the + // NextToken response element is present and has a value (isn't null). Include that + // value as the NextToken request parameter in the next call to the operation to + // get the next part of the results. Note that Secrets Manager might return fewer + // results than the maximum even when there are more results available. You should + // check NextToken after every operation to ensure that you receive all of the + // results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListSecretsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/secretsmanager.ListSecrets +type ListSecretsPaginator struct { + options ListSecretsPaginatorOptions + client ListSecretsAPIClient + params *ListSecretsInput + nextToken *string + firstPage bool + done bool +} + +// NewListSecretsPaginator returns a new ListSecretsPaginator +func NewListSecretsPaginator(client ListSecretsAPIClient, params *ListSecretsInput, optFns ...func(*ListSecretsPaginatorOptions)) *ListSecretsPaginator { + options := ListSecretsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListSecretsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSecretsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListSecrets page. +func (p *ListSecretsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSecretsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListSecrets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/securityhub/go.sum b/service/securityhub/go.sum index c669e324b14..32595049f96 100644 --- a/service/securityhub/go.sum +++ b/service/securityhub/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/securityhub/paginators.go b/service/securityhub/paginators.go new file mode 100644 index 00000000000..7e705baf952 --- /dev/null +++ b/service/securityhub/paginators.go @@ -0,0 +1,761 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package securityhub + +import ( + "context" + "fmt" +) + +// ListInvitationsAPIClient is a client that implements the ListInvitations +// operation. +type ListInvitationsAPIClient interface { + ListInvitations(context.Context, *ListInvitationsInput, ...func(*Options)) (*ListInvitationsOutput, error) +} + +var _ ListInvitationsAPIClient = (*Client)(nil) + +// ListInvitationsPaginatorOptions is the paginator options for ListInvitations +type ListInvitationsPaginatorOptions struct { + // The maximum number of items to return in the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListInvitationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/securityhub.ListInvitations +type ListInvitationsPaginator struct { + options ListInvitationsPaginatorOptions + client ListInvitationsAPIClient + params *ListInvitationsInput + nextToken *string + firstPage bool + done bool +} + +// NewListInvitationsPaginator returns a new ListInvitationsPaginator +func NewListInvitationsPaginator(client ListInvitationsAPIClient, params *ListInvitationsInput, optFns ...func(*ListInvitationsPaginatorOptions)) *ListInvitationsPaginator { + options := ListInvitationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListInvitationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListInvitationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListInvitations page. +func (p *ListInvitationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListInvitationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListInvitations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetEnabledStandardsAPIClient is a client that implements the GetEnabledStandards +// operation. +type GetEnabledStandardsAPIClient interface { + GetEnabledStandards(context.Context, *GetEnabledStandardsInput, ...func(*Options)) (*GetEnabledStandardsOutput, error) +} + +var _ GetEnabledStandardsAPIClient = (*Client)(nil) + +// GetEnabledStandardsPaginatorOptions is the paginator options for +// GetEnabledStandards +type GetEnabledStandardsPaginatorOptions struct { + // The maximum number of results to return in the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetEnabledStandardsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/securityhub.GetEnabledStandards +type GetEnabledStandardsPaginator struct { + options GetEnabledStandardsPaginatorOptions + client GetEnabledStandardsAPIClient + params *GetEnabledStandardsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetEnabledStandardsPaginator returns a new GetEnabledStandardsPaginator +func NewGetEnabledStandardsPaginator(client GetEnabledStandardsAPIClient, params *GetEnabledStandardsInput, optFns ...func(*GetEnabledStandardsPaginatorOptions)) *GetEnabledStandardsPaginator { + options := GetEnabledStandardsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetEnabledStandardsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetEnabledStandardsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetEnabledStandards page. +func (p *GetEnabledStandardsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetEnabledStandardsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetEnabledStandards(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeStandardsControlsAPIClient is a client that implements the +// DescribeStandardsControls operation. +type DescribeStandardsControlsAPIClient interface { + DescribeStandardsControls(context.Context, *DescribeStandardsControlsInput, ...func(*Options)) (*DescribeStandardsControlsOutput, error) +} + +var _ DescribeStandardsControlsAPIClient = (*Client)(nil) + +// DescribeStandardsControlsPaginatorOptions is the paginator options for +// DescribeStandardsControls +type DescribeStandardsControlsPaginatorOptions struct { + // The maximum number of security standard controls to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeStandardsControlsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/securityhub.DescribeStandardsControls +type DescribeStandardsControlsPaginator struct { + options DescribeStandardsControlsPaginatorOptions + client DescribeStandardsControlsAPIClient + params *DescribeStandardsControlsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeStandardsControlsPaginator returns a new +// DescribeStandardsControlsPaginator +func NewDescribeStandardsControlsPaginator(client DescribeStandardsControlsAPIClient, params *DescribeStandardsControlsInput, optFns ...func(*DescribeStandardsControlsPaginatorOptions)) *DescribeStandardsControlsPaginator { + options := DescribeStandardsControlsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeStandardsControlsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeStandardsControlsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeStandardsControls page. +func (p *DescribeStandardsControlsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeStandardsControlsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeStandardsControls(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeStandardsAPIClient is a client that implements the DescribeStandards +// operation. +type DescribeStandardsAPIClient interface { + DescribeStandards(context.Context, *DescribeStandardsInput, ...func(*Options)) (*DescribeStandardsOutput, error) +} + +var _ DescribeStandardsAPIClient = (*Client)(nil) + +// DescribeStandardsPaginatorOptions is the paginator options for DescribeStandards +type DescribeStandardsPaginatorOptions struct { + // The maximum number of standards to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeStandardsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/securityhub.DescribeStandards +type DescribeStandardsPaginator struct { + options DescribeStandardsPaginatorOptions + client DescribeStandardsAPIClient + params *DescribeStandardsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeStandardsPaginator returns a new DescribeStandardsPaginator +func NewDescribeStandardsPaginator(client DescribeStandardsAPIClient, params *DescribeStandardsInput, optFns ...func(*DescribeStandardsPaginatorOptions)) *DescribeStandardsPaginator { + options := DescribeStandardsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeStandardsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeStandardsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeStandards page. +func (p *DescribeStandardsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeStandardsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeStandards(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListMembersAPIClient is a client that implements the ListMembers operation. +type ListMembersAPIClient interface { + ListMembers(context.Context, *ListMembersInput, ...func(*Options)) (*ListMembersOutput, error) +} + +var _ ListMembersAPIClient = (*Client)(nil) + +// ListMembersPaginatorOptions is the paginator options for ListMembers +type ListMembersPaginatorOptions struct { + // The maximum number of items to return in the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListMembersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/securityhub.ListMembers +type ListMembersPaginator struct { + options ListMembersPaginatorOptions + client ListMembersAPIClient + params *ListMembersInput + nextToken *string + firstPage bool + done bool +} + +// NewListMembersPaginator returns a new ListMembersPaginator +func NewListMembersPaginator(client ListMembersAPIClient, params *ListMembersInput, optFns ...func(*ListMembersPaginatorOptions)) *ListMembersPaginator { + options := ListMembersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListMembersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMembersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListMembers page. +func (p *ListMembersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMembersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListMembers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetFindingsAPIClient is a client that implements the GetFindings operation. +type GetFindingsAPIClient interface { + GetFindings(context.Context, *GetFindingsInput, ...func(*Options)) (*GetFindingsOutput, error) +} + +var _ GetFindingsAPIClient = (*Client)(nil) + +// GetFindingsPaginatorOptions is the paginator options for GetFindings +type GetFindingsPaginatorOptions struct { + // The maximum number of findings to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetFindingsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/securityhub.GetFindings +type GetFindingsPaginator struct { + options GetFindingsPaginatorOptions + client GetFindingsAPIClient + params *GetFindingsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetFindingsPaginator returns a new GetFindingsPaginator +func NewGetFindingsPaginator(client GetFindingsAPIClient, params *GetFindingsInput, optFns ...func(*GetFindingsPaginatorOptions)) *GetFindingsPaginator { + options := GetFindingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetFindingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetFindingsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetFindings page. +func (p *GetFindingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetFindingsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetFindings(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeActionTargetsAPIClient is a client that implements the +// DescribeActionTargets operation. +type DescribeActionTargetsAPIClient interface { + DescribeActionTargets(context.Context, *DescribeActionTargetsInput, ...func(*Options)) (*DescribeActionTargetsOutput, error) +} + +var _ DescribeActionTargetsAPIClient = (*Client)(nil) + +// DescribeActionTargetsPaginatorOptions is the paginator options for +// DescribeActionTargets +type DescribeActionTargetsPaginatorOptions struct { + // The maximum number of results to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeActionTargetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/securityhub.DescribeActionTargets +type DescribeActionTargetsPaginator struct { + options DescribeActionTargetsPaginatorOptions + client DescribeActionTargetsAPIClient + params *DescribeActionTargetsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeActionTargetsPaginator returns a new DescribeActionTargetsPaginator +func NewDescribeActionTargetsPaginator(client DescribeActionTargetsAPIClient, params *DescribeActionTargetsInput, optFns ...func(*DescribeActionTargetsPaginatorOptions)) *DescribeActionTargetsPaginator { + options := DescribeActionTargetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeActionTargetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeActionTargetsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeActionTargets page. +func (p *DescribeActionTargetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeActionTargetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeActionTargets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListEnabledProductsForImportAPIClient is a client that implements the +// ListEnabledProductsForImport operation. +type ListEnabledProductsForImportAPIClient interface { + ListEnabledProductsForImport(context.Context, *ListEnabledProductsForImportInput, ...func(*Options)) (*ListEnabledProductsForImportOutput, error) +} + +var _ ListEnabledProductsForImportAPIClient = (*Client)(nil) + +// ListEnabledProductsForImportPaginatorOptions is the paginator options for +// ListEnabledProductsForImport +type ListEnabledProductsForImportPaginatorOptions struct { + // The maximum number of items to return in the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListEnabledProductsForImportPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/securityhub.ListEnabledProductsForImport +type ListEnabledProductsForImportPaginator struct { + options ListEnabledProductsForImportPaginatorOptions + client ListEnabledProductsForImportAPIClient + params *ListEnabledProductsForImportInput + nextToken *string + firstPage bool + done bool +} + +// NewListEnabledProductsForImportPaginator returns a new +// ListEnabledProductsForImportPaginator +func NewListEnabledProductsForImportPaginator(client ListEnabledProductsForImportAPIClient, params *ListEnabledProductsForImportInput, optFns ...func(*ListEnabledProductsForImportPaginatorOptions)) *ListEnabledProductsForImportPaginator { + options := ListEnabledProductsForImportPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListEnabledProductsForImportPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListEnabledProductsForImportPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListEnabledProductsForImport page. +func (p *ListEnabledProductsForImportPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEnabledProductsForImportOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListEnabledProductsForImport(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeProductsAPIClient is a client that implements the DescribeProducts +// operation. +type DescribeProductsAPIClient interface { + DescribeProducts(context.Context, *DescribeProductsInput, ...func(*Options)) (*DescribeProductsOutput, error) +} + +var _ DescribeProductsAPIClient = (*Client)(nil) + +// DescribeProductsPaginatorOptions is the paginator options for DescribeProducts +type DescribeProductsPaginatorOptions struct { + // The maximum number of results to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeProductsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/securityhub.DescribeProducts +type DescribeProductsPaginator struct { + options DescribeProductsPaginatorOptions + client DescribeProductsAPIClient + params *DescribeProductsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeProductsPaginator returns a new DescribeProductsPaginator +func NewDescribeProductsPaginator(client DescribeProductsAPIClient, params *DescribeProductsInput, optFns ...func(*DescribeProductsPaginatorOptions)) *DescribeProductsPaginator { + options := DescribeProductsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeProductsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeProductsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeProducts page. +func (p *DescribeProductsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeProductsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeProducts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetInsightsAPIClient is a client that implements the GetInsights operation. +type GetInsightsAPIClient interface { + GetInsights(context.Context, *GetInsightsInput, ...func(*Options)) (*GetInsightsOutput, error) +} + +var _ GetInsightsAPIClient = (*Client)(nil) + +// GetInsightsPaginatorOptions is the paginator options for GetInsights +type GetInsightsPaginatorOptions struct { + // The maximum number of items to return in the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetInsightsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/securityhub.GetInsights +type GetInsightsPaginator struct { + options GetInsightsPaginatorOptions + client GetInsightsAPIClient + params *GetInsightsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetInsightsPaginator returns a new GetInsightsPaginator +func NewGetInsightsPaginator(client GetInsightsAPIClient, params *GetInsightsInput, optFns ...func(*GetInsightsPaginatorOptions)) *GetInsightsPaginator { + options := GetInsightsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetInsightsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetInsightsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetInsights page. +func (p *GetInsightsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetInsightsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetInsights(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/serverlessapplicationrepository/go.sum b/service/serverlessapplicationrepository/go.sum index c669e324b14..32595049f96 100644 --- a/service/serverlessapplicationrepository/go.sum +++ b/service/serverlessapplicationrepository/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/serverlessapplicationrepository/paginators.go b/service/serverlessapplicationrepository/paginators.go new file mode 100644 index 00000000000..2d0d757727f --- /dev/null +++ b/service/serverlessapplicationrepository/paginators.go @@ -0,0 +1,237 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package serverlessapplicationrepository + +import ( + "context" + "fmt" +) + +// ListApplicationsAPIClient is a client that implements the ListApplications +// operation. +type ListApplicationsAPIClient interface { + ListApplications(context.Context, *ListApplicationsInput, ...func(*Options)) (*ListApplicationsOutput, error) +} + +var _ ListApplicationsAPIClient = (*Client)(nil) + +// ListApplicationsPaginatorOptions is the paginator options for ListApplications +type ListApplicationsPaginatorOptions struct { + // The total number of items to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListApplicationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/serverlessapplicationrepository.ListApplications +type ListApplicationsPaginator struct { + options ListApplicationsPaginatorOptions + client ListApplicationsAPIClient + params *ListApplicationsInput + nextToken *string + firstPage bool + done bool +} + +// NewListApplicationsPaginator returns a new ListApplicationsPaginator +func NewListApplicationsPaginator(client ListApplicationsAPIClient, params *ListApplicationsInput, optFns ...func(*ListApplicationsPaginatorOptions)) *ListApplicationsPaginator { + options := ListApplicationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListApplicationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListApplicationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListApplications page. +func (p *ListApplicationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListApplicationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxItems = p.options.Limit + result, err := p.client.ListApplications(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListApplicationDependenciesAPIClient is a client that implements the +// ListApplicationDependencies operation. +type ListApplicationDependenciesAPIClient interface { + ListApplicationDependencies(context.Context, *ListApplicationDependenciesInput, ...func(*Options)) (*ListApplicationDependenciesOutput, error) +} + +var _ ListApplicationDependenciesAPIClient = (*Client)(nil) + +// ListApplicationDependenciesPaginatorOptions is the paginator options for +// ListApplicationDependencies +type ListApplicationDependenciesPaginatorOptions struct { + // The total number of items to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListApplicationDependenciesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/serverlessapplicationrepository.ListApplicationDependencies +type ListApplicationDependenciesPaginator struct { + options ListApplicationDependenciesPaginatorOptions + client ListApplicationDependenciesAPIClient + params *ListApplicationDependenciesInput + nextToken *string + firstPage bool + done bool +} + +// NewListApplicationDependenciesPaginator returns a new +// ListApplicationDependenciesPaginator +func NewListApplicationDependenciesPaginator(client ListApplicationDependenciesAPIClient, params *ListApplicationDependenciesInput, optFns ...func(*ListApplicationDependenciesPaginatorOptions)) *ListApplicationDependenciesPaginator { + options := ListApplicationDependenciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListApplicationDependenciesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListApplicationDependenciesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListApplicationDependencies page. +func (p *ListApplicationDependenciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListApplicationDependenciesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxItems = p.options.Limit + result, err := p.client.ListApplicationDependencies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListApplicationVersionsAPIClient is a client that implements the +// ListApplicationVersions operation. +type ListApplicationVersionsAPIClient interface { + ListApplicationVersions(context.Context, *ListApplicationVersionsInput, ...func(*Options)) (*ListApplicationVersionsOutput, error) +} + +var _ ListApplicationVersionsAPIClient = (*Client)(nil) + +// ListApplicationVersionsPaginatorOptions is the paginator options for +// ListApplicationVersions +type ListApplicationVersionsPaginatorOptions struct { + // The total number of items to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListApplicationVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/serverlessapplicationrepository.ListApplicationVersions +type ListApplicationVersionsPaginator struct { + options ListApplicationVersionsPaginatorOptions + client ListApplicationVersionsAPIClient + params *ListApplicationVersionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListApplicationVersionsPaginator returns a new +// ListApplicationVersionsPaginator +func NewListApplicationVersionsPaginator(client ListApplicationVersionsAPIClient, params *ListApplicationVersionsInput, optFns ...func(*ListApplicationVersionsPaginatorOptions)) *ListApplicationVersionsPaginator { + options := ListApplicationVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListApplicationVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListApplicationVersionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListApplicationVersions page. +func (p *ListApplicationVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListApplicationVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxItems = p.options.Limit + result, err := p.client.ListApplicationVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/servicecatalog/go.sum b/service/servicecatalog/go.sum index c669e324b14..32595049f96 100644 --- a/service/servicecatalog/go.sum +++ b/service/servicecatalog/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/servicecatalog/paginators.go b/service/servicecatalog/paginators.go new file mode 100644 index 00000000000..cbef60caa1f --- /dev/null +++ b/service/servicecatalog/paginators.go @@ -0,0 +1,1382 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package servicecatalog + +import ( + "context" + "fmt" +) + +// ListPortfoliosForProductAPIClient is a client that implements the +// ListPortfoliosForProduct operation. +type ListPortfoliosForProductAPIClient interface { + ListPortfoliosForProduct(context.Context, *ListPortfoliosForProductInput, ...func(*Options)) (*ListPortfoliosForProductOutput, error) +} + +var _ ListPortfoliosForProductAPIClient = (*Client)(nil) + +// ListPortfoliosForProductPaginatorOptions is the paginator options for +// ListPortfoliosForProduct +type ListPortfoliosForProductPaginatorOptions struct { + // The maximum number of items to return with this call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListPortfoliosForProductPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicecatalog.ListPortfoliosForProduct +type ListPortfoliosForProductPaginator struct { + options ListPortfoliosForProductPaginatorOptions + client ListPortfoliosForProductAPIClient + params *ListPortfoliosForProductInput + nextToken *string + firstPage bool + done bool +} + +// NewListPortfoliosForProductPaginator returns a new +// ListPortfoliosForProductPaginator +func NewListPortfoliosForProductPaginator(client ListPortfoliosForProductAPIClient, params *ListPortfoliosForProductInput, optFns ...func(*ListPortfoliosForProductPaginatorOptions)) *ListPortfoliosForProductPaginator { + options := ListPortfoliosForProductPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListPortfoliosForProductPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPortfoliosForProductPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListPortfoliosForProduct page. +func (p *ListPortfoliosForProductPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPortfoliosForProductOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PageToken = p.nextToken + params.PageSize = p.options.Limit + result, err := p.client.ListPortfoliosForProduct(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && params.PageToken != nil && p.nextToken != nil && *params.PageToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListBudgetsForResourceAPIClient is a client that implements the +// ListBudgetsForResource operation. +type ListBudgetsForResourceAPIClient interface { + ListBudgetsForResource(context.Context, *ListBudgetsForResourceInput, ...func(*Options)) (*ListBudgetsForResourceOutput, error) +} + +var _ ListBudgetsForResourceAPIClient = (*Client)(nil) + +// ListBudgetsForResourcePaginatorOptions is the paginator options for +// ListBudgetsForResource +type ListBudgetsForResourcePaginatorOptions struct { + // The maximum number of items to return with this call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListBudgetsForResourcePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicecatalog.ListBudgetsForResource +type ListBudgetsForResourcePaginator struct { + options ListBudgetsForResourcePaginatorOptions + client ListBudgetsForResourceAPIClient + params *ListBudgetsForResourceInput + nextToken *string + firstPage bool + done bool +} + +// NewListBudgetsForResourcePaginator returns a new ListBudgetsForResourcePaginator +func NewListBudgetsForResourcePaginator(client ListBudgetsForResourceAPIClient, params *ListBudgetsForResourceInput, optFns ...func(*ListBudgetsForResourcePaginatorOptions)) *ListBudgetsForResourcePaginator { + options := ListBudgetsForResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListBudgetsForResourcePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListBudgetsForResourcePaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListBudgetsForResource page. +func (p *ListBudgetsForResourcePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBudgetsForResourceOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PageToken = p.nextToken + params.PageSize = p.options.Limit + result, err := p.client.ListBudgetsForResource(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && params.PageToken != nil && p.nextToken != nil && *params.PageToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// SearchProvisionedProductsAPIClient is a client that implements the +// SearchProvisionedProducts operation. +type SearchProvisionedProductsAPIClient interface { + SearchProvisionedProducts(context.Context, *SearchProvisionedProductsInput, ...func(*Options)) (*SearchProvisionedProductsOutput, error) +} + +var _ SearchProvisionedProductsAPIClient = (*Client)(nil) + +// SearchProvisionedProductsPaginatorOptions is the paginator options for +// SearchProvisionedProducts +type SearchProvisionedProductsPaginatorOptions struct { + // The maximum number of items to return with this call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// SearchProvisionedProductsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicecatalog.SearchProvisionedProducts +type SearchProvisionedProductsPaginator struct { + options SearchProvisionedProductsPaginatorOptions + client SearchProvisionedProductsAPIClient + params *SearchProvisionedProductsInput + nextToken *string + firstPage bool + done bool +} + +// NewSearchProvisionedProductsPaginator returns a new +// SearchProvisionedProductsPaginator +func NewSearchProvisionedProductsPaginator(client SearchProvisionedProductsAPIClient, params *SearchProvisionedProductsInput, optFns ...func(*SearchProvisionedProductsPaginatorOptions)) *SearchProvisionedProductsPaginator { + options := SearchProvisionedProductsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &SearchProvisionedProductsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchProvisionedProductsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next SearchProvisionedProducts page. +func (p *SearchProvisionedProductsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchProvisionedProductsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PageToken = p.nextToken + params.PageSize = p.options.Limit + result, err := p.client.SearchProvisionedProducts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && params.PageToken != nil && p.nextToken != nil && *params.PageToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetProvisionedProductOutputsAPIClient is a client that implements the +// GetProvisionedProductOutputs operation. +type GetProvisionedProductOutputsAPIClient interface { + GetProvisionedProductOutputs(context.Context, *GetProvisionedProductOutputsInput, ...func(*Options)) (*GetProvisionedProductOutputsOutput, error) +} + +var _ GetProvisionedProductOutputsAPIClient = (*Client)(nil) + +// GetProvisionedProductOutputsPaginatorOptions is the paginator options for +// GetProvisionedProductOutputs +type GetProvisionedProductOutputsPaginatorOptions struct { + // The maximum number of items to return with this call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetProvisionedProductOutputsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicecatalog.GetProvisionedProductOutputs +type GetProvisionedProductOutputsPaginator struct { + options GetProvisionedProductOutputsPaginatorOptions + client GetProvisionedProductOutputsAPIClient + params *GetProvisionedProductOutputsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetProvisionedProductOutputsPaginator returns a new +// GetProvisionedProductOutputsPaginator +func NewGetProvisionedProductOutputsPaginator(client GetProvisionedProductOutputsAPIClient, params *GetProvisionedProductOutputsInput, optFns ...func(*GetProvisionedProductOutputsPaginatorOptions)) *GetProvisionedProductOutputsPaginator { + options := GetProvisionedProductOutputsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetProvisionedProductOutputsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetProvisionedProductOutputsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetProvisionedProductOutputs page. +func (p *GetProvisionedProductOutputsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetProvisionedProductOutputsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PageToken = p.nextToken + params.PageSize = p.options.Limit + result, err := p.client.GetProvisionedProductOutputs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && params.PageToken != nil && p.nextToken != nil && *params.PageToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListPortfolioAccessAPIClient is a client that implements the ListPortfolioAccess +// operation. +type ListPortfolioAccessAPIClient interface { + ListPortfolioAccess(context.Context, *ListPortfolioAccessInput, ...func(*Options)) (*ListPortfolioAccessOutput, error) +} + +var _ ListPortfolioAccessAPIClient = (*Client)(nil) + +// ListPortfolioAccessPaginatorOptions is the paginator options for +// ListPortfolioAccess +type ListPortfolioAccessPaginatorOptions struct { + // The maximum number of items to return with this call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListPortfolioAccessPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicecatalog.ListPortfolioAccess +type ListPortfolioAccessPaginator struct { + options ListPortfolioAccessPaginatorOptions + client ListPortfolioAccessAPIClient + params *ListPortfolioAccessInput + nextToken *string + firstPage bool + done bool +} + +// NewListPortfolioAccessPaginator returns a new ListPortfolioAccessPaginator +func NewListPortfolioAccessPaginator(client ListPortfolioAccessAPIClient, params *ListPortfolioAccessInput, optFns ...func(*ListPortfolioAccessPaginatorOptions)) *ListPortfolioAccessPaginator { + options := ListPortfolioAccessPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListPortfolioAccessPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPortfolioAccessPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListPortfolioAccess page. +func (p *ListPortfolioAccessPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPortfolioAccessOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PageToken = p.nextToken + params.PageSize = p.options.Limit + result, err := p.client.ListPortfolioAccess(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && params.PageToken != nil && p.nextToken != nil && *params.PageToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListResourcesForTagOptionAPIClient is a client that implements the +// ListResourcesForTagOption operation. +type ListResourcesForTagOptionAPIClient interface { + ListResourcesForTagOption(context.Context, *ListResourcesForTagOptionInput, ...func(*Options)) (*ListResourcesForTagOptionOutput, error) +} + +var _ ListResourcesForTagOptionAPIClient = (*Client)(nil) + +// ListResourcesForTagOptionPaginatorOptions is the paginator options for +// ListResourcesForTagOption +type ListResourcesForTagOptionPaginatorOptions struct { + // The maximum number of items to return with this call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListResourcesForTagOptionPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicecatalog.ListResourcesForTagOption +type ListResourcesForTagOptionPaginator struct { + options ListResourcesForTagOptionPaginatorOptions + client ListResourcesForTagOptionAPIClient + params *ListResourcesForTagOptionInput + nextToken *string + firstPage bool + done bool +} + +// NewListResourcesForTagOptionPaginator returns a new +// ListResourcesForTagOptionPaginator +func NewListResourcesForTagOptionPaginator(client ListResourcesForTagOptionAPIClient, params *ListResourcesForTagOptionInput, optFns ...func(*ListResourcesForTagOptionPaginatorOptions)) *ListResourcesForTagOptionPaginator { + options := ListResourcesForTagOptionPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListResourcesForTagOptionPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListResourcesForTagOptionPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListResourcesForTagOption page. +func (p *ListResourcesForTagOptionPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListResourcesForTagOptionOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PageToken = p.nextToken + params.PageSize = p.options.Limit + result, err := p.client.ListResourcesForTagOption(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.PageToken + if p.options.StopOnDuplicateToken && params.PageToken != nil && p.nextToken != nil && *params.PageToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListServiceActionsForProvisioningArtifactAPIClient is a client that implements +// the ListServiceActionsForProvisioningArtifact operation. +type ListServiceActionsForProvisioningArtifactAPIClient interface { + ListServiceActionsForProvisioningArtifact(context.Context, *ListServiceActionsForProvisioningArtifactInput, ...func(*Options)) (*ListServiceActionsForProvisioningArtifactOutput, error) +} + +var _ ListServiceActionsForProvisioningArtifactAPIClient = (*Client)(nil) + +// ListServiceActionsForProvisioningArtifactPaginatorOptions is the paginator +// options for ListServiceActionsForProvisioningArtifact +type ListServiceActionsForProvisioningArtifactPaginatorOptions struct { + // The maximum number of items to return with this call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListServiceActionsForProvisioningArtifactPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicecatalog.ListServiceActionsForProvisioningArtifact +type ListServiceActionsForProvisioningArtifactPaginator struct { + options ListServiceActionsForProvisioningArtifactPaginatorOptions + client ListServiceActionsForProvisioningArtifactAPIClient + params *ListServiceActionsForProvisioningArtifactInput + nextToken *string + firstPage bool + done bool +} + +// NewListServiceActionsForProvisioningArtifactPaginator returns a new +// ListServiceActionsForProvisioningArtifactPaginator +func NewListServiceActionsForProvisioningArtifactPaginator(client ListServiceActionsForProvisioningArtifactAPIClient, params *ListServiceActionsForProvisioningArtifactInput, optFns ...func(*ListServiceActionsForProvisioningArtifactPaginatorOptions)) *ListServiceActionsForProvisioningArtifactPaginator { + options := ListServiceActionsForProvisioningArtifactPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListServiceActionsForProvisioningArtifactPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListServiceActionsForProvisioningArtifactPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListServiceActionsForProvisioningArtifact page. +func (p *ListServiceActionsForProvisioningArtifactPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListServiceActionsForProvisioningArtifactOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PageToken = p.nextToken + params.PageSize = p.options.Limit + result, err := p.client.ListServiceActionsForProvisioningArtifact(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && params.PageToken != nil && p.nextToken != nil && *params.PageToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListLaunchPathsAPIClient is a client that implements the ListLaunchPaths +// operation. +type ListLaunchPathsAPIClient interface { + ListLaunchPaths(context.Context, *ListLaunchPathsInput, ...func(*Options)) (*ListLaunchPathsOutput, error) +} + +var _ ListLaunchPathsAPIClient = (*Client)(nil) + +// ListLaunchPathsPaginatorOptions is the paginator options for ListLaunchPaths +type ListLaunchPathsPaginatorOptions struct { + // The maximum number of items to return with this call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListLaunchPathsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicecatalog.ListLaunchPaths +type ListLaunchPathsPaginator struct { + options ListLaunchPathsPaginatorOptions + client ListLaunchPathsAPIClient + params *ListLaunchPathsInput + nextToken *string + firstPage bool + done bool +} + +// NewListLaunchPathsPaginator returns a new ListLaunchPathsPaginator +func NewListLaunchPathsPaginator(client ListLaunchPathsAPIClient, params *ListLaunchPathsInput, optFns ...func(*ListLaunchPathsPaginatorOptions)) *ListLaunchPathsPaginator { + options := ListLaunchPathsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListLaunchPathsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListLaunchPathsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListLaunchPaths page. +func (p *ListLaunchPathsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListLaunchPathsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PageToken = p.nextToken + params.PageSize = p.options.Limit + result, err := p.client.ListLaunchPaths(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && params.PageToken != nil && p.nextToken != nil && *params.PageToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTagOptionsAPIClient is a client that implements the ListTagOptions +// operation. +type ListTagOptionsAPIClient interface { + ListTagOptions(context.Context, *ListTagOptionsInput, ...func(*Options)) (*ListTagOptionsOutput, error) +} + +var _ ListTagOptionsAPIClient = (*Client)(nil) + +// ListTagOptionsPaginatorOptions is the paginator options for ListTagOptions +type ListTagOptionsPaginatorOptions struct { + // The maximum number of items to return with this call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTagOptionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicecatalog.ListTagOptions +type ListTagOptionsPaginator struct { + options ListTagOptionsPaginatorOptions + client ListTagOptionsAPIClient + params *ListTagOptionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListTagOptionsPaginator returns a new ListTagOptionsPaginator +func NewListTagOptionsPaginator(client ListTagOptionsAPIClient, params *ListTagOptionsInput, optFns ...func(*ListTagOptionsPaginatorOptions)) *ListTagOptionsPaginator { + options := ListTagOptionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTagOptionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTagOptionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTagOptions page. +func (p *ListTagOptionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTagOptionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PageToken = p.nextToken + params.PageSize = p.options.Limit + result, err := p.client.ListTagOptions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.PageToken + if p.options.StopOnDuplicateToken && params.PageToken != nil && p.nextToken != nil && *params.PageToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListServiceActionsAPIClient is a client that implements the ListServiceActions +// operation. +type ListServiceActionsAPIClient interface { + ListServiceActions(context.Context, *ListServiceActionsInput, ...func(*Options)) (*ListServiceActionsOutput, error) +} + +var _ ListServiceActionsAPIClient = (*Client)(nil) + +// ListServiceActionsPaginatorOptions is the paginator options for +// ListServiceActions +type ListServiceActionsPaginatorOptions struct { + // The maximum number of items to return with this call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListServiceActionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicecatalog.ListServiceActions +type ListServiceActionsPaginator struct { + options ListServiceActionsPaginatorOptions + client ListServiceActionsAPIClient + params *ListServiceActionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListServiceActionsPaginator returns a new ListServiceActionsPaginator +func NewListServiceActionsPaginator(client ListServiceActionsAPIClient, params *ListServiceActionsInput, optFns ...func(*ListServiceActionsPaginatorOptions)) *ListServiceActionsPaginator { + options := ListServiceActionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListServiceActionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListServiceActionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListServiceActions page. +func (p *ListServiceActionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListServiceActionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PageToken = p.nextToken + params.PageSize = p.options.Limit + result, err := p.client.ListServiceActions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && params.PageToken != nil && p.nextToken != nil && *params.PageToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListOrganizationPortfolioAccessAPIClient is a client that implements the +// ListOrganizationPortfolioAccess operation. +type ListOrganizationPortfolioAccessAPIClient interface { + ListOrganizationPortfolioAccess(context.Context, *ListOrganizationPortfolioAccessInput, ...func(*Options)) (*ListOrganizationPortfolioAccessOutput, error) +} + +var _ ListOrganizationPortfolioAccessAPIClient = (*Client)(nil) + +// ListOrganizationPortfolioAccessPaginatorOptions is the paginator options for +// ListOrganizationPortfolioAccess +type ListOrganizationPortfolioAccessPaginatorOptions struct { + // The maximum number of items to return with this call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListOrganizationPortfolioAccessPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicecatalog.ListOrganizationPortfolioAccess +type ListOrganizationPortfolioAccessPaginator struct { + options ListOrganizationPortfolioAccessPaginatorOptions + client ListOrganizationPortfolioAccessAPIClient + params *ListOrganizationPortfolioAccessInput + nextToken *string + firstPage bool + done bool +} + +// NewListOrganizationPortfolioAccessPaginator returns a new +// ListOrganizationPortfolioAccessPaginator +func NewListOrganizationPortfolioAccessPaginator(client ListOrganizationPortfolioAccessAPIClient, params *ListOrganizationPortfolioAccessInput, optFns ...func(*ListOrganizationPortfolioAccessPaginatorOptions)) *ListOrganizationPortfolioAccessPaginator { + options := ListOrganizationPortfolioAccessPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListOrganizationPortfolioAccessPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListOrganizationPortfolioAccessPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListOrganizationPortfolioAccess page. +func (p *ListOrganizationPortfolioAccessPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListOrganizationPortfolioAccessOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PageToken = p.nextToken + params.PageSize = p.options.Limit + result, err := p.client.ListOrganizationPortfolioAccess(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && params.PageToken != nil && p.nextToken != nil && *params.PageToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// SearchProductsAsAdminAPIClient is a client that implements the +// SearchProductsAsAdmin operation. +type SearchProductsAsAdminAPIClient interface { + SearchProductsAsAdmin(context.Context, *SearchProductsAsAdminInput, ...func(*Options)) (*SearchProductsAsAdminOutput, error) +} + +var _ SearchProductsAsAdminAPIClient = (*Client)(nil) + +// SearchProductsAsAdminPaginatorOptions is the paginator options for +// SearchProductsAsAdmin +type SearchProductsAsAdminPaginatorOptions struct { + // The maximum number of items to return with this call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// SearchProductsAsAdminPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicecatalog.SearchProductsAsAdmin +type SearchProductsAsAdminPaginator struct { + options SearchProductsAsAdminPaginatorOptions + client SearchProductsAsAdminAPIClient + params *SearchProductsAsAdminInput + nextToken *string + firstPage bool + done bool +} + +// NewSearchProductsAsAdminPaginator returns a new SearchProductsAsAdminPaginator +func NewSearchProductsAsAdminPaginator(client SearchProductsAsAdminAPIClient, params *SearchProductsAsAdminInput, optFns ...func(*SearchProductsAsAdminPaginatorOptions)) *SearchProductsAsAdminPaginator { + options := SearchProductsAsAdminPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &SearchProductsAsAdminPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchProductsAsAdminPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next SearchProductsAsAdmin page. +func (p *SearchProductsAsAdminPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchProductsAsAdminOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PageToken = p.nextToken + params.PageSize = p.options.Limit + result, err := p.client.SearchProductsAsAdmin(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && params.PageToken != nil && p.nextToken != nil && *params.PageToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListAcceptedPortfolioSharesAPIClient is a client that implements the +// ListAcceptedPortfolioShares operation. +type ListAcceptedPortfolioSharesAPIClient interface { + ListAcceptedPortfolioShares(context.Context, *ListAcceptedPortfolioSharesInput, ...func(*Options)) (*ListAcceptedPortfolioSharesOutput, error) +} + +var _ ListAcceptedPortfolioSharesAPIClient = (*Client)(nil) + +// ListAcceptedPortfolioSharesPaginatorOptions is the paginator options for +// ListAcceptedPortfolioShares +type ListAcceptedPortfolioSharesPaginatorOptions struct { + // The maximum number of items to return with this call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAcceptedPortfolioSharesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicecatalog.ListAcceptedPortfolioShares +type ListAcceptedPortfolioSharesPaginator struct { + options ListAcceptedPortfolioSharesPaginatorOptions + client ListAcceptedPortfolioSharesAPIClient + params *ListAcceptedPortfolioSharesInput + nextToken *string + firstPage bool + done bool +} + +// NewListAcceptedPortfolioSharesPaginator returns a new +// ListAcceptedPortfolioSharesPaginator +func NewListAcceptedPortfolioSharesPaginator(client ListAcceptedPortfolioSharesAPIClient, params *ListAcceptedPortfolioSharesInput, optFns ...func(*ListAcceptedPortfolioSharesPaginatorOptions)) *ListAcceptedPortfolioSharesPaginator { + options := ListAcceptedPortfolioSharesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAcceptedPortfolioSharesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAcceptedPortfolioSharesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAcceptedPortfolioShares page. +func (p *ListAcceptedPortfolioSharesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAcceptedPortfolioSharesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PageToken = p.nextToken + params.PageSize = p.options.Limit + result, err := p.client.ListAcceptedPortfolioShares(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && params.PageToken != nil && p.nextToken != nil && *params.PageToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListProvisioningArtifactsForServiceActionAPIClient is a client that implements +// the ListProvisioningArtifactsForServiceAction operation. +type ListProvisioningArtifactsForServiceActionAPIClient interface { + ListProvisioningArtifactsForServiceAction(context.Context, *ListProvisioningArtifactsForServiceActionInput, ...func(*Options)) (*ListProvisioningArtifactsForServiceActionOutput, error) +} + +var _ ListProvisioningArtifactsForServiceActionAPIClient = (*Client)(nil) + +// ListProvisioningArtifactsForServiceActionPaginatorOptions is the paginator +// options for ListProvisioningArtifactsForServiceAction +type ListProvisioningArtifactsForServiceActionPaginatorOptions struct { + // The maximum number of items to return with this call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListProvisioningArtifactsForServiceActionPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicecatalog.ListProvisioningArtifactsForServiceAction +type ListProvisioningArtifactsForServiceActionPaginator struct { + options ListProvisioningArtifactsForServiceActionPaginatorOptions + client ListProvisioningArtifactsForServiceActionAPIClient + params *ListProvisioningArtifactsForServiceActionInput + nextToken *string + firstPage bool + done bool +} + +// NewListProvisioningArtifactsForServiceActionPaginator returns a new +// ListProvisioningArtifactsForServiceActionPaginator +func NewListProvisioningArtifactsForServiceActionPaginator(client ListProvisioningArtifactsForServiceActionAPIClient, params *ListProvisioningArtifactsForServiceActionInput, optFns ...func(*ListProvisioningArtifactsForServiceActionPaginatorOptions)) *ListProvisioningArtifactsForServiceActionPaginator { + options := ListProvisioningArtifactsForServiceActionPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListProvisioningArtifactsForServiceActionPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListProvisioningArtifactsForServiceActionPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListProvisioningArtifactsForServiceAction page. +func (p *ListProvisioningArtifactsForServiceActionPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProvisioningArtifactsForServiceActionOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PageToken = p.nextToken + params.PageSize = p.options.Limit + result, err := p.client.ListProvisioningArtifactsForServiceAction(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && params.PageToken != nil && p.nextToken != nil && *params.PageToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListPrincipalsForPortfolioAPIClient is a client that implements the +// ListPrincipalsForPortfolio operation. +type ListPrincipalsForPortfolioAPIClient interface { + ListPrincipalsForPortfolio(context.Context, *ListPrincipalsForPortfolioInput, ...func(*Options)) (*ListPrincipalsForPortfolioOutput, error) +} + +var _ ListPrincipalsForPortfolioAPIClient = (*Client)(nil) + +// ListPrincipalsForPortfolioPaginatorOptions is the paginator options for +// ListPrincipalsForPortfolio +type ListPrincipalsForPortfolioPaginatorOptions struct { + // The maximum number of items to return with this call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListPrincipalsForPortfolioPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicecatalog.ListPrincipalsForPortfolio +type ListPrincipalsForPortfolioPaginator struct { + options ListPrincipalsForPortfolioPaginatorOptions + client ListPrincipalsForPortfolioAPIClient + params *ListPrincipalsForPortfolioInput + nextToken *string + firstPage bool + done bool +} + +// NewListPrincipalsForPortfolioPaginator returns a new +// ListPrincipalsForPortfolioPaginator +func NewListPrincipalsForPortfolioPaginator(client ListPrincipalsForPortfolioAPIClient, params *ListPrincipalsForPortfolioInput, optFns ...func(*ListPrincipalsForPortfolioPaginatorOptions)) *ListPrincipalsForPortfolioPaginator { + options := ListPrincipalsForPortfolioPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListPrincipalsForPortfolioPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPrincipalsForPortfolioPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListPrincipalsForPortfolio page. +func (p *ListPrincipalsForPortfolioPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPrincipalsForPortfolioOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PageToken = p.nextToken + params.PageSize = p.options.Limit + result, err := p.client.ListPrincipalsForPortfolio(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && params.PageToken != nil && p.nextToken != nil && *params.PageToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListConstraintsForPortfolioAPIClient is a client that implements the +// ListConstraintsForPortfolio operation. +type ListConstraintsForPortfolioAPIClient interface { + ListConstraintsForPortfolio(context.Context, *ListConstraintsForPortfolioInput, ...func(*Options)) (*ListConstraintsForPortfolioOutput, error) +} + +var _ ListConstraintsForPortfolioAPIClient = (*Client)(nil) + +// ListConstraintsForPortfolioPaginatorOptions is the paginator options for +// ListConstraintsForPortfolio +type ListConstraintsForPortfolioPaginatorOptions struct { + // The maximum number of items to return with this call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListConstraintsForPortfolioPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicecatalog.ListConstraintsForPortfolio +type ListConstraintsForPortfolioPaginator struct { + options ListConstraintsForPortfolioPaginatorOptions + client ListConstraintsForPortfolioAPIClient + params *ListConstraintsForPortfolioInput + nextToken *string + firstPage bool + done bool +} + +// NewListConstraintsForPortfolioPaginator returns a new +// ListConstraintsForPortfolioPaginator +func NewListConstraintsForPortfolioPaginator(client ListConstraintsForPortfolioAPIClient, params *ListConstraintsForPortfolioInput, optFns ...func(*ListConstraintsForPortfolioPaginatorOptions)) *ListConstraintsForPortfolioPaginator { + options := ListConstraintsForPortfolioPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListConstraintsForPortfolioPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListConstraintsForPortfolioPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListConstraintsForPortfolio page. +func (p *ListConstraintsForPortfolioPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListConstraintsForPortfolioOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PageToken = p.nextToken + params.PageSize = p.options.Limit + result, err := p.client.ListConstraintsForPortfolio(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && params.PageToken != nil && p.nextToken != nil && *params.PageToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// SearchProductsAPIClient is a client that implements the SearchProducts +// operation. +type SearchProductsAPIClient interface { + SearchProducts(context.Context, *SearchProductsInput, ...func(*Options)) (*SearchProductsOutput, error) +} + +var _ SearchProductsAPIClient = (*Client)(nil) + +// SearchProductsPaginatorOptions is the paginator options for SearchProducts +type SearchProductsPaginatorOptions struct { + // The maximum number of items to return with this call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// SearchProductsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicecatalog.SearchProducts +type SearchProductsPaginator struct { + options SearchProductsPaginatorOptions + client SearchProductsAPIClient + params *SearchProductsInput + nextToken *string + firstPage bool + done bool +} + +// NewSearchProductsPaginator returns a new SearchProductsPaginator +func NewSearchProductsPaginator(client SearchProductsAPIClient, params *SearchProductsInput, optFns ...func(*SearchProductsPaginatorOptions)) *SearchProductsPaginator { + options := SearchProductsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &SearchProductsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchProductsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next SearchProducts page. +func (p *SearchProductsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchProductsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PageToken = p.nextToken + params.PageSize = p.options.Limit + result, err := p.client.SearchProducts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && params.PageToken != nil && p.nextToken != nil && *params.PageToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListPortfoliosAPIClient is a client that implements the ListPortfolios +// operation. +type ListPortfoliosAPIClient interface { + ListPortfolios(context.Context, *ListPortfoliosInput, ...func(*Options)) (*ListPortfoliosOutput, error) +} + +var _ ListPortfoliosAPIClient = (*Client)(nil) + +// ListPortfoliosPaginatorOptions is the paginator options for ListPortfolios +type ListPortfoliosPaginatorOptions struct { + // The maximum number of items to return with this call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListPortfoliosPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicecatalog.ListPortfolios +type ListPortfoliosPaginator struct { + options ListPortfoliosPaginatorOptions + client ListPortfoliosAPIClient + params *ListPortfoliosInput + nextToken *string + firstPage bool + done bool +} + +// NewListPortfoliosPaginator returns a new ListPortfoliosPaginator +func NewListPortfoliosPaginator(client ListPortfoliosAPIClient, params *ListPortfoliosInput, optFns ...func(*ListPortfoliosPaginatorOptions)) *ListPortfoliosPaginator { + options := ListPortfoliosPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListPortfoliosPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPortfoliosPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListPortfolios page. +func (p *ListPortfoliosPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPortfoliosOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PageToken = p.nextToken + params.PageSize = p.options.Limit + result, err := p.client.ListPortfolios(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && params.PageToken != nil && p.nextToken != nil && *params.PageToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/servicediscovery/go.sum b/service/servicediscovery/go.sum index c669e324b14..32595049f96 100644 --- a/service/servicediscovery/go.sum +++ b/service/servicediscovery/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/servicediscovery/paginators.go b/service/servicediscovery/paginators.go new file mode 100644 index 00000000000..fcf7c24722c --- /dev/null +++ b/service/servicediscovery/paginators.go @@ -0,0 +1,393 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package servicediscovery + +import ( + "context" + "fmt" +) + +// GetInstancesHealthStatusAPIClient is a client that implements the +// GetInstancesHealthStatus operation. +type GetInstancesHealthStatusAPIClient interface { + GetInstancesHealthStatus(context.Context, *GetInstancesHealthStatusInput, ...func(*Options)) (*GetInstancesHealthStatusOutput, error) +} + +var _ GetInstancesHealthStatusAPIClient = (*Client)(nil) + +// GetInstancesHealthStatusPaginatorOptions is the paginator options for +// GetInstancesHealthStatus +type GetInstancesHealthStatusPaginatorOptions struct { + // The maximum number of instances that you want AWS Cloud Map to return in the + // response to a GetInstancesHealthStatus request. If you don't specify a value for + // MaxResults, AWS Cloud Map returns up to 100 instances. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetInstancesHealthStatusPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicediscovery.GetInstancesHealthStatus +type GetInstancesHealthStatusPaginator struct { + options GetInstancesHealthStatusPaginatorOptions + client GetInstancesHealthStatusAPIClient + params *GetInstancesHealthStatusInput + nextToken *string + firstPage bool + done bool +} + +// NewGetInstancesHealthStatusPaginator returns a new +// GetInstancesHealthStatusPaginator +func NewGetInstancesHealthStatusPaginator(client GetInstancesHealthStatusAPIClient, params *GetInstancesHealthStatusInput, optFns ...func(*GetInstancesHealthStatusPaginatorOptions)) *GetInstancesHealthStatusPaginator { + options := GetInstancesHealthStatusPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetInstancesHealthStatusPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetInstancesHealthStatusPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetInstancesHealthStatus page. +func (p *GetInstancesHealthStatusPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetInstancesHealthStatusOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetInstancesHealthStatus(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListInstancesAPIClient is a client that implements the ListInstances operation. +type ListInstancesAPIClient interface { + ListInstances(context.Context, *ListInstancesInput, ...func(*Options)) (*ListInstancesOutput, error) +} + +var _ ListInstancesAPIClient = (*Client)(nil) + +// ListInstancesPaginatorOptions is the paginator options for ListInstances +type ListInstancesPaginatorOptions struct { + // The maximum number of instances that you want AWS Cloud Map to return in the + // response to a ListInstances request. If you don't specify a value for + // MaxResults, AWS Cloud Map returns up to 100 instances. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListInstancesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicediscovery.ListInstances +type ListInstancesPaginator struct { + options ListInstancesPaginatorOptions + client ListInstancesAPIClient + params *ListInstancesInput + nextToken *string + firstPage bool + done bool +} + +// NewListInstancesPaginator returns a new ListInstancesPaginator +func NewListInstancesPaginator(client ListInstancesAPIClient, params *ListInstancesInput, optFns ...func(*ListInstancesPaginatorOptions)) *ListInstancesPaginator { + options := ListInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListInstancesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListInstancesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListInstances page. +func (p *ListInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListInstancesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListInstances(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListServicesAPIClient is a client that implements the ListServices operation. +type ListServicesAPIClient interface { + ListServices(context.Context, *ListServicesInput, ...func(*Options)) (*ListServicesOutput, error) +} + +var _ ListServicesAPIClient = (*Client)(nil) + +// ListServicesPaginatorOptions is the paginator options for ListServices +type ListServicesPaginatorOptions struct { + // The maximum number of services that you want AWS Cloud Map to return in the + // response to a ListServices request. If you don't specify a value for MaxResults, + // AWS Cloud Map returns up to 100 services. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListServicesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicediscovery.ListServices +type ListServicesPaginator struct { + options ListServicesPaginatorOptions + client ListServicesAPIClient + params *ListServicesInput + nextToken *string + firstPage bool + done bool +} + +// NewListServicesPaginator returns a new ListServicesPaginator +func NewListServicesPaginator(client ListServicesAPIClient, params *ListServicesInput, optFns ...func(*ListServicesPaginatorOptions)) *ListServicesPaginator { + options := ListServicesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListServicesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListServicesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListServices page. +func (p *ListServicesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListServicesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListServices(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListOperationsAPIClient is a client that implements the ListOperations +// operation. +type ListOperationsAPIClient interface { + ListOperations(context.Context, *ListOperationsInput, ...func(*Options)) (*ListOperationsOutput, error) +} + +var _ ListOperationsAPIClient = (*Client)(nil) + +// ListOperationsPaginatorOptions is the paginator options for ListOperations +type ListOperationsPaginatorOptions struct { + // The maximum number of items that you want AWS Cloud Map to return in the + // response to a ListOperations request. If you don't specify a value for + // MaxResults, AWS Cloud Map returns up to 100 operations. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListOperationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicediscovery.ListOperations +type ListOperationsPaginator struct { + options ListOperationsPaginatorOptions + client ListOperationsAPIClient + params *ListOperationsInput + nextToken *string + firstPage bool + done bool +} + +// NewListOperationsPaginator returns a new ListOperationsPaginator +func NewListOperationsPaginator(client ListOperationsAPIClient, params *ListOperationsInput, optFns ...func(*ListOperationsPaginatorOptions)) *ListOperationsPaginator { + options := ListOperationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListOperationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListOperationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListOperations page. +func (p *ListOperationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListOperationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListOperations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListNamespacesAPIClient is a client that implements the ListNamespaces +// operation. +type ListNamespacesAPIClient interface { + ListNamespaces(context.Context, *ListNamespacesInput, ...func(*Options)) (*ListNamespacesOutput, error) +} + +var _ ListNamespacesAPIClient = (*Client)(nil) + +// ListNamespacesPaginatorOptions is the paginator options for ListNamespaces +type ListNamespacesPaginatorOptions struct { + // The maximum number of namespaces that you want AWS Cloud Map to return in the + // response to a ListNamespaces request. If you don't specify a value for + // MaxResults, AWS Cloud Map returns up to 100 namespaces. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListNamespacesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicediscovery.ListNamespaces +type ListNamespacesPaginator struct { + options ListNamespacesPaginatorOptions + client ListNamespacesAPIClient + params *ListNamespacesInput + nextToken *string + firstPage bool + done bool +} + +// NewListNamespacesPaginator returns a new ListNamespacesPaginator +func NewListNamespacesPaginator(client ListNamespacesAPIClient, params *ListNamespacesInput, optFns ...func(*ListNamespacesPaginatorOptions)) *ListNamespacesPaginator { + options := ListNamespacesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListNamespacesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListNamespacesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListNamespaces page. +func (p *ListNamespacesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListNamespacesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListNamespaces(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/servicequotas/go.sum b/service/servicequotas/go.sum index c669e324b14..32595049f96 100644 --- a/service/servicequotas/go.sum +++ b/service/servicequotas/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/servicequotas/paginators.go b/service/servicequotas/paginators.go new file mode 100644 index 00000000000..9baf7128db0 --- /dev/null +++ b/service/servicequotas/paginators.go @@ -0,0 +1,501 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package servicequotas + +import ( + "context" + "fmt" +) + +// ListServiceQuotaIncreaseRequestsInTemplateAPIClient is a client that implements +// the ListServiceQuotaIncreaseRequestsInTemplate operation. +type ListServiceQuotaIncreaseRequestsInTemplateAPIClient interface { + ListServiceQuotaIncreaseRequestsInTemplate(context.Context, *ListServiceQuotaIncreaseRequestsInTemplateInput, ...func(*Options)) (*ListServiceQuotaIncreaseRequestsInTemplateOutput, error) +} + +var _ ListServiceQuotaIncreaseRequestsInTemplateAPIClient = (*Client)(nil) + +// ListServiceQuotaIncreaseRequestsInTemplatePaginatorOptions is the paginator +// options for ListServiceQuotaIncreaseRequestsInTemplate +type ListServiceQuotaIncreaseRequestsInTemplatePaginatorOptions struct { + // (Optional) Limits the number of results that you want to include in the + // response. If you don't include this parameter, the response defaults to a value + // that's specific to the operation. If additional items exist beyond the specified + // maximum, the NextToken element is present and has a value (isn't null). Include + // that value as the NextToken request parameter in the call to the operation to + // get the next part of the results. You should check NextToken after every + // operation to ensure that you receive all of the results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListServiceQuotaIncreaseRequestsInTemplatePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicequotas.ListServiceQuotaIncreaseRequestsInTemplate +type ListServiceQuotaIncreaseRequestsInTemplatePaginator struct { + options ListServiceQuotaIncreaseRequestsInTemplatePaginatorOptions + client ListServiceQuotaIncreaseRequestsInTemplateAPIClient + params *ListServiceQuotaIncreaseRequestsInTemplateInput + nextToken *string + firstPage bool + done bool +} + +// NewListServiceQuotaIncreaseRequestsInTemplatePaginator returns a new +// ListServiceQuotaIncreaseRequestsInTemplatePaginator +func NewListServiceQuotaIncreaseRequestsInTemplatePaginator(client ListServiceQuotaIncreaseRequestsInTemplateAPIClient, params *ListServiceQuotaIncreaseRequestsInTemplateInput, optFns ...func(*ListServiceQuotaIncreaseRequestsInTemplatePaginatorOptions)) *ListServiceQuotaIncreaseRequestsInTemplatePaginator { + options := ListServiceQuotaIncreaseRequestsInTemplatePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListServiceQuotaIncreaseRequestsInTemplatePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListServiceQuotaIncreaseRequestsInTemplatePaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListServiceQuotaIncreaseRequestsInTemplate page. +func (p *ListServiceQuotaIncreaseRequestsInTemplatePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListServiceQuotaIncreaseRequestsInTemplateOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListServiceQuotaIncreaseRequestsInTemplate(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListAWSDefaultServiceQuotasAPIClient is a client that implements the +// ListAWSDefaultServiceQuotas operation. +type ListAWSDefaultServiceQuotasAPIClient interface { + ListAWSDefaultServiceQuotas(context.Context, *ListAWSDefaultServiceQuotasInput, ...func(*Options)) (*ListAWSDefaultServiceQuotasOutput, error) +} + +var _ ListAWSDefaultServiceQuotasAPIClient = (*Client)(nil) + +// ListAWSDefaultServiceQuotasPaginatorOptions is the paginator options for +// ListAWSDefaultServiceQuotas +type ListAWSDefaultServiceQuotasPaginatorOptions struct { + // (Optional) Limits the number of results that you want to include in the + // response. If you don't include this parameter, the response defaults to a value + // that's specific to the operation. If additional items exist beyond the specified + // maximum, the NextToken element is present and has a value (isn't null). Include + // that value as the NextToken request parameter in the call to the operation to + // get the next part of the results. You should check NextToken after every + // operation to ensure that you receive all of the results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAWSDefaultServiceQuotasPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicequotas.ListAWSDefaultServiceQuotas +type ListAWSDefaultServiceQuotasPaginator struct { + options ListAWSDefaultServiceQuotasPaginatorOptions + client ListAWSDefaultServiceQuotasAPIClient + params *ListAWSDefaultServiceQuotasInput + nextToken *string + firstPage bool + done bool +} + +// NewListAWSDefaultServiceQuotasPaginator returns a new +// ListAWSDefaultServiceQuotasPaginator +func NewListAWSDefaultServiceQuotasPaginator(client ListAWSDefaultServiceQuotasAPIClient, params *ListAWSDefaultServiceQuotasInput, optFns ...func(*ListAWSDefaultServiceQuotasPaginatorOptions)) *ListAWSDefaultServiceQuotasPaginator { + options := ListAWSDefaultServiceQuotasPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAWSDefaultServiceQuotasPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAWSDefaultServiceQuotasPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAWSDefaultServiceQuotas page. +func (p *ListAWSDefaultServiceQuotasPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAWSDefaultServiceQuotasOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListAWSDefaultServiceQuotas(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListRequestedServiceQuotaChangeHistoryAPIClient is a client that implements the +// ListRequestedServiceQuotaChangeHistory operation. +type ListRequestedServiceQuotaChangeHistoryAPIClient interface { + ListRequestedServiceQuotaChangeHistory(context.Context, *ListRequestedServiceQuotaChangeHistoryInput, ...func(*Options)) (*ListRequestedServiceQuotaChangeHistoryOutput, error) +} + +var _ ListRequestedServiceQuotaChangeHistoryAPIClient = (*Client)(nil) + +// ListRequestedServiceQuotaChangeHistoryPaginatorOptions is the paginator options +// for ListRequestedServiceQuotaChangeHistory +type ListRequestedServiceQuotaChangeHistoryPaginatorOptions struct { + // (Optional) Limits the number of results that you want to include in the + // response. If you don't include this parameter, the response defaults to a value + // that's specific to the operation. If additional items exist beyond the specified + // maximum, the NextToken element is present and has a value (isn't null). Include + // that value as the NextToken request parameter in the call to the operation to + // get the next part of the results. You should check NextToken after every + // operation to ensure that you receive all of the results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListRequestedServiceQuotaChangeHistoryPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicequotas.ListRequestedServiceQuotaChangeHistory +type ListRequestedServiceQuotaChangeHistoryPaginator struct { + options ListRequestedServiceQuotaChangeHistoryPaginatorOptions + client ListRequestedServiceQuotaChangeHistoryAPIClient + params *ListRequestedServiceQuotaChangeHistoryInput + nextToken *string + firstPage bool + done bool +} + +// NewListRequestedServiceQuotaChangeHistoryPaginator returns a new +// ListRequestedServiceQuotaChangeHistoryPaginator +func NewListRequestedServiceQuotaChangeHistoryPaginator(client ListRequestedServiceQuotaChangeHistoryAPIClient, params *ListRequestedServiceQuotaChangeHistoryInput, optFns ...func(*ListRequestedServiceQuotaChangeHistoryPaginatorOptions)) *ListRequestedServiceQuotaChangeHistoryPaginator { + options := ListRequestedServiceQuotaChangeHistoryPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListRequestedServiceQuotaChangeHistoryPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRequestedServiceQuotaChangeHistoryPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListRequestedServiceQuotaChangeHistory page. +func (p *ListRequestedServiceQuotaChangeHistoryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRequestedServiceQuotaChangeHistoryOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListRequestedServiceQuotaChangeHistory(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListServicesAPIClient is a client that implements the ListServices operation. +type ListServicesAPIClient interface { + ListServices(context.Context, *ListServicesInput, ...func(*Options)) (*ListServicesOutput, error) +} + +var _ ListServicesAPIClient = (*Client)(nil) + +// ListServicesPaginatorOptions is the paginator options for ListServices +type ListServicesPaginatorOptions struct { + // (Optional) Limits the number of results that you want to include in the + // response. If you don't include this parameter, the response defaults to a value + // that's specific to the operation. If additional items exist beyond the specified + // maximum, the NextToken element is present and has a value (isn't null). Include + // that value as the NextToken request parameter in the call to the operation to + // get the next part of the results. You should check NextToken after every + // operation to ensure that you receive all of the results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListServicesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicequotas.ListServices +type ListServicesPaginator struct { + options ListServicesPaginatorOptions + client ListServicesAPIClient + params *ListServicesInput + nextToken *string + firstPage bool + done bool +} + +// NewListServicesPaginator returns a new ListServicesPaginator +func NewListServicesPaginator(client ListServicesAPIClient, params *ListServicesInput, optFns ...func(*ListServicesPaginatorOptions)) *ListServicesPaginator { + options := ListServicesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListServicesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListServicesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListServices page. +func (p *ListServicesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListServicesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListServices(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListRequestedServiceQuotaChangeHistoryByQuotaAPIClient is a client that +// implements the ListRequestedServiceQuotaChangeHistoryByQuota operation. +type ListRequestedServiceQuotaChangeHistoryByQuotaAPIClient interface { + ListRequestedServiceQuotaChangeHistoryByQuota(context.Context, *ListRequestedServiceQuotaChangeHistoryByQuotaInput, ...func(*Options)) (*ListRequestedServiceQuotaChangeHistoryByQuotaOutput, error) +} + +var _ ListRequestedServiceQuotaChangeHistoryByQuotaAPIClient = (*Client)(nil) + +// ListRequestedServiceQuotaChangeHistoryByQuotaPaginatorOptions is the paginator +// options for ListRequestedServiceQuotaChangeHistoryByQuota +type ListRequestedServiceQuotaChangeHistoryByQuotaPaginatorOptions struct { + // (Optional) Limits the number of results that you want to include in the + // response. If you don't include this parameter, the response defaults to a value + // that's specific to the operation. If additional items exist beyond the specified + // maximum, the NextToken element is present and has a value (isn't null). Include + // that value as the NextToken request parameter in the call to the operation to + // get the next part of the results. You should check NextToken after every + // operation to ensure that you receive all of the results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListRequestedServiceQuotaChangeHistoryByQuotaPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicequotas.ListRequestedServiceQuotaChangeHistoryByQuota +type ListRequestedServiceQuotaChangeHistoryByQuotaPaginator struct { + options ListRequestedServiceQuotaChangeHistoryByQuotaPaginatorOptions + client ListRequestedServiceQuotaChangeHistoryByQuotaAPIClient + params *ListRequestedServiceQuotaChangeHistoryByQuotaInput + nextToken *string + firstPage bool + done bool +} + +// NewListRequestedServiceQuotaChangeHistoryByQuotaPaginator returns a new +// ListRequestedServiceQuotaChangeHistoryByQuotaPaginator +func NewListRequestedServiceQuotaChangeHistoryByQuotaPaginator(client ListRequestedServiceQuotaChangeHistoryByQuotaAPIClient, params *ListRequestedServiceQuotaChangeHistoryByQuotaInput, optFns ...func(*ListRequestedServiceQuotaChangeHistoryByQuotaPaginatorOptions)) *ListRequestedServiceQuotaChangeHistoryByQuotaPaginator { + options := ListRequestedServiceQuotaChangeHistoryByQuotaPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListRequestedServiceQuotaChangeHistoryByQuotaPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRequestedServiceQuotaChangeHistoryByQuotaPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListRequestedServiceQuotaChangeHistoryByQuota page. +func (p *ListRequestedServiceQuotaChangeHistoryByQuotaPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRequestedServiceQuotaChangeHistoryByQuotaOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListRequestedServiceQuotaChangeHistoryByQuota(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListServiceQuotasAPIClient is a client that implements the ListServiceQuotas +// operation. +type ListServiceQuotasAPIClient interface { + ListServiceQuotas(context.Context, *ListServiceQuotasInput, ...func(*Options)) (*ListServiceQuotasOutput, error) +} + +var _ ListServiceQuotasAPIClient = (*Client)(nil) + +// ListServiceQuotasPaginatorOptions is the paginator options for ListServiceQuotas +type ListServiceQuotasPaginatorOptions struct { + // (Optional) Limits the number of results that you want to include in the + // response. If you don't include this parameter, the response defaults to a value + // that's specific to the operation. If additional items exist beyond the specified + // maximum, the NextToken element is present and has a value (isn't null). Include + // that value as the NextToken request parameter in the call to the operation to + // get the next part of the results. You should check NextToken after every + // operation to ensure that you receive all of the results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListServiceQuotasPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicequotas.ListServiceQuotas +type ListServiceQuotasPaginator struct { + options ListServiceQuotasPaginatorOptions + client ListServiceQuotasAPIClient + params *ListServiceQuotasInput + nextToken *string + firstPage bool + done bool +} + +// NewListServiceQuotasPaginator returns a new ListServiceQuotasPaginator +func NewListServiceQuotasPaginator(client ListServiceQuotasAPIClient, params *ListServiceQuotasInput, optFns ...func(*ListServiceQuotasPaginatorOptions)) *ListServiceQuotasPaginator { + options := ListServiceQuotasPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListServiceQuotasPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListServiceQuotasPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListServiceQuotas page. +func (p *ListServiceQuotasPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListServiceQuotasOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListServiceQuotas(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/ses/go.sum b/service/ses/go.sum index c669e324b14..32595049f96 100644 --- a/service/ses/go.sum +++ b/service/ses/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/ses/paginators.go b/service/ses/paginators.go new file mode 100644 index 00000000000..cb84e61a320 --- /dev/null +++ b/service/ses/paginators.go @@ -0,0 +1,163 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "fmt" +) + +// ListIdentitiesAPIClient is a client that implements the ListIdentities +// operation. +type ListIdentitiesAPIClient interface { + ListIdentities(context.Context, *ListIdentitiesInput, ...func(*Options)) (*ListIdentitiesOutput, error) +} + +var _ ListIdentitiesAPIClient = (*Client)(nil) + +// ListIdentitiesPaginatorOptions is the paginator options for ListIdentities +type ListIdentitiesPaginatorOptions struct { + // The maximum number of identities per page. Possible values are 1-1000 inclusive. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListIdentitiesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ses.ListIdentities +type ListIdentitiesPaginator struct { + options ListIdentitiesPaginatorOptions + client ListIdentitiesAPIClient + params *ListIdentitiesInput + nextToken *string + firstPage bool + done bool +} + +// NewListIdentitiesPaginator returns a new ListIdentitiesPaginator +func NewListIdentitiesPaginator(client ListIdentitiesAPIClient, params *ListIdentitiesInput, optFns ...func(*ListIdentitiesPaginatorOptions)) *ListIdentitiesPaginator { + options := ListIdentitiesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListIdentitiesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListIdentitiesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListIdentities page. +func (p *ListIdentitiesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListIdentitiesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxItems = p.options.Limit + result, err := p.client.ListIdentities(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListCustomVerificationEmailTemplatesAPIClient is a client that implements the +// ListCustomVerificationEmailTemplates operation. +type ListCustomVerificationEmailTemplatesAPIClient interface { + ListCustomVerificationEmailTemplates(context.Context, *ListCustomVerificationEmailTemplatesInput, ...func(*Options)) (*ListCustomVerificationEmailTemplatesOutput, error) +} + +var _ ListCustomVerificationEmailTemplatesAPIClient = (*Client)(nil) + +// ListCustomVerificationEmailTemplatesPaginatorOptions is the paginator options +// for ListCustomVerificationEmailTemplates +type ListCustomVerificationEmailTemplatesPaginatorOptions struct { + // The maximum number of custom verification email templates to return. This value + // must be at least 1 and less than or equal to 50. If you do not specify a value, + // or if you specify a value less than 1 or greater than 50, the operation will + // return up to 50 results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListCustomVerificationEmailTemplatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ses.ListCustomVerificationEmailTemplates +type ListCustomVerificationEmailTemplatesPaginator struct { + options ListCustomVerificationEmailTemplatesPaginatorOptions + client ListCustomVerificationEmailTemplatesAPIClient + params *ListCustomVerificationEmailTemplatesInput + nextToken *string + firstPage bool + done bool +} + +// NewListCustomVerificationEmailTemplatesPaginator returns a new +// ListCustomVerificationEmailTemplatesPaginator +func NewListCustomVerificationEmailTemplatesPaginator(client ListCustomVerificationEmailTemplatesAPIClient, params *ListCustomVerificationEmailTemplatesInput, optFns ...func(*ListCustomVerificationEmailTemplatesPaginatorOptions)) *ListCustomVerificationEmailTemplatesPaginator { + options := ListCustomVerificationEmailTemplatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListCustomVerificationEmailTemplatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCustomVerificationEmailTemplatesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListCustomVerificationEmailTemplates page. +func (p *ListCustomVerificationEmailTemplatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCustomVerificationEmailTemplatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListCustomVerificationEmailTemplates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/sesv2/go.sum b/service/sesv2/go.sum index c669e324b14..32595049f96 100644 --- a/service/sesv2/go.sum +++ b/service/sesv2/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/sesv2/paginators.go b/service/sesv2/paginators.go new file mode 100644 index 00000000000..0c548ef4b86 --- /dev/null +++ b/service/sesv2/paginators.go @@ -0,0 +1,960 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sesv2 + +import ( + "context" + "fmt" +) + +// ListDeliverabilityTestReportsAPIClient is a client that implements the +// ListDeliverabilityTestReports operation. +type ListDeliverabilityTestReportsAPIClient interface { + ListDeliverabilityTestReports(context.Context, *ListDeliverabilityTestReportsInput, ...func(*Options)) (*ListDeliverabilityTestReportsOutput, error) +} + +var _ ListDeliverabilityTestReportsAPIClient = (*Client)(nil) + +// ListDeliverabilityTestReportsPaginatorOptions is the paginator options for +// ListDeliverabilityTestReports +type ListDeliverabilityTestReportsPaginatorOptions struct { + // The number of results to show in a single call to ListDeliverabilityTestReports. + // If the number of results is larger than the number you specified in this + // parameter, then the response includes a NextToken element, which you can use to + // obtain additional results. The value you specify has to be at least 0, and can + // be no more than 1000. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDeliverabilityTestReportsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sesv2.ListDeliverabilityTestReports +type ListDeliverabilityTestReportsPaginator struct { + options ListDeliverabilityTestReportsPaginatorOptions + client ListDeliverabilityTestReportsAPIClient + params *ListDeliverabilityTestReportsInput + nextToken *string + firstPage bool + done bool +} + +// NewListDeliverabilityTestReportsPaginator returns a new +// ListDeliverabilityTestReportsPaginator +func NewListDeliverabilityTestReportsPaginator(client ListDeliverabilityTestReportsAPIClient, params *ListDeliverabilityTestReportsInput, optFns ...func(*ListDeliverabilityTestReportsPaginatorOptions)) *ListDeliverabilityTestReportsPaginator { + options := ListDeliverabilityTestReportsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDeliverabilityTestReportsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDeliverabilityTestReportsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDeliverabilityTestReports page. +func (p *ListDeliverabilityTestReportsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDeliverabilityTestReportsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.PageSize = p.options.Limit + result, err := p.client.ListDeliverabilityTestReports(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListCustomVerificationEmailTemplatesAPIClient is a client that implements the +// ListCustomVerificationEmailTemplates operation. +type ListCustomVerificationEmailTemplatesAPIClient interface { + ListCustomVerificationEmailTemplates(context.Context, *ListCustomVerificationEmailTemplatesInput, ...func(*Options)) (*ListCustomVerificationEmailTemplatesOutput, error) +} + +var _ ListCustomVerificationEmailTemplatesAPIClient = (*Client)(nil) + +// ListCustomVerificationEmailTemplatesPaginatorOptions is the paginator options +// for ListCustomVerificationEmailTemplates +type ListCustomVerificationEmailTemplatesPaginatorOptions struct { + // The number of results to show in a single call to + // ListCustomVerificationEmailTemplates. If the number of results is larger than + // the number you specified in this parameter, then the response includes a + // NextToken element, which you can use to obtain additional results. The value you + // specify has to be at least 1, and can be no more than 50. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListCustomVerificationEmailTemplatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sesv2.ListCustomVerificationEmailTemplates +type ListCustomVerificationEmailTemplatesPaginator struct { + options ListCustomVerificationEmailTemplatesPaginatorOptions + client ListCustomVerificationEmailTemplatesAPIClient + params *ListCustomVerificationEmailTemplatesInput + nextToken *string + firstPage bool + done bool +} + +// NewListCustomVerificationEmailTemplatesPaginator returns a new +// ListCustomVerificationEmailTemplatesPaginator +func NewListCustomVerificationEmailTemplatesPaginator(client ListCustomVerificationEmailTemplatesAPIClient, params *ListCustomVerificationEmailTemplatesInput, optFns ...func(*ListCustomVerificationEmailTemplatesPaginatorOptions)) *ListCustomVerificationEmailTemplatesPaginator { + options := ListCustomVerificationEmailTemplatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListCustomVerificationEmailTemplatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCustomVerificationEmailTemplatesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListCustomVerificationEmailTemplates page. +func (p *ListCustomVerificationEmailTemplatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCustomVerificationEmailTemplatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.PageSize = p.options.Limit + result, err := p.client.ListCustomVerificationEmailTemplates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListEmailTemplatesAPIClient is a client that implements the ListEmailTemplates +// operation. +type ListEmailTemplatesAPIClient interface { + ListEmailTemplates(context.Context, *ListEmailTemplatesInput, ...func(*Options)) (*ListEmailTemplatesOutput, error) +} + +var _ ListEmailTemplatesAPIClient = (*Client)(nil) + +// ListEmailTemplatesPaginatorOptions is the paginator options for +// ListEmailTemplates +type ListEmailTemplatesPaginatorOptions struct { + // The number of results to show in a single call to ListEmailTemplates. If the + // number of results is larger than the number you specified in this parameter, + // then the response includes a NextToken element, which you can use to obtain + // additional results. The value you specify has to be at least 1, and can be no + // more than 10. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListEmailTemplatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sesv2.ListEmailTemplates +type ListEmailTemplatesPaginator struct { + options ListEmailTemplatesPaginatorOptions + client ListEmailTemplatesAPIClient + params *ListEmailTemplatesInput + nextToken *string + firstPage bool + done bool +} + +// NewListEmailTemplatesPaginator returns a new ListEmailTemplatesPaginator +func NewListEmailTemplatesPaginator(client ListEmailTemplatesAPIClient, params *ListEmailTemplatesInput, optFns ...func(*ListEmailTemplatesPaginatorOptions)) *ListEmailTemplatesPaginator { + options := ListEmailTemplatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListEmailTemplatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListEmailTemplatesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListEmailTemplates page. +func (p *ListEmailTemplatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEmailTemplatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.PageSize = p.options.Limit + result, err := p.client.ListEmailTemplates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListContactListsAPIClient is a client that implements the ListContactLists +// operation. +type ListContactListsAPIClient interface { + ListContactLists(context.Context, *ListContactListsInput, ...func(*Options)) (*ListContactListsOutput, error) +} + +var _ ListContactListsAPIClient = (*Client)(nil) + +// ListContactListsPaginatorOptions is the paginator options for ListContactLists +type ListContactListsPaginatorOptions struct { + // Maximum number of contact lists to return at once. Use this parameter to + // paginate results. If additional contact lists exist beyond the specified limit, + // the NextToken element is sent in the response. Use the NextToken value in + // subsequent requests to retrieve additional lists. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListContactListsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sesv2.ListContactLists +type ListContactListsPaginator struct { + options ListContactListsPaginatorOptions + client ListContactListsAPIClient + params *ListContactListsInput + nextToken *string + firstPage bool + done bool +} + +// NewListContactListsPaginator returns a new ListContactListsPaginator +func NewListContactListsPaginator(client ListContactListsAPIClient, params *ListContactListsInput, optFns ...func(*ListContactListsPaginatorOptions)) *ListContactListsPaginator { + options := ListContactListsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListContactListsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListContactListsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListContactLists page. +func (p *ListContactListsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListContactListsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.PageSize = p.options.Limit + result, err := p.client.ListContactLists(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDedicatedIpPoolsAPIClient is a client that implements the +// ListDedicatedIpPools operation. +type ListDedicatedIpPoolsAPIClient interface { + ListDedicatedIpPools(context.Context, *ListDedicatedIpPoolsInput, ...func(*Options)) (*ListDedicatedIpPoolsOutput, error) +} + +var _ ListDedicatedIpPoolsAPIClient = (*Client)(nil) + +// ListDedicatedIpPoolsPaginatorOptions is the paginator options for +// ListDedicatedIpPools +type ListDedicatedIpPoolsPaginatorOptions struct { + // The number of results to show in a single call to ListDedicatedIpPools. If the + // number of results is larger than the number you specified in this parameter, + // then the response includes a NextToken element, which you can use to obtain + // additional results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDedicatedIpPoolsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sesv2.ListDedicatedIpPools +type ListDedicatedIpPoolsPaginator struct { + options ListDedicatedIpPoolsPaginatorOptions + client ListDedicatedIpPoolsAPIClient + params *ListDedicatedIpPoolsInput + nextToken *string + firstPage bool + done bool +} + +// NewListDedicatedIpPoolsPaginator returns a new ListDedicatedIpPoolsPaginator +func NewListDedicatedIpPoolsPaginator(client ListDedicatedIpPoolsAPIClient, params *ListDedicatedIpPoolsInput, optFns ...func(*ListDedicatedIpPoolsPaginatorOptions)) *ListDedicatedIpPoolsPaginator { + options := ListDedicatedIpPoolsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDedicatedIpPoolsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDedicatedIpPoolsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDedicatedIpPools page. +func (p *ListDedicatedIpPoolsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDedicatedIpPoolsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.PageSize = p.options.Limit + result, err := p.client.ListDedicatedIpPools(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListImportJobsAPIClient is a client that implements the ListImportJobs +// operation. +type ListImportJobsAPIClient interface { + ListImportJobs(context.Context, *ListImportJobsInput, ...func(*Options)) (*ListImportJobsOutput, error) +} + +var _ ListImportJobsAPIClient = (*Client)(nil) + +// ListImportJobsPaginatorOptions is the paginator options for ListImportJobs +type ListImportJobsPaginatorOptions struct { + // Maximum number of import jobs to return at once. Use this parameter to paginate + // results. If additional import jobs exist beyond the specified limit, the + // NextToken element is sent in the response. Use the NextToken value in subsequent + // requests to retrieve additional addresses. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListImportJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sesv2.ListImportJobs +type ListImportJobsPaginator struct { + options ListImportJobsPaginatorOptions + client ListImportJobsAPIClient + params *ListImportJobsInput + nextToken *string + firstPage bool + done bool +} + +// NewListImportJobsPaginator returns a new ListImportJobsPaginator +func NewListImportJobsPaginator(client ListImportJobsAPIClient, params *ListImportJobsInput, optFns ...func(*ListImportJobsPaginatorOptions)) *ListImportJobsPaginator { + options := ListImportJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListImportJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListImportJobsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListImportJobs page. +func (p *ListImportJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListImportJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.PageSize = p.options.Limit + result, err := p.client.ListImportJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListContactsAPIClient is a client that implements the ListContacts operation. +type ListContactsAPIClient interface { + ListContacts(context.Context, *ListContactsInput, ...func(*Options)) (*ListContactsOutput, error) +} + +var _ ListContactsAPIClient = (*Client)(nil) + +// ListContactsPaginatorOptions is the paginator options for ListContacts +type ListContactsPaginatorOptions struct { + // The number of contacts that may be returned at once, which is dependent on if + // there are more or less contacts than the value of the PageSize. Use this + // parameter to paginate results. If additional contacts exist beyond the specified + // limit, the NextToken element is sent in the response. Use the NextToken value in + // subsequent requests to retrieve additional contacts. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListContactsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sesv2.ListContacts +type ListContactsPaginator struct { + options ListContactsPaginatorOptions + client ListContactsAPIClient + params *ListContactsInput + nextToken *string + firstPage bool + done bool +} + +// NewListContactsPaginator returns a new ListContactsPaginator +func NewListContactsPaginator(client ListContactsAPIClient, params *ListContactsInput, optFns ...func(*ListContactsPaginatorOptions)) *ListContactsPaginator { + options := ListContactsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListContactsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListContactsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListContacts page. +func (p *ListContactsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListContactsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.PageSize = p.options.Limit + result, err := p.client.ListContacts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListConfigurationSetsAPIClient is a client that implements the +// ListConfigurationSets operation. +type ListConfigurationSetsAPIClient interface { + ListConfigurationSets(context.Context, *ListConfigurationSetsInput, ...func(*Options)) (*ListConfigurationSetsOutput, error) +} + +var _ ListConfigurationSetsAPIClient = (*Client)(nil) + +// ListConfigurationSetsPaginatorOptions is the paginator options for +// ListConfigurationSets +type ListConfigurationSetsPaginatorOptions struct { + // The number of results to show in a single call to ListConfigurationSets. If the + // number of results is larger than the number you specified in this parameter, + // then the response includes a NextToken element, which you can use to obtain + // additional results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListConfigurationSetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sesv2.ListConfigurationSets +type ListConfigurationSetsPaginator struct { + options ListConfigurationSetsPaginatorOptions + client ListConfigurationSetsAPIClient + params *ListConfigurationSetsInput + nextToken *string + firstPage bool + done bool +} + +// NewListConfigurationSetsPaginator returns a new ListConfigurationSetsPaginator +func NewListConfigurationSetsPaginator(client ListConfigurationSetsAPIClient, params *ListConfigurationSetsInput, optFns ...func(*ListConfigurationSetsPaginatorOptions)) *ListConfigurationSetsPaginator { + options := ListConfigurationSetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListConfigurationSetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListConfigurationSetsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListConfigurationSets page. +func (p *ListConfigurationSetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListConfigurationSetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.PageSize = p.options.Limit + result, err := p.client.ListConfigurationSets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListSuppressedDestinationsAPIClient is a client that implements the +// ListSuppressedDestinations operation. +type ListSuppressedDestinationsAPIClient interface { + ListSuppressedDestinations(context.Context, *ListSuppressedDestinationsInput, ...func(*Options)) (*ListSuppressedDestinationsOutput, error) +} + +var _ ListSuppressedDestinationsAPIClient = (*Client)(nil) + +// ListSuppressedDestinationsPaginatorOptions is the paginator options for +// ListSuppressedDestinations +type ListSuppressedDestinationsPaginatorOptions struct { + // The number of results to show in a single call to ListSuppressedDestinations. If + // the number of results is larger than the number you specified in this parameter, + // then the response includes a NextToken element, which you can use to obtain + // additional results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListSuppressedDestinationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sesv2.ListSuppressedDestinations +type ListSuppressedDestinationsPaginator struct { + options ListSuppressedDestinationsPaginatorOptions + client ListSuppressedDestinationsAPIClient + params *ListSuppressedDestinationsInput + nextToken *string + firstPage bool + done bool +} + +// NewListSuppressedDestinationsPaginator returns a new +// ListSuppressedDestinationsPaginator +func NewListSuppressedDestinationsPaginator(client ListSuppressedDestinationsAPIClient, params *ListSuppressedDestinationsInput, optFns ...func(*ListSuppressedDestinationsPaginatorOptions)) *ListSuppressedDestinationsPaginator { + options := ListSuppressedDestinationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListSuppressedDestinationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSuppressedDestinationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListSuppressedDestinations page. +func (p *ListSuppressedDestinationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSuppressedDestinationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.PageSize = p.options.Limit + result, err := p.client.ListSuppressedDestinations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetDedicatedIpsAPIClient is a client that implements the GetDedicatedIps +// operation. +type GetDedicatedIpsAPIClient interface { + GetDedicatedIps(context.Context, *GetDedicatedIpsInput, ...func(*Options)) (*GetDedicatedIpsOutput, error) +} + +var _ GetDedicatedIpsAPIClient = (*Client)(nil) + +// GetDedicatedIpsPaginatorOptions is the paginator options for GetDedicatedIps +type GetDedicatedIpsPaginatorOptions struct { + // The number of results to show in a single call to GetDedicatedIpsRequest. If the + // number of results is larger than the number you specified in this parameter, + // then the response includes a NextToken element, which you can use to obtain + // additional results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetDedicatedIpsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sesv2.GetDedicatedIps +type GetDedicatedIpsPaginator struct { + options GetDedicatedIpsPaginatorOptions + client GetDedicatedIpsAPIClient + params *GetDedicatedIpsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetDedicatedIpsPaginator returns a new GetDedicatedIpsPaginator +func NewGetDedicatedIpsPaginator(client GetDedicatedIpsAPIClient, params *GetDedicatedIpsInput, optFns ...func(*GetDedicatedIpsPaginatorOptions)) *GetDedicatedIpsPaginator { + options := GetDedicatedIpsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetDedicatedIpsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetDedicatedIpsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetDedicatedIps page. +func (p *GetDedicatedIpsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetDedicatedIpsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.PageSize = p.options.Limit + result, err := p.client.GetDedicatedIps(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDomainDeliverabilityCampaignsAPIClient is a client that implements the +// ListDomainDeliverabilityCampaigns operation. +type ListDomainDeliverabilityCampaignsAPIClient interface { + ListDomainDeliverabilityCampaigns(context.Context, *ListDomainDeliverabilityCampaignsInput, ...func(*Options)) (*ListDomainDeliverabilityCampaignsOutput, error) +} + +var _ ListDomainDeliverabilityCampaignsAPIClient = (*Client)(nil) + +// ListDomainDeliverabilityCampaignsPaginatorOptions is the paginator options for +// ListDomainDeliverabilityCampaigns +type ListDomainDeliverabilityCampaignsPaginatorOptions struct { + // The maximum number of results to include in response to a single call to the + // ListDomainDeliverabilityCampaigns operation. If the number of results is larger + // than the number that you specify in this parameter, the response includes a + // NextToken element, which you can use to obtain additional results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDomainDeliverabilityCampaignsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sesv2.ListDomainDeliverabilityCampaigns +type ListDomainDeliverabilityCampaignsPaginator struct { + options ListDomainDeliverabilityCampaignsPaginatorOptions + client ListDomainDeliverabilityCampaignsAPIClient + params *ListDomainDeliverabilityCampaignsInput + nextToken *string + firstPage bool + done bool +} + +// NewListDomainDeliverabilityCampaignsPaginator returns a new +// ListDomainDeliverabilityCampaignsPaginator +func NewListDomainDeliverabilityCampaignsPaginator(client ListDomainDeliverabilityCampaignsAPIClient, params *ListDomainDeliverabilityCampaignsInput, optFns ...func(*ListDomainDeliverabilityCampaignsPaginatorOptions)) *ListDomainDeliverabilityCampaignsPaginator { + options := ListDomainDeliverabilityCampaignsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDomainDeliverabilityCampaignsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDomainDeliverabilityCampaignsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDomainDeliverabilityCampaigns page. +func (p *ListDomainDeliverabilityCampaignsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDomainDeliverabilityCampaignsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.PageSize = p.options.Limit + result, err := p.client.ListDomainDeliverabilityCampaigns(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListEmailIdentitiesAPIClient is a client that implements the ListEmailIdentities +// operation. +type ListEmailIdentitiesAPIClient interface { + ListEmailIdentities(context.Context, *ListEmailIdentitiesInput, ...func(*Options)) (*ListEmailIdentitiesOutput, error) +} + +var _ ListEmailIdentitiesAPIClient = (*Client)(nil) + +// ListEmailIdentitiesPaginatorOptions is the paginator options for +// ListEmailIdentities +type ListEmailIdentitiesPaginatorOptions struct { + // The number of results to show in a single call to ListEmailIdentities. If the + // number of results is larger than the number you specified in this parameter, + // then the response includes a NextToken element, which you can use to obtain + // additional results. The value you specify has to be at least 0, and can be no + // more than 1000. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListEmailIdentitiesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sesv2.ListEmailIdentities +type ListEmailIdentitiesPaginator struct { + options ListEmailIdentitiesPaginatorOptions + client ListEmailIdentitiesAPIClient + params *ListEmailIdentitiesInput + nextToken *string + firstPage bool + done bool +} + +// NewListEmailIdentitiesPaginator returns a new ListEmailIdentitiesPaginator +func NewListEmailIdentitiesPaginator(client ListEmailIdentitiesAPIClient, params *ListEmailIdentitiesInput, optFns ...func(*ListEmailIdentitiesPaginatorOptions)) *ListEmailIdentitiesPaginator { + options := ListEmailIdentitiesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListEmailIdentitiesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListEmailIdentitiesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListEmailIdentities page. +func (p *ListEmailIdentitiesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEmailIdentitiesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.PageSize = p.options.Limit + result, err := p.client.ListEmailIdentities(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/sfn/go.sum b/service/sfn/go.sum index c669e324b14..32595049f96 100644 --- a/service/sfn/go.sum +++ b/service/sfn/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/sfn/paginators.go b/service/sfn/paginators.go new file mode 100644 index 00000000000..3acbc58215e --- /dev/null +++ b/service/sfn/paginators.go @@ -0,0 +1,325 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sfn + +import ( + "context" + "fmt" +) + +// ListStateMachinesAPIClient is a client that implements the ListStateMachines +// operation. +type ListStateMachinesAPIClient interface { + ListStateMachines(context.Context, *ListStateMachinesInput, ...func(*Options)) (*ListStateMachinesOutput, error) +} + +var _ ListStateMachinesAPIClient = (*Client)(nil) + +// ListStateMachinesPaginatorOptions is the paginator options for ListStateMachines +type ListStateMachinesPaginatorOptions struct { + // The maximum number of results that are returned per call. You can use nextToken + // to obtain further pages of results. The default is 100 and the maximum allowed + // page size is 1000. A value of 0 uses the default. This is only an upper limit. + // The actual number of results returned per call might be fewer than the specified + // maximum. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListStateMachinesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sfn.ListStateMachines +type ListStateMachinesPaginator struct { + options ListStateMachinesPaginatorOptions + client ListStateMachinesAPIClient + params *ListStateMachinesInput + nextToken *string + firstPage bool + done bool +} + +// NewListStateMachinesPaginator returns a new ListStateMachinesPaginator +func NewListStateMachinesPaginator(client ListStateMachinesAPIClient, params *ListStateMachinesInput, optFns ...func(*ListStateMachinesPaginatorOptions)) *ListStateMachinesPaginator { + options := ListStateMachinesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListStateMachinesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListStateMachinesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListStateMachines page. +func (p *ListStateMachinesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListStateMachinesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListStateMachines(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListExecutionsAPIClient is a client that implements the ListExecutions +// operation. +type ListExecutionsAPIClient interface { + ListExecutions(context.Context, *ListExecutionsInput, ...func(*Options)) (*ListExecutionsOutput, error) +} + +var _ ListExecutionsAPIClient = (*Client)(nil) + +// ListExecutionsPaginatorOptions is the paginator options for ListExecutions +type ListExecutionsPaginatorOptions struct { + // The maximum number of results that are returned per call. You can use nextToken + // to obtain further pages of results. The default is 100 and the maximum allowed + // page size is 1000. A value of 0 uses the default. This is only an upper limit. + // The actual number of results returned per call might be fewer than the specified + // maximum. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListExecutionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sfn.ListExecutions +type ListExecutionsPaginator struct { + options ListExecutionsPaginatorOptions + client ListExecutionsAPIClient + params *ListExecutionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListExecutionsPaginator returns a new ListExecutionsPaginator +func NewListExecutionsPaginator(client ListExecutionsAPIClient, params *ListExecutionsInput, optFns ...func(*ListExecutionsPaginatorOptions)) *ListExecutionsPaginator { + options := ListExecutionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListExecutionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListExecutionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListExecutions page. +func (p *ListExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListExecutionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListExecutions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetExecutionHistoryAPIClient is a client that implements the GetExecutionHistory +// operation. +type GetExecutionHistoryAPIClient interface { + GetExecutionHistory(context.Context, *GetExecutionHistoryInput, ...func(*Options)) (*GetExecutionHistoryOutput, error) +} + +var _ GetExecutionHistoryAPIClient = (*Client)(nil) + +// GetExecutionHistoryPaginatorOptions is the paginator options for +// GetExecutionHistory +type GetExecutionHistoryPaginatorOptions struct { + // The maximum number of results that are returned per call. You can use nextToken + // to obtain further pages of results. The default is 100 and the maximum allowed + // page size is 1000. A value of 0 uses the default. This is only an upper limit. + // The actual number of results returned per call might be fewer than the specified + // maximum. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetExecutionHistoryPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sfn.GetExecutionHistory +type GetExecutionHistoryPaginator struct { + options GetExecutionHistoryPaginatorOptions + client GetExecutionHistoryAPIClient + params *GetExecutionHistoryInput + nextToken *string + firstPage bool + done bool +} + +// NewGetExecutionHistoryPaginator returns a new GetExecutionHistoryPaginator +func NewGetExecutionHistoryPaginator(client GetExecutionHistoryAPIClient, params *GetExecutionHistoryInput, optFns ...func(*GetExecutionHistoryPaginatorOptions)) *GetExecutionHistoryPaginator { + options := GetExecutionHistoryPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetExecutionHistoryPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetExecutionHistoryPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetExecutionHistory page. +func (p *GetExecutionHistoryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetExecutionHistoryOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetExecutionHistory(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListActivitiesAPIClient is a client that implements the ListActivities +// operation. +type ListActivitiesAPIClient interface { + ListActivities(context.Context, *ListActivitiesInput, ...func(*Options)) (*ListActivitiesOutput, error) +} + +var _ ListActivitiesAPIClient = (*Client)(nil) + +// ListActivitiesPaginatorOptions is the paginator options for ListActivities +type ListActivitiesPaginatorOptions struct { + // The maximum number of results that are returned per call. You can use nextToken + // to obtain further pages of results. The default is 100 and the maximum allowed + // page size is 1000. A value of 0 uses the default. This is only an upper limit. + // The actual number of results returned per call might be fewer than the specified + // maximum. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListActivitiesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sfn.ListActivities +type ListActivitiesPaginator struct { + options ListActivitiesPaginatorOptions + client ListActivitiesAPIClient + params *ListActivitiesInput + nextToken *string + firstPage bool + done bool +} + +// NewListActivitiesPaginator returns a new ListActivitiesPaginator +func NewListActivitiesPaginator(client ListActivitiesAPIClient, params *ListActivitiesInput, optFns ...func(*ListActivitiesPaginatorOptions)) *ListActivitiesPaginator { + options := ListActivitiesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListActivitiesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListActivitiesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListActivities page. +func (p *ListActivitiesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListActivitiesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListActivities(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/shield/go.sum b/service/shield/go.sum index c669e324b14..32595049f96 100644 --- a/service/shield/go.sum +++ b/service/shield/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/shield/paginators.go b/service/shield/paginators.go new file mode 100644 index 00000000000..dbc308f56cc --- /dev/null +++ b/service/shield/paginators.go @@ -0,0 +1,167 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package shield + +import ( + "context" + "fmt" +) + +// ListAttacksAPIClient is a client that implements the ListAttacks operation. +type ListAttacksAPIClient interface { + ListAttacks(context.Context, *ListAttacksInput, ...func(*Options)) (*ListAttacksOutput, error) +} + +var _ ListAttacksAPIClient = (*Client)(nil) + +// ListAttacksPaginatorOptions is the paginator options for ListAttacks +type ListAttacksPaginatorOptions struct { + // The maximum number of AttackSummary objects to be returned. If this is left + // blank, the first 20 results will be returned. This is a maximum value; it is + // possible that AWS WAF will return the results in smaller batches. That is, the + // number of AttackSummary objects returned could be less than MaxResults, even if + // there are still more AttackSummary objects yet to return. If there are more + // AttackSummary objects to return, AWS WAF will always also return a NextToken. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAttacksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/shield.ListAttacks +type ListAttacksPaginator struct { + options ListAttacksPaginatorOptions + client ListAttacksAPIClient + params *ListAttacksInput + nextToken *string + firstPage bool + done bool +} + +// NewListAttacksPaginator returns a new ListAttacksPaginator +func NewListAttacksPaginator(client ListAttacksAPIClient, params *ListAttacksInput, optFns ...func(*ListAttacksPaginatorOptions)) *ListAttacksPaginator { + options := ListAttacksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAttacksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAttacksPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAttacks page. +func (p *ListAttacksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAttacksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListAttacks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListProtectionsAPIClient is a client that implements the ListProtections +// operation. +type ListProtectionsAPIClient interface { + ListProtections(context.Context, *ListProtectionsInput, ...func(*Options)) (*ListProtectionsOutput, error) +} + +var _ ListProtectionsAPIClient = (*Client)(nil) + +// ListProtectionsPaginatorOptions is the paginator options for ListProtections +type ListProtectionsPaginatorOptions struct { + // The maximum number of Protection objects to be returned. If this is left blank + // the first 20 results will be returned. This is a maximum value; it is possible + // that AWS WAF will return the results in smaller batches. That is, the number of + // Protection objects returned could be less than MaxResults, even if there are + // still more Protection objects yet to return. If there are more Protection + // objects to return, AWS WAF will always also return a NextToken. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListProtectionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/shield.ListProtections +type ListProtectionsPaginator struct { + options ListProtectionsPaginatorOptions + client ListProtectionsAPIClient + params *ListProtectionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListProtectionsPaginator returns a new ListProtectionsPaginator +func NewListProtectionsPaginator(client ListProtectionsAPIClient, params *ListProtectionsInput, optFns ...func(*ListProtectionsPaginatorOptions)) *ListProtectionsPaginator { + options := ListProtectionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListProtectionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListProtectionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListProtections page. +func (p *ListProtectionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProtectionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListProtections(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/signer/go.sum b/service/signer/go.sum index c669e324b14..32595049f96 100644 --- a/service/signer/go.sum +++ b/service/signer/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/signer/paginators.go b/service/signer/paginators.go new file mode 100644 index 00000000000..d25a29f978e --- /dev/null +++ b/service/signer/paginators.go @@ -0,0 +1,238 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package signer + +import ( + "context" + "fmt" +) + +// ListSigningProfilesAPIClient is a client that implements the ListSigningProfiles +// operation. +type ListSigningProfilesAPIClient interface { + ListSigningProfiles(context.Context, *ListSigningProfilesInput, ...func(*Options)) (*ListSigningProfilesOutput, error) +} + +var _ ListSigningProfilesAPIClient = (*Client)(nil) + +// ListSigningProfilesPaginatorOptions is the paginator options for +// ListSigningProfiles +type ListSigningProfilesPaginatorOptions struct { + // The maximum number of profiles to be returned. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListSigningProfilesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/signer.ListSigningProfiles +type ListSigningProfilesPaginator struct { + options ListSigningProfilesPaginatorOptions + client ListSigningProfilesAPIClient + params *ListSigningProfilesInput + nextToken *string + firstPage bool + done bool +} + +// NewListSigningProfilesPaginator returns a new ListSigningProfilesPaginator +func NewListSigningProfilesPaginator(client ListSigningProfilesAPIClient, params *ListSigningProfilesInput, optFns ...func(*ListSigningProfilesPaginatorOptions)) *ListSigningProfilesPaginator { + options := ListSigningProfilesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListSigningProfilesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSigningProfilesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListSigningProfiles page. +func (p *ListSigningProfilesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSigningProfilesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListSigningProfiles(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListSigningJobsAPIClient is a client that implements the ListSigningJobs +// operation. +type ListSigningJobsAPIClient interface { + ListSigningJobs(context.Context, *ListSigningJobsInput, ...func(*Options)) (*ListSigningJobsOutput, error) +} + +var _ ListSigningJobsAPIClient = (*Client)(nil) + +// ListSigningJobsPaginatorOptions is the paginator options for ListSigningJobs +type ListSigningJobsPaginatorOptions struct { + // Specifies the maximum number of items to return in the response. Use this + // parameter when paginating results. If additional items exist beyond the number + // you specify, the nextToken element is set in the response. Use the nextToken + // value in a subsequent request to retrieve additional items. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListSigningJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/signer.ListSigningJobs +type ListSigningJobsPaginator struct { + options ListSigningJobsPaginatorOptions + client ListSigningJobsAPIClient + params *ListSigningJobsInput + nextToken *string + firstPage bool + done bool +} + +// NewListSigningJobsPaginator returns a new ListSigningJobsPaginator +func NewListSigningJobsPaginator(client ListSigningJobsAPIClient, params *ListSigningJobsInput, optFns ...func(*ListSigningJobsPaginatorOptions)) *ListSigningJobsPaginator { + options := ListSigningJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListSigningJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSigningJobsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListSigningJobs page. +func (p *ListSigningJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSigningJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListSigningJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListSigningPlatformsAPIClient is a client that implements the +// ListSigningPlatforms operation. +type ListSigningPlatformsAPIClient interface { + ListSigningPlatforms(context.Context, *ListSigningPlatformsInput, ...func(*Options)) (*ListSigningPlatformsOutput, error) +} + +var _ ListSigningPlatformsAPIClient = (*Client)(nil) + +// ListSigningPlatformsPaginatorOptions is the paginator options for +// ListSigningPlatforms +type ListSigningPlatformsPaginatorOptions struct { + // The maximum number of results to be returned by this operation. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListSigningPlatformsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/signer.ListSigningPlatforms +type ListSigningPlatformsPaginator struct { + options ListSigningPlatformsPaginatorOptions + client ListSigningPlatformsAPIClient + params *ListSigningPlatformsInput + nextToken *string + firstPage bool + done bool +} + +// NewListSigningPlatformsPaginator returns a new ListSigningPlatformsPaginator +func NewListSigningPlatformsPaginator(client ListSigningPlatformsAPIClient, params *ListSigningPlatformsInput, optFns ...func(*ListSigningPlatformsPaginatorOptions)) *ListSigningPlatformsPaginator { + options := ListSigningPlatformsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListSigningPlatformsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSigningPlatformsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListSigningPlatforms page. +func (p *ListSigningPlatformsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSigningPlatformsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListSigningPlatforms(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/sms/go.sum b/service/sms/go.sum index c669e324b14..32595049f96 100644 --- a/service/sms/go.sum +++ b/service/sms/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/sms/paginators.go b/service/sms/paginators.go new file mode 100644 index 00000000000..8fae071c849 --- /dev/null +++ b/service/sms/paginators.go @@ -0,0 +1,316 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sms + +import ( + "context" + "fmt" +) + +// GetReplicationJobsAPIClient is a client that implements the GetReplicationJobs +// operation. +type GetReplicationJobsAPIClient interface { + GetReplicationJobs(context.Context, *GetReplicationJobsInput, ...func(*Options)) (*GetReplicationJobsOutput, error) +} + +var _ GetReplicationJobsAPIClient = (*Client)(nil) + +// GetReplicationJobsPaginatorOptions is the paginator options for +// GetReplicationJobs +type GetReplicationJobsPaginatorOptions struct { + // The maximum number of results to return in a single call. The default value is + // 50. To retrieve the remaining results, make another call with the returned + // NextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetReplicationJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sms.GetReplicationJobs +type GetReplicationJobsPaginator struct { + options GetReplicationJobsPaginatorOptions + client GetReplicationJobsAPIClient + params *GetReplicationJobsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetReplicationJobsPaginator returns a new GetReplicationJobsPaginator +func NewGetReplicationJobsPaginator(client GetReplicationJobsAPIClient, params *GetReplicationJobsInput, optFns ...func(*GetReplicationJobsPaginatorOptions)) *GetReplicationJobsPaginator { + options := GetReplicationJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetReplicationJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetReplicationJobsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetReplicationJobs page. +func (p *GetReplicationJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetReplicationJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetReplicationJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetServersAPIClient is a client that implements the GetServers operation. +type GetServersAPIClient interface { + GetServers(context.Context, *GetServersInput, ...func(*Options)) (*GetServersOutput, error) +} + +var _ GetServersAPIClient = (*Client)(nil) + +// GetServersPaginatorOptions is the paginator options for GetServers +type GetServersPaginatorOptions struct { + // The maximum number of results to return in a single call. The default value is + // 50. To retrieve the remaining results, make another call with the returned + // NextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetServersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sms.GetServers +type GetServersPaginator struct { + options GetServersPaginatorOptions + client GetServersAPIClient + params *GetServersInput + nextToken *string + firstPage bool + done bool +} + +// NewGetServersPaginator returns a new GetServersPaginator +func NewGetServersPaginator(client GetServersAPIClient, params *GetServersInput, optFns ...func(*GetServersPaginatorOptions)) *GetServersPaginator { + options := GetServersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetServersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetServersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetServers page. +func (p *GetServersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetServersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetServers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetConnectorsAPIClient is a client that implements the GetConnectors operation. +type GetConnectorsAPIClient interface { + GetConnectors(context.Context, *GetConnectorsInput, ...func(*Options)) (*GetConnectorsOutput, error) +} + +var _ GetConnectorsAPIClient = (*Client)(nil) + +// GetConnectorsPaginatorOptions is the paginator options for GetConnectors +type GetConnectorsPaginatorOptions struct { + // The maximum number of results to return in a single call. The default value is + // 50. To retrieve the remaining results, make another call with the returned + // NextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetConnectorsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sms.GetConnectors +type GetConnectorsPaginator struct { + options GetConnectorsPaginatorOptions + client GetConnectorsAPIClient + params *GetConnectorsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetConnectorsPaginator returns a new GetConnectorsPaginator +func NewGetConnectorsPaginator(client GetConnectorsAPIClient, params *GetConnectorsInput, optFns ...func(*GetConnectorsPaginatorOptions)) *GetConnectorsPaginator { + options := GetConnectorsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetConnectorsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetConnectorsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetConnectors page. +func (p *GetConnectorsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetConnectorsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetConnectors(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetReplicationRunsAPIClient is a client that implements the GetReplicationRuns +// operation. +type GetReplicationRunsAPIClient interface { + GetReplicationRuns(context.Context, *GetReplicationRunsInput, ...func(*Options)) (*GetReplicationRunsOutput, error) +} + +var _ GetReplicationRunsAPIClient = (*Client)(nil) + +// GetReplicationRunsPaginatorOptions is the paginator options for +// GetReplicationRuns +type GetReplicationRunsPaginatorOptions struct { + // The maximum number of results to return in a single call. The default value is + // 50. To retrieve the remaining results, make another call with the returned + // NextToken value. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetReplicationRunsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sms.GetReplicationRuns +type GetReplicationRunsPaginator struct { + options GetReplicationRunsPaginatorOptions + client GetReplicationRunsAPIClient + params *GetReplicationRunsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetReplicationRunsPaginator returns a new GetReplicationRunsPaginator +func NewGetReplicationRunsPaginator(client GetReplicationRunsAPIClient, params *GetReplicationRunsInput, optFns ...func(*GetReplicationRunsPaginatorOptions)) *GetReplicationRunsPaginator { + options := GetReplicationRunsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetReplicationRunsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetReplicationRunsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetReplicationRuns page. +func (p *GetReplicationRunsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetReplicationRunsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetReplicationRuns(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/snowball/go.sum b/service/snowball/go.sum index c669e324b14..32595049f96 100644 --- a/service/snowball/go.sum +++ b/service/snowball/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/snowball/paginators.go b/service/snowball/paginators.go new file mode 100644 index 00000000000..3e7ee6e84b1 --- /dev/null +++ b/service/snowball/paginators.go @@ -0,0 +1,157 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package snowball + +import ( + "context" + "fmt" +) + +// ListJobsAPIClient is a client that implements the ListJobs operation. +type ListJobsAPIClient interface { + ListJobs(context.Context, *ListJobsInput, ...func(*Options)) (*ListJobsOutput, error) +} + +var _ ListJobsAPIClient = (*Client)(nil) + +// ListJobsPaginatorOptions is the paginator options for ListJobs +type ListJobsPaginatorOptions struct { + // The number of JobListEntry objects to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/snowball.ListJobs +type ListJobsPaginator struct { + options ListJobsPaginatorOptions + client ListJobsAPIClient + params *ListJobsInput + nextToken *string + firstPage bool + done bool +} + +// NewListJobsPaginator returns a new ListJobsPaginator +func NewListJobsPaginator(client ListJobsAPIClient, params *ListJobsInput, optFns ...func(*ListJobsPaginatorOptions)) *ListJobsPaginator { + options := ListJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListJobsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListJobs page. +func (p *ListJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeAddressesAPIClient is a client that implements the DescribeAddresses +// operation. +type DescribeAddressesAPIClient interface { + DescribeAddresses(context.Context, *DescribeAddressesInput, ...func(*Options)) (*DescribeAddressesOutput, error) +} + +var _ DescribeAddressesAPIClient = (*Client)(nil) + +// DescribeAddressesPaginatorOptions is the paginator options for DescribeAddresses +type DescribeAddressesPaginatorOptions struct { + // The number of ADDRESS objects to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeAddressesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/snowball.DescribeAddresses +type DescribeAddressesPaginator struct { + options DescribeAddressesPaginatorOptions + client DescribeAddressesAPIClient + params *DescribeAddressesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeAddressesPaginator returns a new DescribeAddressesPaginator +func NewDescribeAddressesPaginator(client DescribeAddressesAPIClient, params *DescribeAddressesInput, optFns ...func(*DescribeAddressesPaginatorOptions)) *DescribeAddressesPaginator { + options := DescribeAddressesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeAddressesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeAddressesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeAddresses page. +func (p *DescribeAddressesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeAddressesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeAddresses(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/sns/go.sum b/service/sns/go.sum index c669e324b14..32595049f96 100644 --- a/service/sns/go.sum +++ b/service/sns/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/sns/paginators.go b/service/sns/paginators.go new file mode 100644 index 00000000000..85173a9f8c1 --- /dev/null +++ b/service/sns/paginators.go @@ -0,0 +1,368 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sns + +import ( + "context" + "fmt" +) + +// ListPlatformApplicationsAPIClient is a client that implements the +// ListPlatformApplications operation. +type ListPlatformApplicationsAPIClient interface { + ListPlatformApplications(context.Context, *ListPlatformApplicationsInput, ...func(*Options)) (*ListPlatformApplicationsOutput, error) +} + +var _ ListPlatformApplicationsAPIClient = (*Client)(nil) + +// ListPlatformApplicationsPaginatorOptions is the paginator options for +// ListPlatformApplications +type ListPlatformApplicationsPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListPlatformApplicationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sns.ListPlatformApplications +type ListPlatformApplicationsPaginator struct { + options ListPlatformApplicationsPaginatorOptions + client ListPlatformApplicationsAPIClient + params *ListPlatformApplicationsInput + nextToken *string + firstPage bool + done bool +} + +// NewListPlatformApplicationsPaginator returns a new +// ListPlatformApplicationsPaginator +func NewListPlatformApplicationsPaginator(client ListPlatformApplicationsAPIClient, params *ListPlatformApplicationsInput, optFns ...func(*ListPlatformApplicationsPaginatorOptions)) *ListPlatformApplicationsPaginator { + options := ListPlatformApplicationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListPlatformApplicationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPlatformApplicationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListPlatformApplications page. +func (p *ListPlatformApplicationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPlatformApplicationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListPlatformApplications(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListSubscriptionsAPIClient is a client that implements the ListSubscriptions +// operation. +type ListSubscriptionsAPIClient interface { + ListSubscriptions(context.Context, *ListSubscriptionsInput, ...func(*Options)) (*ListSubscriptionsOutput, error) +} + +var _ ListSubscriptionsAPIClient = (*Client)(nil) + +// ListSubscriptionsPaginatorOptions is the paginator options for ListSubscriptions +type ListSubscriptionsPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListSubscriptionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sns.ListSubscriptions +type ListSubscriptionsPaginator struct { + options ListSubscriptionsPaginatorOptions + client ListSubscriptionsAPIClient + params *ListSubscriptionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListSubscriptionsPaginator returns a new ListSubscriptionsPaginator +func NewListSubscriptionsPaginator(client ListSubscriptionsAPIClient, params *ListSubscriptionsInput, optFns ...func(*ListSubscriptionsPaginatorOptions)) *ListSubscriptionsPaginator { + options := ListSubscriptionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListSubscriptionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSubscriptionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListSubscriptions page. +func (p *ListSubscriptionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSubscriptionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListSubscriptions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListSubscriptionsByTopicAPIClient is a client that implements the +// ListSubscriptionsByTopic operation. +type ListSubscriptionsByTopicAPIClient interface { + ListSubscriptionsByTopic(context.Context, *ListSubscriptionsByTopicInput, ...func(*Options)) (*ListSubscriptionsByTopicOutput, error) +} + +var _ ListSubscriptionsByTopicAPIClient = (*Client)(nil) + +// ListSubscriptionsByTopicPaginatorOptions is the paginator options for +// ListSubscriptionsByTopic +type ListSubscriptionsByTopicPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListSubscriptionsByTopicPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sns.ListSubscriptionsByTopic +type ListSubscriptionsByTopicPaginator struct { + options ListSubscriptionsByTopicPaginatorOptions + client ListSubscriptionsByTopicAPIClient + params *ListSubscriptionsByTopicInput + nextToken *string + firstPage bool + done bool +} + +// NewListSubscriptionsByTopicPaginator returns a new +// ListSubscriptionsByTopicPaginator +func NewListSubscriptionsByTopicPaginator(client ListSubscriptionsByTopicAPIClient, params *ListSubscriptionsByTopicInput, optFns ...func(*ListSubscriptionsByTopicPaginatorOptions)) *ListSubscriptionsByTopicPaginator { + options := ListSubscriptionsByTopicPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListSubscriptionsByTopicPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSubscriptionsByTopicPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListSubscriptionsByTopic page. +func (p *ListSubscriptionsByTopicPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSubscriptionsByTopicOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListSubscriptionsByTopic(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListEndpointsByPlatformApplicationAPIClient is a client that implements the +// ListEndpointsByPlatformApplication operation. +type ListEndpointsByPlatformApplicationAPIClient interface { + ListEndpointsByPlatformApplication(context.Context, *ListEndpointsByPlatformApplicationInput, ...func(*Options)) (*ListEndpointsByPlatformApplicationOutput, error) +} + +var _ ListEndpointsByPlatformApplicationAPIClient = (*Client)(nil) + +// ListEndpointsByPlatformApplicationPaginatorOptions is the paginator options for +// ListEndpointsByPlatformApplication +type ListEndpointsByPlatformApplicationPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListEndpointsByPlatformApplicationPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sns.ListEndpointsByPlatformApplication +type ListEndpointsByPlatformApplicationPaginator struct { + options ListEndpointsByPlatformApplicationPaginatorOptions + client ListEndpointsByPlatformApplicationAPIClient + params *ListEndpointsByPlatformApplicationInput + nextToken *string + firstPage bool + done bool +} + +// NewListEndpointsByPlatformApplicationPaginator returns a new +// ListEndpointsByPlatformApplicationPaginator +func NewListEndpointsByPlatformApplicationPaginator(client ListEndpointsByPlatformApplicationAPIClient, params *ListEndpointsByPlatformApplicationInput, optFns ...func(*ListEndpointsByPlatformApplicationPaginatorOptions)) *ListEndpointsByPlatformApplicationPaginator { + options := ListEndpointsByPlatformApplicationPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListEndpointsByPlatformApplicationPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListEndpointsByPlatformApplicationPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListEndpointsByPlatformApplication page. +func (p *ListEndpointsByPlatformApplicationPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEndpointsByPlatformApplicationOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListEndpointsByPlatformApplication(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTopicsAPIClient is a client that implements the ListTopics operation. +type ListTopicsAPIClient interface { + ListTopics(context.Context, *ListTopicsInput, ...func(*Options)) (*ListTopicsOutput, error) +} + +var _ ListTopicsAPIClient = (*Client)(nil) + +// ListTopicsPaginatorOptions is the paginator options for ListTopics +type ListTopicsPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTopicsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sns.ListTopics +type ListTopicsPaginator struct { + options ListTopicsPaginatorOptions + client ListTopicsAPIClient + params *ListTopicsInput + nextToken *string + firstPage bool + done bool +} + +// NewListTopicsPaginator returns a new ListTopicsPaginator +func NewListTopicsPaginator(client ListTopicsAPIClient, params *ListTopicsInput, optFns ...func(*ListTopicsPaginatorOptions)) *ListTopicsPaginator { + options := ListTopicsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTopicsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTopicsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTopics page. +func (p *ListTopicsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTopicsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListTopics(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/sqs/go.sum b/service/sqs/go.sum index c669e324b14..32595049f96 100644 --- a/service/sqs/go.sum +++ b/service/sqs/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/sqs/paginators.go b/service/sqs/paginators.go new file mode 100644 index 00000000000..f76779af23d --- /dev/null +++ b/service/sqs/paginators.go @@ -0,0 +1,161 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sqs + +import ( + "context" + "fmt" +) + +// ListDeadLetterSourceQueuesAPIClient is a client that implements the +// ListDeadLetterSourceQueues operation. +type ListDeadLetterSourceQueuesAPIClient interface { + ListDeadLetterSourceQueues(context.Context, *ListDeadLetterSourceQueuesInput, ...func(*Options)) (*ListDeadLetterSourceQueuesOutput, error) +} + +var _ ListDeadLetterSourceQueuesAPIClient = (*Client)(nil) + +// ListDeadLetterSourceQueuesPaginatorOptions is the paginator options for +// ListDeadLetterSourceQueues +type ListDeadLetterSourceQueuesPaginatorOptions struct { + // Maximum number of results to include in the response. Value range is 1 to 1000. + // You must set MaxResults to receive a value for NextToken in the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDeadLetterSourceQueuesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sqs.ListDeadLetterSourceQueues +type ListDeadLetterSourceQueuesPaginator struct { + options ListDeadLetterSourceQueuesPaginatorOptions + client ListDeadLetterSourceQueuesAPIClient + params *ListDeadLetterSourceQueuesInput + nextToken *string + firstPage bool + done bool +} + +// NewListDeadLetterSourceQueuesPaginator returns a new +// ListDeadLetterSourceQueuesPaginator +func NewListDeadLetterSourceQueuesPaginator(client ListDeadLetterSourceQueuesAPIClient, params *ListDeadLetterSourceQueuesInput, optFns ...func(*ListDeadLetterSourceQueuesPaginatorOptions)) *ListDeadLetterSourceQueuesPaginator { + options := ListDeadLetterSourceQueuesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDeadLetterSourceQueuesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDeadLetterSourceQueuesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDeadLetterSourceQueues page. +func (p *ListDeadLetterSourceQueuesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDeadLetterSourceQueuesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListDeadLetterSourceQueues(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListQueuesAPIClient is a client that implements the ListQueues operation. +type ListQueuesAPIClient interface { + ListQueues(context.Context, *ListQueuesInput, ...func(*Options)) (*ListQueuesOutput, error) +} + +var _ ListQueuesAPIClient = (*Client)(nil) + +// ListQueuesPaginatorOptions is the paginator options for ListQueues +type ListQueuesPaginatorOptions struct { + // Maximum number of results to include in the response. Value range is 1 to 1000. + // You must set MaxResults to receive a value for NextToken in the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListQueuesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sqs.ListQueues +type ListQueuesPaginator struct { + options ListQueuesPaginatorOptions + client ListQueuesAPIClient + params *ListQueuesInput + nextToken *string + firstPage bool + done bool +} + +// NewListQueuesPaginator returns a new ListQueuesPaginator +func NewListQueuesPaginator(client ListQueuesAPIClient, params *ListQueuesInput, optFns ...func(*ListQueuesPaginatorOptions)) *ListQueuesPaginator { + options := ListQueuesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListQueuesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListQueuesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListQueues page. +func (p *ListQueuesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListQueuesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListQueues(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/ssm/go.sum b/service/ssm/go.sum index c669e324b14..32595049f96 100644 --- a/service/ssm/go.sum +++ b/service/ssm/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/ssm/paginators.go b/service/ssm/paginators.go new file mode 100644 index 00000000000..86d5bc81d3a --- /dev/null +++ b/service/ssm/paginators.go @@ -0,0 +1,3330 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssm + +import ( + "context" + "fmt" +) + +// DescribeEffectivePatchesForPatchBaselineAPIClient is a client that implements +// the DescribeEffectivePatchesForPatchBaseline operation. +type DescribeEffectivePatchesForPatchBaselineAPIClient interface { + DescribeEffectivePatchesForPatchBaseline(context.Context, *DescribeEffectivePatchesForPatchBaselineInput, ...func(*Options)) (*DescribeEffectivePatchesForPatchBaselineOutput, error) +} + +var _ DescribeEffectivePatchesForPatchBaselineAPIClient = (*Client)(nil) + +// DescribeEffectivePatchesForPatchBaselinePaginatorOptions is the paginator +// options for DescribeEffectivePatchesForPatchBaseline +type DescribeEffectivePatchesForPatchBaselinePaginatorOptions struct { + // The maximum number of patches to return (per page). + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeEffectivePatchesForPatchBaselinePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribeEffectivePatchesForPatchBaseline +type DescribeEffectivePatchesForPatchBaselinePaginator struct { + options DescribeEffectivePatchesForPatchBaselinePaginatorOptions + client DescribeEffectivePatchesForPatchBaselineAPIClient + params *DescribeEffectivePatchesForPatchBaselineInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeEffectivePatchesForPatchBaselinePaginator returns a new +// DescribeEffectivePatchesForPatchBaselinePaginator +func NewDescribeEffectivePatchesForPatchBaselinePaginator(client DescribeEffectivePatchesForPatchBaselineAPIClient, params *DescribeEffectivePatchesForPatchBaselineInput, optFns ...func(*DescribeEffectivePatchesForPatchBaselinePaginatorOptions)) *DescribeEffectivePatchesForPatchBaselinePaginator { + options := DescribeEffectivePatchesForPatchBaselinePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeEffectivePatchesForPatchBaselinePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEffectivePatchesForPatchBaselinePaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeEffectivePatchesForPatchBaseline page. +func (p *DescribeEffectivePatchesForPatchBaselinePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEffectivePatchesForPatchBaselineOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeEffectivePatchesForPatchBaseline(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribePatchPropertiesAPIClient is a client that implements the +// DescribePatchProperties operation. +type DescribePatchPropertiesAPIClient interface { + DescribePatchProperties(context.Context, *DescribePatchPropertiesInput, ...func(*Options)) (*DescribePatchPropertiesOutput, error) +} + +var _ DescribePatchPropertiesAPIClient = (*Client)(nil) + +// DescribePatchPropertiesPaginatorOptions is the paginator options for +// DescribePatchProperties +type DescribePatchPropertiesPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribePatchPropertiesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribePatchProperties +type DescribePatchPropertiesPaginator struct { + options DescribePatchPropertiesPaginatorOptions + client DescribePatchPropertiesAPIClient + params *DescribePatchPropertiesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribePatchPropertiesPaginator returns a new +// DescribePatchPropertiesPaginator +func NewDescribePatchPropertiesPaginator(client DescribePatchPropertiesAPIClient, params *DescribePatchPropertiesInput, optFns ...func(*DescribePatchPropertiesPaginatorOptions)) *DescribePatchPropertiesPaginator { + options := DescribePatchPropertiesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribePatchPropertiesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribePatchPropertiesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribePatchProperties page. +func (p *DescribePatchPropertiesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribePatchPropertiesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribePatchProperties(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeMaintenanceWindowScheduleAPIClient is a client that implements the +// DescribeMaintenanceWindowSchedule operation. +type DescribeMaintenanceWindowScheduleAPIClient interface { + DescribeMaintenanceWindowSchedule(context.Context, *DescribeMaintenanceWindowScheduleInput, ...func(*Options)) (*DescribeMaintenanceWindowScheduleOutput, error) +} + +var _ DescribeMaintenanceWindowScheduleAPIClient = (*Client)(nil) + +// DescribeMaintenanceWindowSchedulePaginatorOptions is the paginator options for +// DescribeMaintenanceWindowSchedule +type DescribeMaintenanceWindowSchedulePaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeMaintenanceWindowSchedulePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribeMaintenanceWindowSchedule +type DescribeMaintenanceWindowSchedulePaginator struct { + options DescribeMaintenanceWindowSchedulePaginatorOptions + client DescribeMaintenanceWindowScheduleAPIClient + params *DescribeMaintenanceWindowScheduleInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeMaintenanceWindowSchedulePaginator returns a new +// DescribeMaintenanceWindowSchedulePaginator +func NewDescribeMaintenanceWindowSchedulePaginator(client DescribeMaintenanceWindowScheduleAPIClient, params *DescribeMaintenanceWindowScheduleInput, optFns ...func(*DescribeMaintenanceWindowSchedulePaginatorOptions)) *DescribeMaintenanceWindowSchedulePaginator { + options := DescribeMaintenanceWindowSchedulePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeMaintenanceWindowSchedulePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeMaintenanceWindowSchedulePaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeMaintenanceWindowSchedule page. +func (p *DescribeMaintenanceWindowSchedulePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeMaintenanceWindowScheduleOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeMaintenanceWindowSchedule(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListResourceComplianceSummariesAPIClient is a client that implements the +// ListResourceComplianceSummaries operation. +type ListResourceComplianceSummariesAPIClient interface { + ListResourceComplianceSummaries(context.Context, *ListResourceComplianceSummariesInput, ...func(*Options)) (*ListResourceComplianceSummariesOutput, error) +} + +var _ ListResourceComplianceSummariesAPIClient = (*Client)(nil) + +// ListResourceComplianceSummariesPaginatorOptions is the paginator options for +// ListResourceComplianceSummaries +type ListResourceComplianceSummariesPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListResourceComplianceSummariesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.ListResourceComplianceSummaries +type ListResourceComplianceSummariesPaginator struct { + options ListResourceComplianceSummariesPaginatorOptions + client ListResourceComplianceSummariesAPIClient + params *ListResourceComplianceSummariesInput + nextToken *string + firstPage bool + done bool +} + +// NewListResourceComplianceSummariesPaginator returns a new +// ListResourceComplianceSummariesPaginator +func NewListResourceComplianceSummariesPaginator(client ListResourceComplianceSummariesAPIClient, params *ListResourceComplianceSummariesInput, optFns ...func(*ListResourceComplianceSummariesPaginatorOptions)) *ListResourceComplianceSummariesPaginator { + options := ListResourceComplianceSummariesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListResourceComplianceSummariesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListResourceComplianceSummariesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListResourceComplianceSummaries page. +func (p *ListResourceComplianceSummariesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListResourceComplianceSummariesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListResourceComplianceSummaries(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetInventoryAPIClient is a client that implements the GetInventory operation. +type GetInventoryAPIClient interface { + GetInventory(context.Context, *GetInventoryInput, ...func(*Options)) (*GetInventoryOutput, error) +} + +var _ GetInventoryAPIClient = (*Client)(nil) + +// GetInventoryPaginatorOptions is the paginator options for GetInventory +type GetInventoryPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetInventoryPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.GetInventory +type GetInventoryPaginator struct { + options GetInventoryPaginatorOptions + client GetInventoryAPIClient + params *GetInventoryInput + nextToken *string + firstPage bool + done bool +} + +// NewGetInventoryPaginator returns a new GetInventoryPaginator +func NewGetInventoryPaginator(client GetInventoryAPIClient, params *GetInventoryInput, optFns ...func(*GetInventoryPaginatorOptions)) *GetInventoryPaginator { + options := GetInventoryPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetInventoryPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetInventoryPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetInventory page. +func (p *GetInventoryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetInventoryOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetInventory(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListResourceDataSyncAPIClient is a client that implements the +// ListResourceDataSync operation. +type ListResourceDataSyncAPIClient interface { + ListResourceDataSync(context.Context, *ListResourceDataSyncInput, ...func(*Options)) (*ListResourceDataSyncOutput, error) +} + +var _ ListResourceDataSyncAPIClient = (*Client)(nil) + +// ListResourceDataSyncPaginatorOptions is the paginator options for +// ListResourceDataSync +type ListResourceDataSyncPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListResourceDataSyncPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.ListResourceDataSync +type ListResourceDataSyncPaginator struct { + options ListResourceDataSyncPaginatorOptions + client ListResourceDataSyncAPIClient + params *ListResourceDataSyncInput + nextToken *string + firstPage bool + done bool +} + +// NewListResourceDataSyncPaginator returns a new ListResourceDataSyncPaginator +func NewListResourceDataSyncPaginator(client ListResourceDataSyncAPIClient, params *ListResourceDataSyncInput, optFns ...func(*ListResourceDataSyncPaginatorOptions)) *ListResourceDataSyncPaginator { + options := ListResourceDataSyncPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListResourceDataSyncPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListResourceDataSyncPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListResourceDataSync page. +func (p *ListResourceDataSyncPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListResourceDataSyncOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListResourceDataSync(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDocumentVersionsAPIClient is a client that implements the +// ListDocumentVersions operation. +type ListDocumentVersionsAPIClient interface { + ListDocumentVersions(context.Context, *ListDocumentVersionsInput, ...func(*Options)) (*ListDocumentVersionsOutput, error) +} + +var _ ListDocumentVersionsAPIClient = (*Client)(nil) + +// ListDocumentVersionsPaginatorOptions is the paginator options for +// ListDocumentVersions +type ListDocumentVersionsPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDocumentVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.ListDocumentVersions +type ListDocumentVersionsPaginator struct { + options ListDocumentVersionsPaginatorOptions + client ListDocumentVersionsAPIClient + params *ListDocumentVersionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListDocumentVersionsPaginator returns a new ListDocumentVersionsPaginator +func NewListDocumentVersionsPaginator(client ListDocumentVersionsAPIClient, params *ListDocumentVersionsInput, optFns ...func(*ListDocumentVersionsPaginatorOptions)) *ListDocumentVersionsPaginator { + options := ListDocumentVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDocumentVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDocumentVersionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDocumentVersions page. +func (p *ListDocumentVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDocumentVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListDocumentVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetOpsSummaryAPIClient is a client that implements the GetOpsSummary operation. +type GetOpsSummaryAPIClient interface { + GetOpsSummary(context.Context, *GetOpsSummaryInput, ...func(*Options)) (*GetOpsSummaryOutput, error) +} + +var _ GetOpsSummaryAPIClient = (*Client)(nil) + +// GetOpsSummaryPaginatorOptions is the paginator options for GetOpsSummary +type GetOpsSummaryPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetOpsSummaryPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.GetOpsSummary +type GetOpsSummaryPaginator struct { + options GetOpsSummaryPaginatorOptions + client GetOpsSummaryAPIClient + params *GetOpsSummaryInput + nextToken *string + firstPage bool + done bool +} + +// NewGetOpsSummaryPaginator returns a new GetOpsSummaryPaginator +func NewGetOpsSummaryPaginator(client GetOpsSummaryAPIClient, params *GetOpsSummaryInput, optFns ...func(*GetOpsSummaryPaginatorOptions)) *GetOpsSummaryPaginator { + options := GetOpsSummaryPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetOpsSummaryPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetOpsSummaryPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetOpsSummary page. +func (p *GetOpsSummaryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetOpsSummaryOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetOpsSummary(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeMaintenanceWindowsAPIClient is a client that implements the +// DescribeMaintenanceWindows operation. +type DescribeMaintenanceWindowsAPIClient interface { + DescribeMaintenanceWindows(context.Context, *DescribeMaintenanceWindowsInput, ...func(*Options)) (*DescribeMaintenanceWindowsOutput, error) +} + +var _ DescribeMaintenanceWindowsAPIClient = (*Client)(nil) + +// DescribeMaintenanceWindowsPaginatorOptions is the paginator options for +// DescribeMaintenanceWindows +type DescribeMaintenanceWindowsPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeMaintenanceWindowsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribeMaintenanceWindows +type DescribeMaintenanceWindowsPaginator struct { + options DescribeMaintenanceWindowsPaginatorOptions + client DescribeMaintenanceWindowsAPIClient + params *DescribeMaintenanceWindowsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeMaintenanceWindowsPaginator returns a new +// DescribeMaintenanceWindowsPaginator +func NewDescribeMaintenanceWindowsPaginator(client DescribeMaintenanceWindowsAPIClient, params *DescribeMaintenanceWindowsInput, optFns ...func(*DescribeMaintenanceWindowsPaginatorOptions)) *DescribeMaintenanceWindowsPaginator { + options := DescribeMaintenanceWindowsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeMaintenanceWindowsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeMaintenanceWindowsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeMaintenanceWindows page. +func (p *DescribeMaintenanceWindowsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeMaintenanceWindowsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeMaintenanceWindows(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeMaintenanceWindowExecutionTaskInvocationsAPIClient is a client that +// implements the DescribeMaintenanceWindowExecutionTaskInvocations operation. +type DescribeMaintenanceWindowExecutionTaskInvocationsAPIClient interface { + DescribeMaintenanceWindowExecutionTaskInvocations(context.Context, *DescribeMaintenanceWindowExecutionTaskInvocationsInput, ...func(*Options)) (*DescribeMaintenanceWindowExecutionTaskInvocationsOutput, error) +} + +var _ DescribeMaintenanceWindowExecutionTaskInvocationsAPIClient = (*Client)(nil) + +// DescribeMaintenanceWindowExecutionTaskInvocationsPaginatorOptions is the +// paginator options for DescribeMaintenanceWindowExecutionTaskInvocations +type DescribeMaintenanceWindowExecutionTaskInvocationsPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeMaintenanceWindowExecutionTaskInvocationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribeMaintenanceWindowExecutionTaskInvocations +type DescribeMaintenanceWindowExecutionTaskInvocationsPaginator struct { + options DescribeMaintenanceWindowExecutionTaskInvocationsPaginatorOptions + client DescribeMaintenanceWindowExecutionTaskInvocationsAPIClient + params *DescribeMaintenanceWindowExecutionTaskInvocationsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeMaintenanceWindowExecutionTaskInvocationsPaginator returns a new +// DescribeMaintenanceWindowExecutionTaskInvocationsPaginator +func NewDescribeMaintenanceWindowExecutionTaskInvocationsPaginator(client DescribeMaintenanceWindowExecutionTaskInvocationsAPIClient, params *DescribeMaintenanceWindowExecutionTaskInvocationsInput, optFns ...func(*DescribeMaintenanceWindowExecutionTaskInvocationsPaginatorOptions)) *DescribeMaintenanceWindowExecutionTaskInvocationsPaginator { + options := DescribeMaintenanceWindowExecutionTaskInvocationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeMaintenanceWindowExecutionTaskInvocationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeMaintenanceWindowExecutionTaskInvocationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeMaintenanceWindowExecutionTaskInvocations +// page. +func (p *DescribeMaintenanceWindowExecutionTaskInvocationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeMaintenanceWindowExecutionTaskInvocationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeMaintenanceWindowExecutionTaskInvocations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeParametersAPIClient is a client that implements the DescribeParameters +// operation. +type DescribeParametersAPIClient interface { + DescribeParameters(context.Context, *DescribeParametersInput, ...func(*Options)) (*DescribeParametersOutput, error) +} + +var _ DescribeParametersAPIClient = (*Client)(nil) + +// DescribeParametersPaginatorOptions is the paginator options for +// DescribeParameters +type DescribeParametersPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeParametersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribeParameters +type DescribeParametersPaginator struct { + options DescribeParametersPaginatorOptions + client DescribeParametersAPIClient + params *DescribeParametersInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeParametersPaginator returns a new DescribeParametersPaginator +func NewDescribeParametersPaginator(client DescribeParametersAPIClient, params *DescribeParametersInput, optFns ...func(*DescribeParametersPaginatorOptions)) *DescribeParametersPaginator { + options := DescribeParametersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeParametersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeParametersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeParameters page. +func (p *DescribeParametersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeParametersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeParameters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeMaintenanceWindowExecutionsAPIClient is a client that implements the +// DescribeMaintenanceWindowExecutions operation. +type DescribeMaintenanceWindowExecutionsAPIClient interface { + DescribeMaintenanceWindowExecutions(context.Context, *DescribeMaintenanceWindowExecutionsInput, ...func(*Options)) (*DescribeMaintenanceWindowExecutionsOutput, error) +} + +var _ DescribeMaintenanceWindowExecutionsAPIClient = (*Client)(nil) + +// DescribeMaintenanceWindowExecutionsPaginatorOptions is the paginator options for +// DescribeMaintenanceWindowExecutions +type DescribeMaintenanceWindowExecutionsPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeMaintenanceWindowExecutionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribeMaintenanceWindowExecutions +type DescribeMaintenanceWindowExecutionsPaginator struct { + options DescribeMaintenanceWindowExecutionsPaginatorOptions + client DescribeMaintenanceWindowExecutionsAPIClient + params *DescribeMaintenanceWindowExecutionsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeMaintenanceWindowExecutionsPaginator returns a new +// DescribeMaintenanceWindowExecutionsPaginator +func NewDescribeMaintenanceWindowExecutionsPaginator(client DescribeMaintenanceWindowExecutionsAPIClient, params *DescribeMaintenanceWindowExecutionsInput, optFns ...func(*DescribeMaintenanceWindowExecutionsPaginatorOptions)) *DescribeMaintenanceWindowExecutionsPaginator { + options := DescribeMaintenanceWindowExecutionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeMaintenanceWindowExecutionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeMaintenanceWindowExecutionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeMaintenanceWindowExecutions page. +func (p *DescribeMaintenanceWindowExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeMaintenanceWindowExecutionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeMaintenanceWindowExecutions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeAvailablePatchesAPIClient is a client that implements the +// DescribeAvailablePatches operation. +type DescribeAvailablePatchesAPIClient interface { + DescribeAvailablePatches(context.Context, *DescribeAvailablePatchesInput, ...func(*Options)) (*DescribeAvailablePatchesOutput, error) +} + +var _ DescribeAvailablePatchesAPIClient = (*Client)(nil) + +// DescribeAvailablePatchesPaginatorOptions is the paginator options for +// DescribeAvailablePatches +type DescribeAvailablePatchesPaginatorOptions struct { + // The maximum number of patches to return (per page). + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeAvailablePatchesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribeAvailablePatches +type DescribeAvailablePatchesPaginator struct { + options DescribeAvailablePatchesPaginatorOptions + client DescribeAvailablePatchesAPIClient + params *DescribeAvailablePatchesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeAvailablePatchesPaginator returns a new +// DescribeAvailablePatchesPaginator +func NewDescribeAvailablePatchesPaginator(client DescribeAvailablePatchesAPIClient, params *DescribeAvailablePatchesInput, optFns ...func(*DescribeAvailablePatchesPaginatorOptions)) *DescribeAvailablePatchesPaginator { + options := DescribeAvailablePatchesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeAvailablePatchesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeAvailablePatchesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeAvailablePatches page. +func (p *DescribeAvailablePatchesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeAvailablePatchesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeAvailablePatches(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeInstancePatchesAPIClient is a client that implements the +// DescribeInstancePatches operation. +type DescribeInstancePatchesAPIClient interface { + DescribeInstancePatches(context.Context, *DescribeInstancePatchesInput, ...func(*Options)) (*DescribeInstancePatchesOutput, error) +} + +var _ DescribeInstancePatchesAPIClient = (*Client)(nil) + +// DescribeInstancePatchesPaginatorOptions is the paginator options for +// DescribeInstancePatches +type DescribeInstancePatchesPaginatorOptions struct { + // The maximum number of patches to return (per page). + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeInstancePatchesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribeInstancePatches +type DescribeInstancePatchesPaginator struct { + options DescribeInstancePatchesPaginatorOptions + client DescribeInstancePatchesAPIClient + params *DescribeInstancePatchesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeInstancePatchesPaginator returns a new +// DescribeInstancePatchesPaginator +func NewDescribeInstancePatchesPaginator(client DescribeInstancePatchesAPIClient, params *DescribeInstancePatchesInput, optFns ...func(*DescribeInstancePatchesPaginatorOptions)) *DescribeInstancePatchesPaginator { + options := DescribeInstancePatchesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeInstancePatchesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeInstancePatchesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeInstancePatches page. +func (p *DescribeInstancePatchesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInstancePatchesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeInstancePatches(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeMaintenanceWindowTasksAPIClient is a client that implements the +// DescribeMaintenanceWindowTasks operation. +type DescribeMaintenanceWindowTasksAPIClient interface { + DescribeMaintenanceWindowTasks(context.Context, *DescribeMaintenanceWindowTasksInput, ...func(*Options)) (*DescribeMaintenanceWindowTasksOutput, error) +} + +var _ DescribeMaintenanceWindowTasksAPIClient = (*Client)(nil) + +// DescribeMaintenanceWindowTasksPaginatorOptions is the paginator options for +// DescribeMaintenanceWindowTasks +type DescribeMaintenanceWindowTasksPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeMaintenanceWindowTasksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribeMaintenanceWindowTasks +type DescribeMaintenanceWindowTasksPaginator struct { + options DescribeMaintenanceWindowTasksPaginatorOptions + client DescribeMaintenanceWindowTasksAPIClient + params *DescribeMaintenanceWindowTasksInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeMaintenanceWindowTasksPaginator returns a new +// DescribeMaintenanceWindowTasksPaginator +func NewDescribeMaintenanceWindowTasksPaginator(client DescribeMaintenanceWindowTasksAPIClient, params *DescribeMaintenanceWindowTasksInput, optFns ...func(*DescribeMaintenanceWindowTasksPaginatorOptions)) *DescribeMaintenanceWindowTasksPaginator { + options := DescribeMaintenanceWindowTasksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeMaintenanceWindowTasksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeMaintenanceWindowTasksPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeMaintenanceWindowTasks page. +func (p *DescribeMaintenanceWindowTasksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeMaintenanceWindowTasksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeMaintenanceWindowTasks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeInstancePatchStatesAPIClient is a client that implements the +// DescribeInstancePatchStates operation. +type DescribeInstancePatchStatesAPIClient interface { + DescribeInstancePatchStates(context.Context, *DescribeInstancePatchStatesInput, ...func(*Options)) (*DescribeInstancePatchStatesOutput, error) +} + +var _ DescribeInstancePatchStatesAPIClient = (*Client)(nil) + +// DescribeInstancePatchStatesPaginatorOptions is the paginator options for +// DescribeInstancePatchStates +type DescribeInstancePatchStatesPaginatorOptions struct { + // The maximum number of instances to return (per page). + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeInstancePatchStatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribeInstancePatchStates +type DescribeInstancePatchStatesPaginator struct { + options DescribeInstancePatchStatesPaginatorOptions + client DescribeInstancePatchStatesAPIClient + params *DescribeInstancePatchStatesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeInstancePatchStatesPaginator returns a new +// DescribeInstancePatchStatesPaginator +func NewDescribeInstancePatchStatesPaginator(client DescribeInstancePatchStatesAPIClient, params *DescribeInstancePatchStatesInput, optFns ...func(*DescribeInstancePatchStatesPaginatorOptions)) *DescribeInstancePatchStatesPaginator { + options := DescribeInstancePatchStatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeInstancePatchStatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeInstancePatchStatesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeInstancePatchStates page. +func (p *DescribeInstancePatchStatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInstancePatchStatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeInstancePatchStates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeAssociationExecutionTargetsAPIClient is a client that implements the +// DescribeAssociationExecutionTargets operation. +type DescribeAssociationExecutionTargetsAPIClient interface { + DescribeAssociationExecutionTargets(context.Context, *DescribeAssociationExecutionTargetsInput, ...func(*Options)) (*DescribeAssociationExecutionTargetsOutput, error) +} + +var _ DescribeAssociationExecutionTargetsAPIClient = (*Client)(nil) + +// DescribeAssociationExecutionTargetsPaginatorOptions is the paginator options for +// DescribeAssociationExecutionTargets +type DescribeAssociationExecutionTargetsPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeAssociationExecutionTargetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribeAssociationExecutionTargets +type DescribeAssociationExecutionTargetsPaginator struct { + options DescribeAssociationExecutionTargetsPaginatorOptions + client DescribeAssociationExecutionTargetsAPIClient + params *DescribeAssociationExecutionTargetsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeAssociationExecutionTargetsPaginator returns a new +// DescribeAssociationExecutionTargetsPaginator +func NewDescribeAssociationExecutionTargetsPaginator(client DescribeAssociationExecutionTargetsAPIClient, params *DescribeAssociationExecutionTargetsInput, optFns ...func(*DescribeAssociationExecutionTargetsPaginatorOptions)) *DescribeAssociationExecutionTargetsPaginator { + options := DescribeAssociationExecutionTargetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeAssociationExecutionTargetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeAssociationExecutionTargetsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeAssociationExecutionTargets page. +func (p *DescribeAssociationExecutionTargetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeAssociationExecutionTargetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeAssociationExecutionTargets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeMaintenanceWindowExecutionTasksAPIClient is a client that implements the +// DescribeMaintenanceWindowExecutionTasks operation. +type DescribeMaintenanceWindowExecutionTasksAPIClient interface { + DescribeMaintenanceWindowExecutionTasks(context.Context, *DescribeMaintenanceWindowExecutionTasksInput, ...func(*Options)) (*DescribeMaintenanceWindowExecutionTasksOutput, error) +} + +var _ DescribeMaintenanceWindowExecutionTasksAPIClient = (*Client)(nil) + +// DescribeMaintenanceWindowExecutionTasksPaginatorOptions is the paginator options +// for DescribeMaintenanceWindowExecutionTasks +type DescribeMaintenanceWindowExecutionTasksPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeMaintenanceWindowExecutionTasksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribeMaintenanceWindowExecutionTasks +type DescribeMaintenanceWindowExecutionTasksPaginator struct { + options DescribeMaintenanceWindowExecutionTasksPaginatorOptions + client DescribeMaintenanceWindowExecutionTasksAPIClient + params *DescribeMaintenanceWindowExecutionTasksInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeMaintenanceWindowExecutionTasksPaginator returns a new +// DescribeMaintenanceWindowExecutionTasksPaginator +func NewDescribeMaintenanceWindowExecutionTasksPaginator(client DescribeMaintenanceWindowExecutionTasksAPIClient, params *DescribeMaintenanceWindowExecutionTasksInput, optFns ...func(*DescribeMaintenanceWindowExecutionTasksPaginatorOptions)) *DescribeMaintenanceWindowExecutionTasksPaginator { + options := DescribeMaintenanceWindowExecutionTasksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeMaintenanceWindowExecutionTasksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeMaintenanceWindowExecutionTasksPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeMaintenanceWindowExecutionTasks page. +func (p *DescribeMaintenanceWindowExecutionTasksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeMaintenanceWindowExecutionTasksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeMaintenanceWindowExecutionTasks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeInstanceAssociationsStatusAPIClient is a client that implements the +// DescribeInstanceAssociationsStatus operation. +type DescribeInstanceAssociationsStatusAPIClient interface { + DescribeInstanceAssociationsStatus(context.Context, *DescribeInstanceAssociationsStatusInput, ...func(*Options)) (*DescribeInstanceAssociationsStatusOutput, error) +} + +var _ DescribeInstanceAssociationsStatusAPIClient = (*Client)(nil) + +// DescribeInstanceAssociationsStatusPaginatorOptions is the paginator options for +// DescribeInstanceAssociationsStatus +type DescribeInstanceAssociationsStatusPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeInstanceAssociationsStatusPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribeInstanceAssociationsStatus +type DescribeInstanceAssociationsStatusPaginator struct { + options DescribeInstanceAssociationsStatusPaginatorOptions + client DescribeInstanceAssociationsStatusAPIClient + params *DescribeInstanceAssociationsStatusInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeInstanceAssociationsStatusPaginator returns a new +// DescribeInstanceAssociationsStatusPaginator +func NewDescribeInstanceAssociationsStatusPaginator(client DescribeInstanceAssociationsStatusAPIClient, params *DescribeInstanceAssociationsStatusInput, optFns ...func(*DescribeInstanceAssociationsStatusPaginatorOptions)) *DescribeInstanceAssociationsStatusPaginator { + options := DescribeInstanceAssociationsStatusPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeInstanceAssociationsStatusPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeInstanceAssociationsStatusPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeInstanceAssociationsStatus page. +func (p *DescribeInstanceAssociationsStatusPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInstanceAssociationsStatusOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeInstanceAssociationsStatus(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListComplianceSummariesAPIClient is a client that implements the +// ListComplianceSummaries operation. +type ListComplianceSummariesAPIClient interface { + ListComplianceSummaries(context.Context, *ListComplianceSummariesInput, ...func(*Options)) (*ListComplianceSummariesOutput, error) +} + +var _ ListComplianceSummariesAPIClient = (*Client)(nil) + +// ListComplianceSummariesPaginatorOptions is the paginator options for +// ListComplianceSummaries +type ListComplianceSummariesPaginatorOptions struct { + // The maximum number of items to return for this call. Currently, you can specify + // null or 50. The call also returns a token that you can specify in a subsequent + // call to get the next set of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListComplianceSummariesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.ListComplianceSummaries +type ListComplianceSummariesPaginator struct { + options ListComplianceSummariesPaginatorOptions + client ListComplianceSummariesAPIClient + params *ListComplianceSummariesInput + nextToken *string + firstPage bool + done bool +} + +// NewListComplianceSummariesPaginator returns a new +// ListComplianceSummariesPaginator +func NewListComplianceSummariesPaginator(client ListComplianceSummariesAPIClient, params *ListComplianceSummariesInput, optFns ...func(*ListComplianceSummariesPaginatorOptions)) *ListComplianceSummariesPaginator { + options := ListComplianceSummariesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListComplianceSummariesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListComplianceSummariesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListComplianceSummaries page. +func (p *ListComplianceSummariesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListComplianceSummariesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListComplianceSummaries(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeAssociationExecutionsAPIClient is a client that implements the +// DescribeAssociationExecutions operation. +type DescribeAssociationExecutionsAPIClient interface { + DescribeAssociationExecutions(context.Context, *DescribeAssociationExecutionsInput, ...func(*Options)) (*DescribeAssociationExecutionsOutput, error) +} + +var _ DescribeAssociationExecutionsAPIClient = (*Client)(nil) + +// DescribeAssociationExecutionsPaginatorOptions is the paginator options for +// DescribeAssociationExecutions +type DescribeAssociationExecutionsPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeAssociationExecutionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribeAssociationExecutions +type DescribeAssociationExecutionsPaginator struct { + options DescribeAssociationExecutionsPaginatorOptions + client DescribeAssociationExecutionsAPIClient + params *DescribeAssociationExecutionsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeAssociationExecutionsPaginator returns a new +// DescribeAssociationExecutionsPaginator +func NewDescribeAssociationExecutionsPaginator(client DescribeAssociationExecutionsAPIClient, params *DescribeAssociationExecutionsInput, optFns ...func(*DescribeAssociationExecutionsPaginatorOptions)) *DescribeAssociationExecutionsPaginator { + options := DescribeAssociationExecutionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeAssociationExecutionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeAssociationExecutionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeAssociationExecutions page. +func (p *DescribeAssociationExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeAssociationExecutionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeAssociationExecutions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeAutomationStepExecutionsAPIClient is a client that implements the +// DescribeAutomationStepExecutions operation. +type DescribeAutomationStepExecutionsAPIClient interface { + DescribeAutomationStepExecutions(context.Context, *DescribeAutomationStepExecutionsInput, ...func(*Options)) (*DescribeAutomationStepExecutionsOutput, error) +} + +var _ DescribeAutomationStepExecutionsAPIClient = (*Client)(nil) + +// DescribeAutomationStepExecutionsPaginatorOptions is the paginator options for +// DescribeAutomationStepExecutions +type DescribeAutomationStepExecutionsPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeAutomationStepExecutionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribeAutomationStepExecutions +type DescribeAutomationStepExecutionsPaginator struct { + options DescribeAutomationStepExecutionsPaginatorOptions + client DescribeAutomationStepExecutionsAPIClient + params *DescribeAutomationStepExecutionsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeAutomationStepExecutionsPaginator returns a new +// DescribeAutomationStepExecutionsPaginator +func NewDescribeAutomationStepExecutionsPaginator(client DescribeAutomationStepExecutionsAPIClient, params *DescribeAutomationStepExecutionsInput, optFns ...func(*DescribeAutomationStepExecutionsPaginatorOptions)) *DescribeAutomationStepExecutionsPaginator { + options := DescribeAutomationStepExecutionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeAutomationStepExecutionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeAutomationStepExecutionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeAutomationStepExecutions page. +func (p *DescribeAutomationStepExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeAutomationStepExecutionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeAutomationStepExecutions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeInstancePatchStatesForPatchGroupAPIClient is a client that implements +// the DescribeInstancePatchStatesForPatchGroup operation. +type DescribeInstancePatchStatesForPatchGroupAPIClient interface { + DescribeInstancePatchStatesForPatchGroup(context.Context, *DescribeInstancePatchStatesForPatchGroupInput, ...func(*Options)) (*DescribeInstancePatchStatesForPatchGroupOutput, error) +} + +var _ DescribeInstancePatchStatesForPatchGroupAPIClient = (*Client)(nil) + +// DescribeInstancePatchStatesForPatchGroupPaginatorOptions is the paginator +// options for DescribeInstancePatchStatesForPatchGroup +type DescribeInstancePatchStatesForPatchGroupPaginatorOptions struct { + // The maximum number of patches to return (per page). + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeInstancePatchStatesForPatchGroupPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribeInstancePatchStatesForPatchGroup +type DescribeInstancePatchStatesForPatchGroupPaginator struct { + options DescribeInstancePatchStatesForPatchGroupPaginatorOptions + client DescribeInstancePatchStatesForPatchGroupAPIClient + params *DescribeInstancePatchStatesForPatchGroupInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeInstancePatchStatesForPatchGroupPaginator returns a new +// DescribeInstancePatchStatesForPatchGroupPaginator +func NewDescribeInstancePatchStatesForPatchGroupPaginator(client DescribeInstancePatchStatesForPatchGroupAPIClient, params *DescribeInstancePatchStatesForPatchGroupInput, optFns ...func(*DescribeInstancePatchStatesForPatchGroupPaginatorOptions)) *DescribeInstancePatchStatesForPatchGroupPaginator { + options := DescribeInstancePatchStatesForPatchGroupPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeInstancePatchStatesForPatchGroupPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeInstancePatchStatesForPatchGroupPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeInstancePatchStatesForPatchGroup page. +func (p *DescribeInstancePatchStatesForPatchGroupPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInstancePatchStatesForPatchGroupOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeInstancePatchStatesForPatchGroup(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetParameterHistoryAPIClient is a client that implements the GetParameterHistory +// operation. +type GetParameterHistoryAPIClient interface { + GetParameterHistory(context.Context, *GetParameterHistoryInput, ...func(*Options)) (*GetParameterHistoryOutput, error) +} + +var _ GetParameterHistoryAPIClient = (*Client)(nil) + +// GetParameterHistoryPaginatorOptions is the paginator options for +// GetParameterHistory +type GetParameterHistoryPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetParameterHistoryPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.GetParameterHistory +type GetParameterHistoryPaginator struct { + options GetParameterHistoryPaginatorOptions + client GetParameterHistoryAPIClient + params *GetParameterHistoryInput + nextToken *string + firstPage bool + done bool +} + +// NewGetParameterHistoryPaginator returns a new GetParameterHistoryPaginator +func NewGetParameterHistoryPaginator(client GetParameterHistoryAPIClient, params *GetParameterHistoryInput, optFns ...func(*GetParameterHistoryPaginatorOptions)) *GetParameterHistoryPaginator { + options := GetParameterHistoryPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetParameterHistoryPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetParameterHistoryPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetParameterHistory page. +func (p *GetParameterHistoryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetParameterHistoryOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetParameterHistory(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDocumentsAPIClient is a client that implements the ListDocuments operation. +type ListDocumentsAPIClient interface { + ListDocuments(context.Context, *ListDocumentsInput, ...func(*Options)) (*ListDocumentsOutput, error) +} + +var _ ListDocumentsAPIClient = (*Client)(nil) + +// ListDocumentsPaginatorOptions is the paginator options for ListDocuments +type ListDocumentsPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDocumentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.ListDocuments +type ListDocumentsPaginator struct { + options ListDocumentsPaginatorOptions + client ListDocumentsAPIClient + params *ListDocumentsInput + nextToken *string + firstPage bool + done bool +} + +// NewListDocumentsPaginator returns a new ListDocumentsPaginator +func NewListDocumentsPaginator(client ListDocumentsAPIClient, params *ListDocumentsInput, optFns ...func(*ListDocumentsPaginatorOptions)) *ListDocumentsPaginator { + options := ListDocumentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDocumentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDocumentsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDocuments page. +func (p *ListDocumentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDocumentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListDocuments(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribePatchBaselinesAPIClient is a client that implements the +// DescribePatchBaselines operation. +type DescribePatchBaselinesAPIClient interface { + DescribePatchBaselines(context.Context, *DescribePatchBaselinesInput, ...func(*Options)) (*DescribePatchBaselinesOutput, error) +} + +var _ DescribePatchBaselinesAPIClient = (*Client)(nil) + +// DescribePatchBaselinesPaginatorOptions is the paginator options for +// DescribePatchBaselines +type DescribePatchBaselinesPaginatorOptions struct { + // The maximum number of patch baselines to return (per page). + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribePatchBaselinesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribePatchBaselines +type DescribePatchBaselinesPaginator struct { + options DescribePatchBaselinesPaginatorOptions + client DescribePatchBaselinesAPIClient + params *DescribePatchBaselinesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribePatchBaselinesPaginator returns a new DescribePatchBaselinesPaginator +func NewDescribePatchBaselinesPaginator(client DescribePatchBaselinesAPIClient, params *DescribePatchBaselinesInput, optFns ...func(*DescribePatchBaselinesPaginatorOptions)) *DescribePatchBaselinesPaginator { + options := DescribePatchBaselinesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribePatchBaselinesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribePatchBaselinesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribePatchBaselines page. +func (p *DescribePatchBaselinesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribePatchBaselinesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribePatchBaselines(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListCommandInvocationsAPIClient is a client that implements the +// ListCommandInvocations operation. +type ListCommandInvocationsAPIClient interface { + ListCommandInvocations(context.Context, *ListCommandInvocationsInput, ...func(*Options)) (*ListCommandInvocationsOutput, error) +} + +var _ ListCommandInvocationsAPIClient = (*Client)(nil) + +// ListCommandInvocationsPaginatorOptions is the paginator options for +// ListCommandInvocations +type ListCommandInvocationsPaginatorOptions struct { + // (Optional) The maximum number of items to return for this call. The call also + // returns a token that you can specify in a subsequent call to get the next set of + // results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListCommandInvocationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.ListCommandInvocations +type ListCommandInvocationsPaginator struct { + options ListCommandInvocationsPaginatorOptions + client ListCommandInvocationsAPIClient + params *ListCommandInvocationsInput + nextToken *string + firstPage bool + done bool +} + +// NewListCommandInvocationsPaginator returns a new ListCommandInvocationsPaginator +func NewListCommandInvocationsPaginator(client ListCommandInvocationsAPIClient, params *ListCommandInvocationsInput, optFns ...func(*ListCommandInvocationsPaginatorOptions)) *ListCommandInvocationsPaginator { + options := ListCommandInvocationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListCommandInvocationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCommandInvocationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListCommandInvocations page. +func (p *ListCommandInvocationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCommandInvocationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListCommandInvocations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeOpsItemsAPIClient is a client that implements the DescribeOpsItems +// operation. +type DescribeOpsItemsAPIClient interface { + DescribeOpsItems(context.Context, *DescribeOpsItemsInput, ...func(*Options)) (*DescribeOpsItemsOutput, error) +} + +var _ DescribeOpsItemsAPIClient = (*Client)(nil) + +// DescribeOpsItemsPaginatorOptions is the paginator options for DescribeOpsItems +type DescribeOpsItemsPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeOpsItemsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribeOpsItems +type DescribeOpsItemsPaginator struct { + options DescribeOpsItemsPaginatorOptions + client DescribeOpsItemsAPIClient + params *DescribeOpsItemsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeOpsItemsPaginator returns a new DescribeOpsItemsPaginator +func NewDescribeOpsItemsPaginator(client DescribeOpsItemsAPIClient, params *DescribeOpsItemsInput, optFns ...func(*DescribeOpsItemsPaginatorOptions)) *DescribeOpsItemsPaginator { + options := DescribeOpsItemsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeOpsItemsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeOpsItemsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeOpsItems page. +func (p *DescribeOpsItemsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeOpsItemsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeOpsItems(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeAutomationExecutionsAPIClient is a client that implements the +// DescribeAutomationExecutions operation. +type DescribeAutomationExecutionsAPIClient interface { + DescribeAutomationExecutions(context.Context, *DescribeAutomationExecutionsInput, ...func(*Options)) (*DescribeAutomationExecutionsOutput, error) +} + +var _ DescribeAutomationExecutionsAPIClient = (*Client)(nil) + +// DescribeAutomationExecutionsPaginatorOptions is the paginator options for +// DescribeAutomationExecutions +type DescribeAutomationExecutionsPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeAutomationExecutionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribeAutomationExecutions +type DescribeAutomationExecutionsPaginator struct { + options DescribeAutomationExecutionsPaginatorOptions + client DescribeAutomationExecutionsAPIClient + params *DescribeAutomationExecutionsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeAutomationExecutionsPaginator returns a new +// DescribeAutomationExecutionsPaginator +func NewDescribeAutomationExecutionsPaginator(client DescribeAutomationExecutionsAPIClient, params *DescribeAutomationExecutionsInput, optFns ...func(*DescribeAutomationExecutionsPaginatorOptions)) *DescribeAutomationExecutionsPaginator { + options := DescribeAutomationExecutionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeAutomationExecutionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeAutomationExecutionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeAutomationExecutions page. +func (p *DescribeAutomationExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeAutomationExecutionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeAutomationExecutions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeEffectiveInstanceAssociationsAPIClient is a client that implements the +// DescribeEffectiveInstanceAssociations operation. +type DescribeEffectiveInstanceAssociationsAPIClient interface { + DescribeEffectiveInstanceAssociations(context.Context, *DescribeEffectiveInstanceAssociationsInput, ...func(*Options)) (*DescribeEffectiveInstanceAssociationsOutput, error) +} + +var _ DescribeEffectiveInstanceAssociationsAPIClient = (*Client)(nil) + +// DescribeEffectiveInstanceAssociationsPaginatorOptions is the paginator options +// for DescribeEffectiveInstanceAssociations +type DescribeEffectiveInstanceAssociationsPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeEffectiveInstanceAssociationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribeEffectiveInstanceAssociations +type DescribeEffectiveInstanceAssociationsPaginator struct { + options DescribeEffectiveInstanceAssociationsPaginatorOptions + client DescribeEffectiveInstanceAssociationsAPIClient + params *DescribeEffectiveInstanceAssociationsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeEffectiveInstanceAssociationsPaginator returns a new +// DescribeEffectiveInstanceAssociationsPaginator +func NewDescribeEffectiveInstanceAssociationsPaginator(client DescribeEffectiveInstanceAssociationsAPIClient, params *DescribeEffectiveInstanceAssociationsInput, optFns ...func(*DescribeEffectiveInstanceAssociationsPaginatorOptions)) *DescribeEffectiveInstanceAssociationsPaginator { + options := DescribeEffectiveInstanceAssociationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeEffectiveInstanceAssociationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEffectiveInstanceAssociationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeEffectiveInstanceAssociations page. +func (p *DescribeEffectiveInstanceAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEffectiveInstanceAssociationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeEffectiveInstanceAssociations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribePatchGroupsAPIClient is a client that implements the DescribePatchGroups +// operation. +type DescribePatchGroupsAPIClient interface { + DescribePatchGroups(context.Context, *DescribePatchGroupsInput, ...func(*Options)) (*DescribePatchGroupsOutput, error) +} + +var _ DescribePatchGroupsAPIClient = (*Client)(nil) + +// DescribePatchGroupsPaginatorOptions is the paginator options for +// DescribePatchGroups +type DescribePatchGroupsPaginatorOptions struct { + // The maximum number of patch groups to return (per page). + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribePatchGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribePatchGroups +type DescribePatchGroupsPaginator struct { + options DescribePatchGroupsPaginatorOptions + client DescribePatchGroupsAPIClient + params *DescribePatchGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribePatchGroupsPaginator returns a new DescribePatchGroupsPaginator +func NewDescribePatchGroupsPaginator(client DescribePatchGroupsAPIClient, params *DescribePatchGroupsInput, optFns ...func(*DescribePatchGroupsPaginatorOptions)) *DescribePatchGroupsPaginator { + options := DescribePatchGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribePatchGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribePatchGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribePatchGroups page. +func (p *DescribePatchGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribePatchGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribePatchGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetParametersByPathAPIClient is a client that implements the GetParametersByPath +// operation. +type GetParametersByPathAPIClient interface { + GetParametersByPath(context.Context, *GetParametersByPathInput, ...func(*Options)) (*GetParametersByPathOutput, error) +} + +var _ GetParametersByPathAPIClient = (*Client)(nil) + +// GetParametersByPathPaginatorOptions is the paginator options for +// GetParametersByPath +type GetParametersByPathPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetParametersByPathPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.GetParametersByPath +type GetParametersByPathPaginator struct { + options GetParametersByPathPaginatorOptions + client GetParametersByPathAPIClient + params *GetParametersByPathInput + nextToken *string + firstPage bool + done bool +} + +// NewGetParametersByPathPaginator returns a new GetParametersByPathPaginator +func NewGetParametersByPathPaginator(client GetParametersByPathAPIClient, params *GetParametersByPathInput, optFns ...func(*GetParametersByPathPaginatorOptions)) *GetParametersByPathPaginator { + options := GetParametersByPathPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetParametersByPathPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetParametersByPathPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetParametersByPath page. +func (p *GetParametersByPathPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetParametersByPathOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetParametersByPath(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeMaintenanceWindowsForTargetAPIClient is a client that implements the +// DescribeMaintenanceWindowsForTarget operation. +type DescribeMaintenanceWindowsForTargetAPIClient interface { + DescribeMaintenanceWindowsForTarget(context.Context, *DescribeMaintenanceWindowsForTargetInput, ...func(*Options)) (*DescribeMaintenanceWindowsForTargetOutput, error) +} + +var _ DescribeMaintenanceWindowsForTargetAPIClient = (*Client)(nil) + +// DescribeMaintenanceWindowsForTargetPaginatorOptions is the paginator options for +// DescribeMaintenanceWindowsForTarget +type DescribeMaintenanceWindowsForTargetPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeMaintenanceWindowsForTargetPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribeMaintenanceWindowsForTarget +type DescribeMaintenanceWindowsForTargetPaginator struct { + options DescribeMaintenanceWindowsForTargetPaginatorOptions + client DescribeMaintenanceWindowsForTargetAPIClient + params *DescribeMaintenanceWindowsForTargetInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeMaintenanceWindowsForTargetPaginator returns a new +// DescribeMaintenanceWindowsForTargetPaginator +func NewDescribeMaintenanceWindowsForTargetPaginator(client DescribeMaintenanceWindowsForTargetAPIClient, params *DescribeMaintenanceWindowsForTargetInput, optFns ...func(*DescribeMaintenanceWindowsForTargetPaginatorOptions)) *DescribeMaintenanceWindowsForTargetPaginator { + options := DescribeMaintenanceWindowsForTargetPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeMaintenanceWindowsForTargetPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeMaintenanceWindowsForTargetPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeMaintenanceWindowsForTarget page. +func (p *DescribeMaintenanceWindowsForTargetPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeMaintenanceWindowsForTargetOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeMaintenanceWindowsForTarget(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListAssociationVersionsAPIClient is a client that implements the +// ListAssociationVersions operation. +type ListAssociationVersionsAPIClient interface { + ListAssociationVersions(context.Context, *ListAssociationVersionsInput, ...func(*Options)) (*ListAssociationVersionsOutput, error) +} + +var _ ListAssociationVersionsAPIClient = (*Client)(nil) + +// ListAssociationVersionsPaginatorOptions is the paginator options for +// ListAssociationVersions +type ListAssociationVersionsPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAssociationVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.ListAssociationVersions +type ListAssociationVersionsPaginator struct { + options ListAssociationVersionsPaginatorOptions + client ListAssociationVersionsAPIClient + params *ListAssociationVersionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListAssociationVersionsPaginator returns a new +// ListAssociationVersionsPaginator +func NewListAssociationVersionsPaginator(client ListAssociationVersionsAPIClient, params *ListAssociationVersionsInput, optFns ...func(*ListAssociationVersionsPaginatorOptions)) *ListAssociationVersionsPaginator { + options := ListAssociationVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAssociationVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAssociationVersionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAssociationVersions page. +func (p *ListAssociationVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAssociationVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListAssociationVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListCommandsAPIClient is a client that implements the ListCommands operation. +type ListCommandsAPIClient interface { + ListCommands(context.Context, *ListCommandsInput, ...func(*Options)) (*ListCommandsOutput, error) +} + +var _ ListCommandsAPIClient = (*Client)(nil) + +// ListCommandsPaginatorOptions is the paginator options for ListCommands +type ListCommandsPaginatorOptions struct { + // (Optional) The maximum number of items to return for this call. The call also + // returns a token that you can specify in a subsequent call to get the next set of + // results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListCommandsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.ListCommands +type ListCommandsPaginator struct { + options ListCommandsPaginatorOptions + client ListCommandsAPIClient + params *ListCommandsInput + nextToken *string + firstPage bool + done bool +} + +// NewListCommandsPaginator returns a new ListCommandsPaginator +func NewListCommandsPaginator(client ListCommandsAPIClient, params *ListCommandsInput, optFns ...func(*ListCommandsPaginatorOptions)) *ListCommandsPaginator { + options := ListCommandsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListCommandsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCommandsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListCommands page. +func (p *ListCommandsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCommandsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListCommands(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeInstanceInformationAPIClient is a client that implements the +// DescribeInstanceInformation operation. +type DescribeInstanceInformationAPIClient interface { + DescribeInstanceInformation(context.Context, *DescribeInstanceInformationInput, ...func(*Options)) (*DescribeInstanceInformationOutput, error) +} + +var _ DescribeInstanceInformationAPIClient = (*Client)(nil) + +// DescribeInstanceInformationPaginatorOptions is the paginator options for +// DescribeInstanceInformation +type DescribeInstanceInformationPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeInstanceInformationPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribeInstanceInformation +type DescribeInstanceInformationPaginator struct { + options DescribeInstanceInformationPaginatorOptions + client DescribeInstanceInformationAPIClient + params *DescribeInstanceInformationInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeInstanceInformationPaginator returns a new +// DescribeInstanceInformationPaginator +func NewDescribeInstanceInformationPaginator(client DescribeInstanceInformationAPIClient, params *DescribeInstanceInformationInput, optFns ...func(*DescribeInstanceInformationPaginatorOptions)) *DescribeInstanceInformationPaginator { + options := DescribeInstanceInformationPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeInstanceInformationPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeInstanceInformationPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeInstanceInformation page. +func (p *DescribeInstanceInformationPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInstanceInformationOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeInstanceInformation(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListComplianceItemsAPIClient is a client that implements the ListComplianceItems +// operation. +type ListComplianceItemsAPIClient interface { + ListComplianceItems(context.Context, *ListComplianceItemsInput, ...func(*Options)) (*ListComplianceItemsOutput, error) +} + +var _ ListComplianceItemsAPIClient = (*Client)(nil) + +// ListComplianceItemsPaginatorOptions is the paginator options for +// ListComplianceItems +type ListComplianceItemsPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListComplianceItemsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.ListComplianceItems +type ListComplianceItemsPaginator struct { + options ListComplianceItemsPaginatorOptions + client ListComplianceItemsAPIClient + params *ListComplianceItemsInput + nextToken *string + firstPage bool + done bool +} + +// NewListComplianceItemsPaginator returns a new ListComplianceItemsPaginator +func NewListComplianceItemsPaginator(client ListComplianceItemsAPIClient, params *ListComplianceItemsInput, optFns ...func(*ListComplianceItemsPaginatorOptions)) *ListComplianceItemsPaginator { + options := ListComplianceItemsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListComplianceItemsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListComplianceItemsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListComplianceItems page. +func (p *ListComplianceItemsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListComplianceItemsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListComplianceItems(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeSessionsAPIClient is a client that implements the DescribeSessions +// operation. +type DescribeSessionsAPIClient interface { + DescribeSessions(context.Context, *DescribeSessionsInput, ...func(*Options)) (*DescribeSessionsOutput, error) +} + +var _ DescribeSessionsAPIClient = (*Client)(nil) + +// DescribeSessionsPaginatorOptions is the paginator options for DescribeSessions +type DescribeSessionsPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeSessionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribeSessions +type DescribeSessionsPaginator struct { + options DescribeSessionsPaginatorOptions + client DescribeSessionsAPIClient + params *DescribeSessionsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeSessionsPaginator returns a new DescribeSessionsPaginator +func NewDescribeSessionsPaginator(client DescribeSessionsAPIClient, params *DescribeSessionsInput, optFns ...func(*DescribeSessionsPaginatorOptions)) *DescribeSessionsPaginator { + options := DescribeSessionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeSessionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeSessionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeSessions page. +func (p *DescribeSessionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeSessionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeSessions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeActivationsAPIClient is a client that implements the DescribeActivations +// operation. +type DescribeActivationsAPIClient interface { + DescribeActivations(context.Context, *DescribeActivationsInput, ...func(*Options)) (*DescribeActivationsOutput, error) +} + +var _ DescribeActivationsAPIClient = (*Client)(nil) + +// DescribeActivationsPaginatorOptions is the paginator options for +// DescribeActivations +type DescribeActivationsPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeActivationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribeActivations +type DescribeActivationsPaginator struct { + options DescribeActivationsPaginatorOptions + client DescribeActivationsAPIClient + params *DescribeActivationsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeActivationsPaginator returns a new DescribeActivationsPaginator +func NewDescribeActivationsPaginator(client DescribeActivationsAPIClient, params *DescribeActivationsInput, optFns ...func(*DescribeActivationsPaginatorOptions)) *DescribeActivationsPaginator { + options := DescribeActivationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeActivationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeActivationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeActivations page. +func (p *DescribeActivationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeActivationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeActivations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeInventoryDeletionsAPIClient is a client that implements the +// DescribeInventoryDeletions operation. +type DescribeInventoryDeletionsAPIClient interface { + DescribeInventoryDeletions(context.Context, *DescribeInventoryDeletionsInput, ...func(*Options)) (*DescribeInventoryDeletionsOutput, error) +} + +var _ DescribeInventoryDeletionsAPIClient = (*Client)(nil) + +// DescribeInventoryDeletionsPaginatorOptions is the paginator options for +// DescribeInventoryDeletions +type DescribeInventoryDeletionsPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeInventoryDeletionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribeInventoryDeletions +type DescribeInventoryDeletionsPaginator struct { + options DescribeInventoryDeletionsPaginatorOptions + client DescribeInventoryDeletionsAPIClient + params *DescribeInventoryDeletionsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeInventoryDeletionsPaginator returns a new +// DescribeInventoryDeletionsPaginator +func NewDescribeInventoryDeletionsPaginator(client DescribeInventoryDeletionsAPIClient, params *DescribeInventoryDeletionsInput, optFns ...func(*DescribeInventoryDeletionsPaginatorOptions)) *DescribeInventoryDeletionsPaginator { + options := DescribeInventoryDeletionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeInventoryDeletionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeInventoryDeletionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeInventoryDeletions page. +func (p *DescribeInventoryDeletionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInventoryDeletionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeInventoryDeletions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeMaintenanceWindowTargetsAPIClient is a client that implements the +// DescribeMaintenanceWindowTargets operation. +type DescribeMaintenanceWindowTargetsAPIClient interface { + DescribeMaintenanceWindowTargets(context.Context, *DescribeMaintenanceWindowTargetsInput, ...func(*Options)) (*DescribeMaintenanceWindowTargetsOutput, error) +} + +var _ DescribeMaintenanceWindowTargetsAPIClient = (*Client)(nil) + +// DescribeMaintenanceWindowTargetsPaginatorOptions is the paginator options for +// DescribeMaintenanceWindowTargets +type DescribeMaintenanceWindowTargetsPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeMaintenanceWindowTargetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribeMaintenanceWindowTargets +type DescribeMaintenanceWindowTargetsPaginator struct { + options DescribeMaintenanceWindowTargetsPaginatorOptions + client DescribeMaintenanceWindowTargetsAPIClient + params *DescribeMaintenanceWindowTargetsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeMaintenanceWindowTargetsPaginator returns a new +// DescribeMaintenanceWindowTargetsPaginator +func NewDescribeMaintenanceWindowTargetsPaginator(client DescribeMaintenanceWindowTargetsAPIClient, params *DescribeMaintenanceWindowTargetsInput, optFns ...func(*DescribeMaintenanceWindowTargetsPaginatorOptions)) *DescribeMaintenanceWindowTargetsPaginator { + options := DescribeMaintenanceWindowTargetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeMaintenanceWindowTargetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeMaintenanceWindowTargetsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeMaintenanceWindowTargets page. +func (p *DescribeMaintenanceWindowTargetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeMaintenanceWindowTargetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeMaintenanceWindowTargets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListAssociationsAPIClient is a client that implements the ListAssociations +// operation. +type ListAssociationsAPIClient interface { + ListAssociations(context.Context, *ListAssociationsInput, ...func(*Options)) (*ListAssociationsOutput, error) +} + +var _ ListAssociationsAPIClient = (*Client)(nil) + +// ListAssociationsPaginatorOptions is the paginator options for ListAssociations +type ListAssociationsPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAssociationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.ListAssociations +type ListAssociationsPaginator struct { + options ListAssociationsPaginatorOptions + client ListAssociationsAPIClient + params *ListAssociationsInput + nextToken *string + firstPage bool + done bool +} + +// NewListAssociationsPaginator returns a new ListAssociationsPaginator +func NewListAssociationsPaginator(client ListAssociationsAPIClient, params *ListAssociationsInput, optFns ...func(*ListAssociationsPaginatorOptions)) *ListAssociationsPaginator { + options := ListAssociationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAssociationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAssociationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAssociations page. +func (p *ListAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAssociationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListAssociations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetInventorySchemaAPIClient is a client that implements the GetInventorySchema +// operation. +type GetInventorySchemaAPIClient interface { + GetInventorySchema(context.Context, *GetInventorySchemaInput, ...func(*Options)) (*GetInventorySchemaOutput, error) +} + +var _ GetInventorySchemaAPIClient = (*Client)(nil) + +// GetInventorySchemaPaginatorOptions is the paginator options for +// GetInventorySchema +type GetInventorySchemaPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetInventorySchemaPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.GetInventorySchema +type GetInventorySchemaPaginator struct { + options GetInventorySchemaPaginatorOptions + client GetInventorySchemaAPIClient + params *GetInventorySchemaInput + nextToken *string + firstPage bool + done bool +} + +// NewGetInventorySchemaPaginator returns a new GetInventorySchemaPaginator +func NewGetInventorySchemaPaginator(client GetInventorySchemaAPIClient, params *GetInventorySchemaInput, optFns ...func(*GetInventorySchemaPaginatorOptions)) *GetInventorySchemaPaginator { + options := GetInventorySchemaPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetInventorySchemaPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetInventorySchemaPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetInventorySchema page. +func (p *GetInventorySchemaPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetInventorySchemaOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetInventorySchema(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/sso/go.sum b/service/sso/go.sum index c669e324b14..32595049f96 100644 --- a/service/sso/go.sum +++ b/service/sso/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/sso/paginators.go b/service/sso/paginators.go new file mode 100644 index 00000000000..ea59e073a53 --- /dev/null +++ b/service/sso/paginators.go @@ -0,0 +1,157 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sso + +import ( + "context" + "fmt" +) + +// ListAccountsAPIClient is a client that implements the ListAccounts operation. +type ListAccountsAPIClient interface { + ListAccounts(context.Context, *ListAccountsInput, ...func(*Options)) (*ListAccountsOutput, error) +} + +var _ ListAccountsAPIClient = (*Client)(nil) + +// ListAccountsPaginatorOptions is the paginator options for ListAccounts +type ListAccountsPaginatorOptions struct { + // This is the number of items clients can request per page. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAccountsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sso.ListAccounts +type ListAccountsPaginator struct { + options ListAccountsPaginatorOptions + client ListAccountsAPIClient + params *ListAccountsInput + nextToken *string + firstPage bool + done bool +} + +// NewListAccountsPaginator returns a new ListAccountsPaginator +func NewListAccountsPaginator(client ListAccountsAPIClient, params *ListAccountsInput, optFns ...func(*ListAccountsPaginatorOptions)) *ListAccountsPaginator { + options := ListAccountsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAccountsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAccountsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAccounts page. +func (p *ListAccountsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccountsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListAccounts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListAccountRolesAPIClient is a client that implements the ListAccountRoles +// operation. +type ListAccountRolesAPIClient interface { + ListAccountRoles(context.Context, *ListAccountRolesInput, ...func(*Options)) (*ListAccountRolesOutput, error) +} + +var _ ListAccountRolesAPIClient = (*Client)(nil) + +// ListAccountRolesPaginatorOptions is the paginator options for ListAccountRoles +type ListAccountRolesPaginatorOptions struct { + // The number of items that clients can request per page. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAccountRolesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sso.ListAccountRoles +type ListAccountRolesPaginator struct { + options ListAccountRolesPaginatorOptions + client ListAccountRolesAPIClient + params *ListAccountRolesInput + nextToken *string + firstPage bool + done bool +} + +// NewListAccountRolesPaginator returns a new ListAccountRolesPaginator +func NewListAccountRolesPaginator(client ListAccountRolesAPIClient, params *ListAccountRolesInput, optFns ...func(*ListAccountRolesPaginatorOptions)) *ListAccountRolesPaginator { + options := ListAccountRolesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAccountRolesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAccountRolesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAccountRoles page. +func (p *ListAccountRolesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccountRolesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListAccountRoles(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/ssoadmin/go.sum b/service/ssoadmin/go.sum index c669e324b14..32595049f96 100644 --- a/service/ssoadmin/go.sum +++ b/service/ssoadmin/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/ssoadmin/paginators.go b/service/ssoadmin/paginators.go new file mode 100644 index 00000000000..a6ba0cf0200 --- /dev/null +++ b/service/ssoadmin/paginators.go @@ -0,0 +1,768 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssoadmin + +import ( + "context" + "fmt" +) + +// ListInstancesAPIClient is a client that implements the ListInstances operation. +type ListInstancesAPIClient interface { + ListInstances(context.Context, *ListInstancesInput, ...func(*Options)) (*ListInstancesOutput, error) +} + +var _ ListInstancesAPIClient = (*Client)(nil) + +// ListInstancesPaginatorOptions is the paginator options for ListInstances +type ListInstancesPaginatorOptions struct { + // The maximum number of results to display for the instance. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListInstancesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssoadmin.ListInstances +type ListInstancesPaginator struct { + options ListInstancesPaginatorOptions + client ListInstancesAPIClient + params *ListInstancesInput + nextToken *string + firstPage bool + done bool +} + +// NewListInstancesPaginator returns a new ListInstancesPaginator +func NewListInstancesPaginator(client ListInstancesAPIClient, params *ListInstancesInput, optFns ...func(*ListInstancesPaginatorOptions)) *ListInstancesPaginator { + options := ListInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListInstancesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListInstancesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListInstances page. +func (p *ListInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListInstancesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListInstances(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListPermissionSetsAPIClient is a client that implements the ListPermissionSets +// operation. +type ListPermissionSetsAPIClient interface { + ListPermissionSets(context.Context, *ListPermissionSetsInput, ...func(*Options)) (*ListPermissionSetsOutput, error) +} + +var _ ListPermissionSetsAPIClient = (*Client)(nil) + +// ListPermissionSetsPaginatorOptions is the paginator options for +// ListPermissionSets +type ListPermissionSetsPaginatorOptions struct { + // The maximum number of results to display for the assignment. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListPermissionSetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssoadmin.ListPermissionSets +type ListPermissionSetsPaginator struct { + options ListPermissionSetsPaginatorOptions + client ListPermissionSetsAPIClient + params *ListPermissionSetsInput + nextToken *string + firstPage bool + done bool +} + +// NewListPermissionSetsPaginator returns a new ListPermissionSetsPaginator +func NewListPermissionSetsPaginator(client ListPermissionSetsAPIClient, params *ListPermissionSetsInput, optFns ...func(*ListPermissionSetsPaginatorOptions)) *ListPermissionSetsPaginator { + options := ListPermissionSetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListPermissionSetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPermissionSetsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListPermissionSets page. +func (p *ListPermissionSetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPermissionSetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListPermissionSets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListAccountAssignmentsAPIClient is a client that implements the +// ListAccountAssignments operation. +type ListAccountAssignmentsAPIClient interface { + ListAccountAssignments(context.Context, *ListAccountAssignmentsInput, ...func(*Options)) (*ListAccountAssignmentsOutput, error) +} + +var _ ListAccountAssignmentsAPIClient = (*Client)(nil) + +// ListAccountAssignmentsPaginatorOptions is the paginator options for +// ListAccountAssignments +type ListAccountAssignmentsPaginatorOptions struct { + // The maximum number of results to display for the assignment. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAccountAssignmentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssoadmin.ListAccountAssignments +type ListAccountAssignmentsPaginator struct { + options ListAccountAssignmentsPaginatorOptions + client ListAccountAssignmentsAPIClient + params *ListAccountAssignmentsInput + nextToken *string + firstPage bool + done bool +} + +// NewListAccountAssignmentsPaginator returns a new ListAccountAssignmentsPaginator +func NewListAccountAssignmentsPaginator(client ListAccountAssignmentsAPIClient, params *ListAccountAssignmentsInput, optFns ...func(*ListAccountAssignmentsPaginatorOptions)) *ListAccountAssignmentsPaginator { + options := ListAccountAssignmentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAccountAssignmentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAccountAssignmentsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAccountAssignments page. +func (p *ListAccountAssignmentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccountAssignmentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListAccountAssignments(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListPermissionSetProvisioningStatusAPIClient is a client that implements the +// ListPermissionSetProvisioningStatus operation. +type ListPermissionSetProvisioningStatusAPIClient interface { + ListPermissionSetProvisioningStatus(context.Context, *ListPermissionSetProvisioningStatusInput, ...func(*Options)) (*ListPermissionSetProvisioningStatusOutput, error) +} + +var _ ListPermissionSetProvisioningStatusAPIClient = (*Client)(nil) + +// ListPermissionSetProvisioningStatusPaginatorOptions is the paginator options for +// ListPermissionSetProvisioningStatus +type ListPermissionSetProvisioningStatusPaginatorOptions struct { + // The maximum number of results to display for the assignment. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListPermissionSetProvisioningStatusPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssoadmin.ListPermissionSetProvisioningStatus +type ListPermissionSetProvisioningStatusPaginator struct { + options ListPermissionSetProvisioningStatusPaginatorOptions + client ListPermissionSetProvisioningStatusAPIClient + params *ListPermissionSetProvisioningStatusInput + nextToken *string + firstPage bool + done bool +} + +// NewListPermissionSetProvisioningStatusPaginator returns a new +// ListPermissionSetProvisioningStatusPaginator +func NewListPermissionSetProvisioningStatusPaginator(client ListPermissionSetProvisioningStatusAPIClient, params *ListPermissionSetProvisioningStatusInput, optFns ...func(*ListPermissionSetProvisioningStatusPaginatorOptions)) *ListPermissionSetProvisioningStatusPaginator { + options := ListPermissionSetProvisioningStatusPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListPermissionSetProvisioningStatusPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPermissionSetProvisioningStatusPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListPermissionSetProvisioningStatus page. +func (p *ListPermissionSetProvisioningStatusPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPermissionSetProvisioningStatusOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListPermissionSetProvisioningStatus(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListPermissionSetsProvisionedToAccountAPIClient is a client that implements the +// ListPermissionSetsProvisionedToAccount operation. +type ListPermissionSetsProvisionedToAccountAPIClient interface { + ListPermissionSetsProvisionedToAccount(context.Context, *ListPermissionSetsProvisionedToAccountInput, ...func(*Options)) (*ListPermissionSetsProvisionedToAccountOutput, error) +} + +var _ ListPermissionSetsProvisionedToAccountAPIClient = (*Client)(nil) + +// ListPermissionSetsProvisionedToAccountPaginatorOptions is the paginator options +// for ListPermissionSetsProvisionedToAccount +type ListPermissionSetsProvisionedToAccountPaginatorOptions struct { + // The maximum number of results to display for the assignment. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListPermissionSetsProvisionedToAccountPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssoadmin.ListPermissionSetsProvisionedToAccount +type ListPermissionSetsProvisionedToAccountPaginator struct { + options ListPermissionSetsProvisionedToAccountPaginatorOptions + client ListPermissionSetsProvisionedToAccountAPIClient + params *ListPermissionSetsProvisionedToAccountInput + nextToken *string + firstPage bool + done bool +} + +// NewListPermissionSetsProvisionedToAccountPaginator returns a new +// ListPermissionSetsProvisionedToAccountPaginator +func NewListPermissionSetsProvisionedToAccountPaginator(client ListPermissionSetsProvisionedToAccountAPIClient, params *ListPermissionSetsProvisionedToAccountInput, optFns ...func(*ListPermissionSetsProvisionedToAccountPaginatorOptions)) *ListPermissionSetsProvisionedToAccountPaginator { + options := ListPermissionSetsProvisionedToAccountPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListPermissionSetsProvisionedToAccountPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPermissionSetsProvisionedToAccountPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListPermissionSetsProvisionedToAccount page. +func (p *ListPermissionSetsProvisionedToAccountPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPermissionSetsProvisionedToAccountOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListPermissionSetsProvisionedToAccount(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListAccountAssignmentCreationStatusAPIClient is a client that implements the +// ListAccountAssignmentCreationStatus operation. +type ListAccountAssignmentCreationStatusAPIClient interface { + ListAccountAssignmentCreationStatus(context.Context, *ListAccountAssignmentCreationStatusInput, ...func(*Options)) (*ListAccountAssignmentCreationStatusOutput, error) +} + +var _ ListAccountAssignmentCreationStatusAPIClient = (*Client)(nil) + +// ListAccountAssignmentCreationStatusPaginatorOptions is the paginator options for +// ListAccountAssignmentCreationStatus +type ListAccountAssignmentCreationStatusPaginatorOptions struct { + // The maximum number of results to display for the assignment. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAccountAssignmentCreationStatusPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssoadmin.ListAccountAssignmentCreationStatus +type ListAccountAssignmentCreationStatusPaginator struct { + options ListAccountAssignmentCreationStatusPaginatorOptions + client ListAccountAssignmentCreationStatusAPIClient + params *ListAccountAssignmentCreationStatusInput + nextToken *string + firstPage bool + done bool +} + +// NewListAccountAssignmentCreationStatusPaginator returns a new +// ListAccountAssignmentCreationStatusPaginator +func NewListAccountAssignmentCreationStatusPaginator(client ListAccountAssignmentCreationStatusAPIClient, params *ListAccountAssignmentCreationStatusInput, optFns ...func(*ListAccountAssignmentCreationStatusPaginatorOptions)) *ListAccountAssignmentCreationStatusPaginator { + options := ListAccountAssignmentCreationStatusPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAccountAssignmentCreationStatusPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAccountAssignmentCreationStatusPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAccountAssignmentCreationStatus page. +func (p *ListAccountAssignmentCreationStatusPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccountAssignmentCreationStatusOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListAccountAssignmentCreationStatus(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListAccountsForProvisionedPermissionSetAPIClient is a client that implements the +// ListAccountsForProvisionedPermissionSet operation. +type ListAccountsForProvisionedPermissionSetAPIClient interface { + ListAccountsForProvisionedPermissionSet(context.Context, *ListAccountsForProvisionedPermissionSetInput, ...func(*Options)) (*ListAccountsForProvisionedPermissionSetOutput, error) +} + +var _ ListAccountsForProvisionedPermissionSetAPIClient = (*Client)(nil) + +// ListAccountsForProvisionedPermissionSetPaginatorOptions is the paginator options +// for ListAccountsForProvisionedPermissionSet +type ListAccountsForProvisionedPermissionSetPaginatorOptions struct { + // The maximum number of results to display for the PermissionSet. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAccountsForProvisionedPermissionSetPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssoadmin.ListAccountsForProvisionedPermissionSet +type ListAccountsForProvisionedPermissionSetPaginator struct { + options ListAccountsForProvisionedPermissionSetPaginatorOptions + client ListAccountsForProvisionedPermissionSetAPIClient + params *ListAccountsForProvisionedPermissionSetInput + nextToken *string + firstPage bool + done bool +} + +// NewListAccountsForProvisionedPermissionSetPaginator returns a new +// ListAccountsForProvisionedPermissionSetPaginator +func NewListAccountsForProvisionedPermissionSetPaginator(client ListAccountsForProvisionedPermissionSetAPIClient, params *ListAccountsForProvisionedPermissionSetInput, optFns ...func(*ListAccountsForProvisionedPermissionSetPaginatorOptions)) *ListAccountsForProvisionedPermissionSetPaginator { + options := ListAccountsForProvisionedPermissionSetPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAccountsForProvisionedPermissionSetPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAccountsForProvisionedPermissionSetPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAccountsForProvisionedPermissionSet page. +func (p *ListAccountsForProvisionedPermissionSetPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccountsForProvisionedPermissionSetOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListAccountsForProvisionedPermissionSet(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTagsForResourceAPIClient is a client that implements the ListTagsForResource +// operation. +type ListTagsForResourceAPIClient interface { + ListTagsForResource(context.Context, *ListTagsForResourceInput, ...func(*Options)) (*ListTagsForResourceOutput, error) +} + +var _ ListTagsForResourceAPIClient = (*Client)(nil) + +// ListTagsForResourcePaginatorOptions is the paginator options for +// ListTagsForResource +type ListTagsForResourcePaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTagsForResourcePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssoadmin.ListTagsForResource +type ListTagsForResourcePaginator struct { + options ListTagsForResourcePaginatorOptions + client ListTagsForResourceAPIClient + params *ListTagsForResourceInput + nextToken *string + firstPage bool + done bool +} + +// NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator +func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator { + options := ListTagsForResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTagsForResourcePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTagsForResourcePaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTagsForResource page. +func (p *ListTagsForResourcePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListTagsForResource(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListManagedPoliciesInPermissionSetAPIClient is a client that implements the +// ListManagedPoliciesInPermissionSet operation. +type ListManagedPoliciesInPermissionSetAPIClient interface { + ListManagedPoliciesInPermissionSet(context.Context, *ListManagedPoliciesInPermissionSetInput, ...func(*Options)) (*ListManagedPoliciesInPermissionSetOutput, error) +} + +var _ ListManagedPoliciesInPermissionSetAPIClient = (*Client)(nil) + +// ListManagedPoliciesInPermissionSetPaginatorOptions is the paginator options for +// ListManagedPoliciesInPermissionSet +type ListManagedPoliciesInPermissionSetPaginatorOptions struct { + // The maximum number of results to display for the PermissionSet. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListManagedPoliciesInPermissionSetPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssoadmin.ListManagedPoliciesInPermissionSet +type ListManagedPoliciesInPermissionSetPaginator struct { + options ListManagedPoliciesInPermissionSetPaginatorOptions + client ListManagedPoliciesInPermissionSetAPIClient + params *ListManagedPoliciesInPermissionSetInput + nextToken *string + firstPage bool + done bool +} + +// NewListManagedPoliciesInPermissionSetPaginator returns a new +// ListManagedPoliciesInPermissionSetPaginator +func NewListManagedPoliciesInPermissionSetPaginator(client ListManagedPoliciesInPermissionSetAPIClient, params *ListManagedPoliciesInPermissionSetInput, optFns ...func(*ListManagedPoliciesInPermissionSetPaginatorOptions)) *ListManagedPoliciesInPermissionSetPaginator { + options := ListManagedPoliciesInPermissionSetPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListManagedPoliciesInPermissionSetPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListManagedPoliciesInPermissionSetPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListManagedPoliciesInPermissionSet page. +func (p *ListManagedPoliciesInPermissionSetPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListManagedPoliciesInPermissionSetOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListManagedPoliciesInPermissionSet(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListAccountAssignmentDeletionStatusAPIClient is a client that implements the +// ListAccountAssignmentDeletionStatus operation. +type ListAccountAssignmentDeletionStatusAPIClient interface { + ListAccountAssignmentDeletionStatus(context.Context, *ListAccountAssignmentDeletionStatusInput, ...func(*Options)) (*ListAccountAssignmentDeletionStatusOutput, error) +} + +var _ ListAccountAssignmentDeletionStatusAPIClient = (*Client)(nil) + +// ListAccountAssignmentDeletionStatusPaginatorOptions is the paginator options for +// ListAccountAssignmentDeletionStatus +type ListAccountAssignmentDeletionStatusPaginatorOptions struct { + // The maximum number of results to display for the assignment. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAccountAssignmentDeletionStatusPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssoadmin.ListAccountAssignmentDeletionStatus +type ListAccountAssignmentDeletionStatusPaginator struct { + options ListAccountAssignmentDeletionStatusPaginatorOptions + client ListAccountAssignmentDeletionStatusAPIClient + params *ListAccountAssignmentDeletionStatusInput + nextToken *string + firstPage bool + done bool +} + +// NewListAccountAssignmentDeletionStatusPaginator returns a new +// ListAccountAssignmentDeletionStatusPaginator +func NewListAccountAssignmentDeletionStatusPaginator(client ListAccountAssignmentDeletionStatusAPIClient, params *ListAccountAssignmentDeletionStatusInput, optFns ...func(*ListAccountAssignmentDeletionStatusPaginatorOptions)) *ListAccountAssignmentDeletionStatusPaginator { + options := ListAccountAssignmentDeletionStatusPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAccountAssignmentDeletionStatusPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAccountAssignmentDeletionStatusPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAccountAssignmentDeletionStatus page. +func (p *ListAccountAssignmentDeletionStatusPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccountAssignmentDeletionStatusOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListAccountAssignmentDeletionStatus(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/ssooidc/go.sum b/service/ssooidc/go.sum index c669e324b14..32595049f96 100644 --- a/service/ssooidc/go.sum +++ b/service/ssooidc/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/storagegateway/go.sum b/service/storagegateway/go.sum index c669e324b14..32595049f96 100644 --- a/service/storagegateway/go.sum +++ b/service/storagegateway/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/storagegateway/paginators.go b/service/storagegateway/paginators.go new file mode 100644 index 00000000000..328b0af2dc3 --- /dev/null +++ b/service/storagegateway/paginators.go @@ -0,0 +1,692 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package storagegateway + +import ( + "context" + "fmt" +) + +// ListVolumesAPIClient is a client that implements the ListVolumes operation. +type ListVolumesAPIClient interface { + ListVolumes(context.Context, *ListVolumesInput, ...func(*Options)) (*ListVolumesOutput, error) +} + +var _ ListVolumesAPIClient = (*Client)(nil) + +// ListVolumesPaginatorOptions is the paginator options for ListVolumes +type ListVolumesPaginatorOptions struct { + // Specifies that the list of volumes returned be limited to the specified number + // of items. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListVolumesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/storagegateway.ListVolumes +type ListVolumesPaginator struct { + options ListVolumesPaginatorOptions + client ListVolumesAPIClient + params *ListVolumesInput + nextToken *string + firstPage bool + done bool +} + +// NewListVolumesPaginator returns a new ListVolumesPaginator +func NewListVolumesPaginator(client ListVolumesAPIClient, params *ListVolumesInput, optFns ...func(*ListVolumesPaginatorOptions)) *ListVolumesPaginator { + options := ListVolumesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListVolumesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListVolumesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListVolumes page. +func (p *ListVolumesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListVolumesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.ListVolumes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTapesAPIClient is a client that implements the ListTapes operation. +type ListTapesAPIClient interface { + ListTapes(context.Context, *ListTapesInput, ...func(*Options)) (*ListTapesOutput, error) +} + +var _ ListTapesAPIClient = (*Client)(nil) + +// ListTapesPaginatorOptions is the paginator options for ListTapes +type ListTapesPaginatorOptions struct { + // An optional number limit for the tapes in the list returned by this call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTapesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/storagegateway.ListTapes +type ListTapesPaginator struct { + options ListTapesPaginatorOptions + client ListTapesAPIClient + params *ListTapesInput + nextToken *string + firstPage bool + done bool +} + +// NewListTapesPaginator returns a new ListTapesPaginator +func NewListTapesPaginator(client ListTapesAPIClient, params *ListTapesInput, optFns ...func(*ListTapesPaginatorOptions)) *ListTapesPaginator { + options := ListTapesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTapesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTapesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTapes page. +func (p *ListTapesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTapesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.ListTapes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListGatewaysAPIClient is a client that implements the ListGateways operation. +type ListGatewaysAPIClient interface { + ListGateways(context.Context, *ListGatewaysInput, ...func(*Options)) (*ListGatewaysOutput, error) +} + +var _ ListGatewaysAPIClient = (*Client)(nil) + +// ListGatewaysPaginatorOptions is the paginator options for ListGateways +type ListGatewaysPaginatorOptions struct { + // Specifies that the list of gateways returned be limited to the specified number + // of items. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListGatewaysPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/storagegateway.ListGateways +type ListGatewaysPaginator struct { + options ListGatewaysPaginatorOptions + client ListGatewaysAPIClient + params *ListGatewaysInput + nextToken *string + firstPage bool + done bool +} + +// NewListGatewaysPaginator returns a new ListGatewaysPaginator +func NewListGatewaysPaginator(client ListGatewaysAPIClient, params *ListGatewaysInput, optFns ...func(*ListGatewaysPaginatorOptions)) *ListGatewaysPaginator { + options := ListGatewaysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListGatewaysPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListGatewaysPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListGateways page. +func (p *ListGatewaysPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListGatewaysOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.ListGateways(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListFileSharesAPIClient is a client that implements the ListFileShares +// operation. +type ListFileSharesAPIClient interface { + ListFileShares(context.Context, *ListFileSharesInput, ...func(*Options)) (*ListFileSharesOutput, error) +} + +var _ ListFileSharesAPIClient = (*Client)(nil) + +// ListFileSharesPaginatorOptions is the paginator options for ListFileShares +type ListFileSharesPaginatorOptions struct { + // The maximum number of file shares to return in the response. The value must be + // an integer with a value greater than zero. Optional. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListFileSharesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/storagegateway.ListFileShares +type ListFileSharesPaginator struct { + options ListFileSharesPaginatorOptions + client ListFileSharesAPIClient + params *ListFileSharesInput + nextToken *string + firstPage bool + done bool +} + +// NewListFileSharesPaginator returns a new ListFileSharesPaginator +func NewListFileSharesPaginator(client ListFileSharesAPIClient, params *ListFileSharesInput, optFns ...func(*ListFileSharesPaginatorOptions)) *ListFileSharesPaginator { + options := ListFileSharesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListFileSharesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListFileSharesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListFileShares page. +func (p *ListFileSharesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFileSharesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.ListFileShares(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeTapeArchivesAPIClient is a client that implements the +// DescribeTapeArchives operation. +type DescribeTapeArchivesAPIClient interface { + DescribeTapeArchives(context.Context, *DescribeTapeArchivesInput, ...func(*Options)) (*DescribeTapeArchivesOutput, error) +} + +var _ DescribeTapeArchivesAPIClient = (*Client)(nil) + +// DescribeTapeArchivesPaginatorOptions is the paginator options for +// DescribeTapeArchives +type DescribeTapeArchivesPaginatorOptions struct { + // Specifies that the number of virtual tapes described be limited to the specified + // number. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeTapeArchivesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/storagegateway.DescribeTapeArchives +type DescribeTapeArchivesPaginator struct { + options DescribeTapeArchivesPaginatorOptions + client DescribeTapeArchivesAPIClient + params *DescribeTapeArchivesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeTapeArchivesPaginator returns a new DescribeTapeArchivesPaginator +func NewDescribeTapeArchivesPaginator(client DescribeTapeArchivesAPIClient, params *DescribeTapeArchivesInput, optFns ...func(*DescribeTapeArchivesPaginatorOptions)) *DescribeTapeArchivesPaginator { + options := DescribeTapeArchivesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeTapeArchivesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeTapeArchivesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeTapeArchives page. +func (p *DescribeTapeArchivesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTapeArchivesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.DescribeTapeArchives(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeVTLDevicesAPIClient is a client that implements the DescribeVTLDevices +// operation. +type DescribeVTLDevicesAPIClient interface { + DescribeVTLDevices(context.Context, *DescribeVTLDevicesInput, ...func(*Options)) (*DescribeVTLDevicesOutput, error) +} + +var _ DescribeVTLDevicesAPIClient = (*Client)(nil) + +// DescribeVTLDevicesPaginatorOptions is the paginator options for +// DescribeVTLDevices +type DescribeVTLDevicesPaginatorOptions struct { + // Specifies that the number of VTL devices described be limited to the specified + // number. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeVTLDevicesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/storagegateway.DescribeVTLDevices +type DescribeVTLDevicesPaginator struct { + options DescribeVTLDevicesPaginatorOptions + client DescribeVTLDevicesAPIClient + params *DescribeVTLDevicesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeVTLDevicesPaginator returns a new DescribeVTLDevicesPaginator +func NewDescribeVTLDevicesPaginator(client DescribeVTLDevicesAPIClient, params *DescribeVTLDevicesInput, optFns ...func(*DescribeVTLDevicesPaginatorOptions)) *DescribeVTLDevicesPaginator { + options := DescribeVTLDevicesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeVTLDevicesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeVTLDevicesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeVTLDevices page. +func (p *DescribeVTLDevicesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeVTLDevicesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.DescribeVTLDevices(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeTapeRecoveryPointsAPIClient is a client that implements the +// DescribeTapeRecoveryPoints operation. +type DescribeTapeRecoveryPointsAPIClient interface { + DescribeTapeRecoveryPoints(context.Context, *DescribeTapeRecoveryPointsInput, ...func(*Options)) (*DescribeTapeRecoveryPointsOutput, error) +} + +var _ DescribeTapeRecoveryPointsAPIClient = (*Client)(nil) + +// DescribeTapeRecoveryPointsPaginatorOptions is the paginator options for +// DescribeTapeRecoveryPoints +type DescribeTapeRecoveryPointsPaginatorOptions struct { + // Specifies that the number of virtual tape recovery points that are described be + // limited to the specified number. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeTapeRecoveryPointsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/storagegateway.DescribeTapeRecoveryPoints +type DescribeTapeRecoveryPointsPaginator struct { + options DescribeTapeRecoveryPointsPaginatorOptions + client DescribeTapeRecoveryPointsAPIClient + params *DescribeTapeRecoveryPointsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeTapeRecoveryPointsPaginator returns a new +// DescribeTapeRecoveryPointsPaginator +func NewDescribeTapeRecoveryPointsPaginator(client DescribeTapeRecoveryPointsAPIClient, params *DescribeTapeRecoveryPointsInput, optFns ...func(*DescribeTapeRecoveryPointsPaginatorOptions)) *DescribeTapeRecoveryPointsPaginator { + options := DescribeTapeRecoveryPointsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeTapeRecoveryPointsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeTapeRecoveryPointsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeTapeRecoveryPoints page. +func (p *DescribeTapeRecoveryPointsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTapeRecoveryPointsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.DescribeTapeRecoveryPoints(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeTapesAPIClient is a client that implements the DescribeTapes operation. +type DescribeTapesAPIClient interface { + DescribeTapes(context.Context, *DescribeTapesInput, ...func(*Options)) (*DescribeTapesOutput, error) +} + +var _ DescribeTapesAPIClient = (*Client)(nil) + +// DescribeTapesPaginatorOptions is the paginator options for DescribeTapes +type DescribeTapesPaginatorOptions struct { + // Specifies that the number of virtual tapes described be limited to the specified + // number. Amazon Web Services may impose its own limit, if this field is not set. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeTapesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/storagegateway.DescribeTapes +type DescribeTapesPaginator struct { + options DescribeTapesPaginatorOptions + client DescribeTapesAPIClient + params *DescribeTapesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeTapesPaginator returns a new DescribeTapesPaginator +func NewDescribeTapesPaginator(client DescribeTapesAPIClient, params *DescribeTapesInput, optFns ...func(*DescribeTapesPaginatorOptions)) *DescribeTapesPaginator { + options := DescribeTapesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeTapesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeTapesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeTapes page. +func (p *DescribeTapesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTapesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.DescribeTapes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTagsForResourceAPIClient is a client that implements the ListTagsForResource +// operation. +type ListTagsForResourceAPIClient interface { + ListTagsForResource(context.Context, *ListTagsForResourceInput, ...func(*Options)) (*ListTagsForResourceOutput, error) +} + +var _ ListTagsForResourceAPIClient = (*Client)(nil) + +// ListTagsForResourcePaginatorOptions is the paginator options for +// ListTagsForResource +type ListTagsForResourcePaginatorOptions struct { + // Specifies that the list of tags returned be limited to the specified number of + // items. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTagsForResourcePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/storagegateway.ListTagsForResource +type ListTagsForResourcePaginator struct { + options ListTagsForResourcePaginatorOptions + client ListTagsForResourceAPIClient + params *ListTagsForResourceInput + nextToken *string + firstPage bool + done bool +} + +// NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator +func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator { + options := ListTagsForResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTagsForResourcePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTagsForResourcePaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTagsForResource page. +func (p *ListTagsForResourcePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.ListTagsForResource(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/sts/go.sum b/service/sts/go.sum index c669e324b14..32595049f96 100644 --- a/service/sts/go.sum +++ b/service/sts/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/support/go.sum b/service/support/go.sum index c669e324b14..32595049f96 100644 --- a/service/support/go.sum +++ b/service/support/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/support/paginators.go b/service/support/paginators.go new file mode 100644 index 00000000000..63769fb8b8c --- /dev/null +++ b/service/support/paginators.go @@ -0,0 +1,158 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package support + +import ( + "context" + "fmt" +) + +// DescribeCasesAPIClient is a client that implements the DescribeCases operation. +type DescribeCasesAPIClient interface { + DescribeCases(context.Context, *DescribeCasesInput, ...func(*Options)) (*DescribeCasesOutput, error) +} + +var _ DescribeCasesAPIClient = (*Client)(nil) + +// DescribeCasesPaginatorOptions is the paginator options for DescribeCases +type DescribeCasesPaginatorOptions struct { + // The maximum number of results to return before paginating. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeCasesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/support.DescribeCases +type DescribeCasesPaginator struct { + options DescribeCasesPaginatorOptions + client DescribeCasesAPIClient + params *DescribeCasesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeCasesPaginator returns a new DescribeCasesPaginator +func NewDescribeCasesPaginator(client DescribeCasesAPIClient, params *DescribeCasesInput, optFns ...func(*DescribeCasesPaginatorOptions)) *DescribeCasesPaginator { + options := DescribeCasesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeCasesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeCasesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeCases page. +func (p *DescribeCasesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCasesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeCases(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeCommunicationsAPIClient is a client that implements the +// DescribeCommunications operation. +type DescribeCommunicationsAPIClient interface { + DescribeCommunications(context.Context, *DescribeCommunicationsInput, ...func(*Options)) (*DescribeCommunicationsOutput, error) +} + +var _ DescribeCommunicationsAPIClient = (*Client)(nil) + +// DescribeCommunicationsPaginatorOptions is the paginator options for +// DescribeCommunications +type DescribeCommunicationsPaginatorOptions struct { + // The maximum number of results to return before paginating. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeCommunicationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/support.DescribeCommunications +type DescribeCommunicationsPaginator struct { + options DescribeCommunicationsPaginatorOptions + client DescribeCommunicationsAPIClient + params *DescribeCommunicationsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeCommunicationsPaginator returns a new DescribeCommunicationsPaginator +func NewDescribeCommunicationsPaginator(client DescribeCommunicationsAPIClient, params *DescribeCommunicationsInput, optFns ...func(*DescribeCommunicationsPaginatorOptions)) *DescribeCommunicationsPaginator { + options := DescribeCommunicationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeCommunicationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeCommunicationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeCommunications page. +func (p *DescribeCommunicationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCommunicationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeCommunications(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/swf/go.sum b/service/swf/go.sum index c669e324b14..32595049f96 100644 --- a/service/swf/go.sum +++ b/service/swf/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/swf/paginators.go b/service/swf/paginators.go new file mode 100644 index 00000000000..0ae9e06de1e --- /dev/null +++ b/service/swf/paginators.go @@ -0,0 +1,547 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package swf + +import ( + "context" + "fmt" +) + +// ListDomainsAPIClient is a client that implements the ListDomains operation. +type ListDomainsAPIClient interface { + ListDomains(context.Context, *ListDomainsInput, ...func(*Options)) (*ListDomainsOutput, error) +} + +var _ ListDomainsAPIClient = (*Client)(nil) + +// ListDomainsPaginatorOptions is the paginator options for ListDomains +type ListDomainsPaginatorOptions struct { + // The maximum number of results that are returned per call. Use nextPageToken to + // obtain further pages of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDomainsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/swf.ListDomains +type ListDomainsPaginator struct { + options ListDomainsPaginatorOptions + client ListDomainsAPIClient + params *ListDomainsInput + nextToken *string + firstPage bool + done bool +} + +// NewListDomainsPaginator returns a new ListDomainsPaginator +func NewListDomainsPaginator(client ListDomainsAPIClient, params *ListDomainsInput, optFns ...func(*ListDomainsPaginatorOptions)) *ListDomainsPaginator { + options := ListDomainsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDomainsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDomainsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDomains page. +func (p *ListDomainsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDomainsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextPageToken = p.nextToken + params.MaximumPageSize = p.options.Limit + result, err := p.client.ListDomains(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && params.NextPageToken != nil && p.nextToken != nil && *params.NextPageToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListActivityTypesAPIClient is a client that implements the ListActivityTypes +// operation. +type ListActivityTypesAPIClient interface { + ListActivityTypes(context.Context, *ListActivityTypesInput, ...func(*Options)) (*ListActivityTypesOutput, error) +} + +var _ ListActivityTypesAPIClient = (*Client)(nil) + +// ListActivityTypesPaginatorOptions is the paginator options for ListActivityTypes +type ListActivityTypesPaginatorOptions struct { + // The maximum number of results that are returned per call. Use nextPageToken to + // obtain further pages of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListActivityTypesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/swf.ListActivityTypes +type ListActivityTypesPaginator struct { + options ListActivityTypesPaginatorOptions + client ListActivityTypesAPIClient + params *ListActivityTypesInput + nextToken *string + firstPage bool + done bool +} + +// NewListActivityTypesPaginator returns a new ListActivityTypesPaginator +func NewListActivityTypesPaginator(client ListActivityTypesAPIClient, params *ListActivityTypesInput, optFns ...func(*ListActivityTypesPaginatorOptions)) *ListActivityTypesPaginator { + options := ListActivityTypesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListActivityTypesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListActivityTypesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListActivityTypes page. +func (p *ListActivityTypesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListActivityTypesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextPageToken = p.nextToken + params.MaximumPageSize = p.options.Limit + result, err := p.client.ListActivityTypes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && params.NextPageToken != nil && p.nextToken != nil && *params.NextPageToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListWorkflowTypesAPIClient is a client that implements the ListWorkflowTypes +// operation. +type ListWorkflowTypesAPIClient interface { + ListWorkflowTypes(context.Context, *ListWorkflowTypesInput, ...func(*Options)) (*ListWorkflowTypesOutput, error) +} + +var _ ListWorkflowTypesAPIClient = (*Client)(nil) + +// ListWorkflowTypesPaginatorOptions is the paginator options for ListWorkflowTypes +type ListWorkflowTypesPaginatorOptions struct { + // The maximum number of results that are returned per call. Use nextPageToken to + // obtain further pages of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListWorkflowTypesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/swf.ListWorkflowTypes +type ListWorkflowTypesPaginator struct { + options ListWorkflowTypesPaginatorOptions + client ListWorkflowTypesAPIClient + params *ListWorkflowTypesInput + nextToken *string + firstPage bool + done bool +} + +// NewListWorkflowTypesPaginator returns a new ListWorkflowTypesPaginator +func NewListWorkflowTypesPaginator(client ListWorkflowTypesAPIClient, params *ListWorkflowTypesInput, optFns ...func(*ListWorkflowTypesPaginatorOptions)) *ListWorkflowTypesPaginator { + options := ListWorkflowTypesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListWorkflowTypesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListWorkflowTypesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListWorkflowTypes page. +func (p *ListWorkflowTypesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListWorkflowTypesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextPageToken = p.nextToken + params.MaximumPageSize = p.options.Limit + result, err := p.client.ListWorkflowTypes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && params.NextPageToken != nil && p.nextToken != nil && *params.NextPageToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListOpenWorkflowExecutionsAPIClient is a client that implements the +// ListOpenWorkflowExecutions operation. +type ListOpenWorkflowExecutionsAPIClient interface { + ListOpenWorkflowExecutions(context.Context, *ListOpenWorkflowExecutionsInput, ...func(*Options)) (*ListOpenWorkflowExecutionsOutput, error) +} + +var _ ListOpenWorkflowExecutionsAPIClient = (*Client)(nil) + +// ListOpenWorkflowExecutionsPaginatorOptions is the paginator options for +// ListOpenWorkflowExecutions +type ListOpenWorkflowExecutionsPaginatorOptions struct { + // The maximum number of results that are returned per call. Use nextPageToken to + // obtain further pages of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListOpenWorkflowExecutionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/swf.ListOpenWorkflowExecutions +type ListOpenWorkflowExecutionsPaginator struct { + options ListOpenWorkflowExecutionsPaginatorOptions + client ListOpenWorkflowExecutionsAPIClient + params *ListOpenWorkflowExecutionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListOpenWorkflowExecutionsPaginator returns a new +// ListOpenWorkflowExecutionsPaginator +func NewListOpenWorkflowExecutionsPaginator(client ListOpenWorkflowExecutionsAPIClient, params *ListOpenWorkflowExecutionsInput, optFns ...func(*ListOpenWorkflowExecutionsPaginatorOptions)) *ListOpenWorkflowExecutionsPaginator { + options := ListOpenWorkflowExecutionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListOpenWorkflowExecutionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListOpenWorkflowExecutionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListOpenWorkflowExecutions page. +func (p *ListOpenWorkflowExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListOpenWorkflowExecutionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextPageToken = p.nextToken + params.MaximumPageSize = p.options.Limit + result, err := p.client.ListOpenWorkflowExecutions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && params.NextPageToken != nil && p.nextToken != nil && *params.NextPageToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetWorkflowExecutionHistoryAPIClient is a client that implements the +// GetWorkflowExecutionHistory operation. +type GetWorkflowExecutionHistoryAPIClient interface { + GetWorkflowExecutionHistory(context.Context, *GetWorkflowExecutionHistoryInput, ...func(*Options)) (*GetWorkflowExecutionHistoryOutput, error) +} + +var _ GetWorkflowExecutionHistoryAPIClient = (*Client)(nil) + +// GetWorkflowExecutionHistoryPaginatorOptions is the paginator options for +// GetWorkflowExecutionHistory +type GetWorkflowExecutionHistoryPaginatorOptions struct { + // The maximum number of results that are returned per call. Use nextPageToken to + // obtain further pages of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetWorkflowExecutionHistoryPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/swf.GetWorkflowExecutionHistory +type GetWorkflowExecutionHistoryPaginator struct { + options GetWorkflowExecutionHistoryPaginatorOptions + client GetWorkflowExecutionHistoryAPIClient + params *GetWorkflowExecutionHistoryInput + nextToken *string + firstPage bool + done bool +} + +// NewGetWorkflowExecutionHistoryPaginator returns a new +// GetWorkflowExecutionHistoryPaginator +func NewGetWorkflowExecutionHistoryPaginator(client GetWorkflowExecutionHistoryAPIClient, params *GetWorkflowExecutionHistoryInput, optFns ...func(*GetWorkflowExecutionHistoryPaginatorOptions)) *GetWorkflowExecutionHistoryPaginator { + options := GetWorkflowExecutionHistoryPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetWorkflowExecutionHistoryPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetWorkflowExecutionHistoryPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetWorkflowExecutionHistory page. +func (p *GetWorkflowExecutionHistoryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetWorkflowExecutionHistoryOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextPageToken = p.nextToken + params.MaximumPageSize = p.options.Limit + result, err := p.client.GetWorkflowExecutionHistory(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && params.NextPageToken != nil && p.nextToken != nil && *params.NextPageToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// PollForDecisionTaskAPIClient is a client that implements the PollForDecisionTask +// operation. +type PollForDecisionTaskAPIClient interface { + PollForDecisionTask(context.Context, *PollForDecisionTaskInput, ...func(*Options)) (*PollForDecisionTaskOutput, error) +} + +var _ PollForDecisionTaskAPIClient = (*Client)(nil) + +// PollForDecisionTaskPaginatorOptions is the paginator options for +// PollForDecisionTask +type PollForDecisionTaskPaginatorOptions struct { + // The maximum number of results that are returned per call. Use nextPageToken to + // obtain further pages of results. This is an upper limit only; the actual number + // of results returned per call may be fewer than the specified maximum. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// PollForDecisionTaskPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/swf.PollForDecisionTask +type PollForDecisionTaskPaginator struct { + options PollForDecisionTaskPaginatorOptions + client PollForDecisionTaskAPIClient + params *PollForDecisionTaskInput + nextToken *string + firstPage bool + done bool +} + +// NewPollForDecisionTaskPaginator returns a new PollForDecisionTaskPaginator +func NewPollForDecisionTaskPaginator(client PollForDecisionTaskAPIClient, params *PollForDecisionTaskInput, optFns ...func(*PollForDecisionTaskPaginatorOptions)) *PollForDecisionTaskPaginator { + options := PollForDecisionTaskPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &PollForDecisionTaskPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *PollForDecisionTaskPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next PollForDecisionTask page. +func (p *PollForDecisionTaskPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*PollForDecisionTaskOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextPageToken = p.nextToken + params.MaximumPageSize = p.options.Limit + result, err := p.client.PollForDecisionTask(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && params.NextPageToken != nil && p.nextToken != nil && *params.NextPageToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListClosedWorkflowExecutionsAPIClient is a client that implements the +// ListClosedWorkflowExecutions operation. +type ListClosedWorkflowExecutionsAPIClient interface { + ListClosedWorkflowExecutions(context.Context, *ListClosedWorkflowExecutionsInput, ...func(*Options)) (*ListClosedWorkflowExecutionsOutput, error) +} + +var _ ListClosedWorkflowExecutionsAPIClient = (*Client)(nil) + +// ListClosedWorkflowExecutionsPaginatorOptions is the paginator options for +// ListClosedWorkflowExecutions +type ListClosedWorkflowExecutionsPaginatorOptions struct { + // The maximum number of results that are returned per call. Use nextPageToken to + // obtain further pages of results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListClosedWorkflowExecutionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/swf.ListClosedWorkflowExecutions +type ListClosedWorkflowExecutionsPaginator struct { + options ListClosedWorkflowExecutionsPaginatorOptions + client ListClosedWorkflowExecutionsAPIClient + params *ListClosedWorkflowExecutionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListClosedWorkflowExecutionsPaginator returns a new +// ListClosedWorkflowExecutionsPaginator +func NewListClosedWorkflowExecutionsPaginator(client ListClosedWorkflowExecutionsAPIClient, params *ListClosedWorkflowExecutionsInput, optFns ...func(*ListClosedWorkflowExecutionsPaginatorOptions)) *ListClosedWorkflowExecutionsPaginator { + options := ListClosedWorkflowExecutionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListClosedWorkflowExecutionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListClosedWorkflowExecutionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListClosedWorkflowExecutions page. +func (p *ListClosedWorkflowExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListClosedWorkflowExecutionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextPageToken = p.nextToken + params.MaximumPageSize = p.options.Limit + result, err := p.client.ListClosedWorkflowExecutions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && params.NextPageToken != nil && p.nextToken != nil && *params.NextPageToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/synthetics/go.sum b/service/synthetics/go.sum index c669e324b14..32595049f96 100644 --- a/service/synthetics/go.sum +++ b/service/synthetics/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/synthetics/paginators.go b/service/synthetics/paginators.go new file mode 100644 index 00000000000..92bc90018d8 --- /dev/null +++ b/service/synthetics/paginators.go @@ -0,0 +1,318 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package synthetics + +import ( + "context" + "fmt" +) + +// DescribeCanariesAPIClient is a client that implements the DescribeCanaries +// operation. +type DescribeCanariesAPIClient interface { + DescribeCanaries(context.Context, *DescribeCanariesInput, ...func(*Options)) (*DescribeCanariesOutput, error) +} + +var _ DescribeCanariesAPIClient = (*Client)(nil) + +// DescribeCanariesPaginatorOptions is the paginator options for DescribeCanaries +type DescribeCanariesPaginatorOptions struct { + // Specify this parameter to limit how many canaries are returned each time you use + // the DescribeCanaries operation. If you omit this parameter, the default of 100 + // is used. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeCanariesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/synthetics.DescribeCanaries +type DescribeCanariesPaginator struct { + options DescribeCanariesPaginatorOptions + client DescribeCanariesAPIClient + params *DescribeCanariesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeCanariesPaginator returns a new DescribeCanariesPaginator +func NewDescribeCanariesPaginator(client DescribeCanariesAPIClient, params *DescribeCanariesInput, optFns ...func(*DescribeCanariesPaginatorOptions)) *DescribeCanariesPaginator { + options := DescribeCanariesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeCanariesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeCanariesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeCanaries page. +func (p *DescribeCanariesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCanariesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeCanaries(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeCanariesLastRunAPIClient is a client that implements the +// DescribeCanariesLastRun operation. +type DescribeCanariesLastRunAPIClient interface { + DescribeCanariesLastRun(context.Context, *DescribeCanariesLastRunInput, ...func(*Options)) (*DescribeCanariesLastRunOutput, error) +} + +var _ DescribeCanariesLastRunAPIClient = (*Client)(nil) + +// DescribeCanariesLastRunPaginatorOptions is the paginator options for +// DescribeCanariesLastRun +type DescribeCanariesLastRunPaginatorOptions struct { + // Specify this parameter to limit how many runs are returned each time you use the + // DescribeLastRun operation. If you omit this parameter, the default of 100 is + // used. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeCanariesLastRunPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/synthetics.DescribeCanariesLastRun +type DescribeCanariesLastRunPaginator struct { + options DescribeCanariesLastRunPaginatorOptions + client DescribeCanariesLastRunAPIClient + params *DescribeCanariesLastRunInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeCanariesLastRunPaginator returns a new +// DescribeCanariesLastRunPaginator +func NewDescribeCanariesLastRunPaginator(client DescribeCanariesLastRunAPIClient, params *DescribeCanariesLastRunInput, optFns ...func(*DescribeCanariesLastRunPaginatorOptions)) *DescribeCanariesLastRunPaginator { + options := DescribeCanariesLastRunPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeCanariesLastRunPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeCanariesLastRunPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeCanariesLastRun page. +func (p *DescribeCanariesLastRunPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCanariesLastRunOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeCanariesLastRun(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeRuntimeVersionsAPIClient is a client that implements the +// DescribeRuntimeVersions operation. +type DescribeRuntimeVersionsAPIClient interface { + DescribeRuntimeVersions(context.Context, *DescribeRuntimeVersionsInput, ...func(*Options)) (*DescribeRuntimeVersionsOutput, error) +} + +var _ DescribeRuntimeVersionsAPIClient = (*Client)(nil) + +// DescribeRuntimeVersionsPaginatorOptions is the paginator options for +// DescribeRuntimeVersions +type DescribeRuntimeVersionsPaginatorOptions struct { + // Specify this parameter to limit how many runs are returned each time you use the + // DescribeRuntimeVersions operation. If you omit this parameter, the default of + // 100 is used. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeRuntimeVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/synthetics.DescribeRuntimeVersions +type DescribeRuntimeVersionsPaginator struct { + options DescribeRuntimeVersionsPaginatorOptions + client DescribeRuntimeVersionsAPIClient + params *DescribeRuntimeVersionsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeRuntimeVersionsPaginator returns a new +// DescribeRuntimeVersionsPaginator +func NewDescribeRuntimeVersionsPaginator(client DescribeRuntimeVersionsAPIClient, params *DescribeRuntimeVersionsInput, optFns ...func(*DescribeRuntimeVersionsPaginatorOptions)) *DescribeRuntimeVersionsPaginator { + options := DescribeRuntimeVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeRuntimeVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeRuntimeVersionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeRuntimeVersions page. +func (p *DescribeRuntimeVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeRuntimeVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.DescribeRuntimeVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetCanaryRunsAPIClient is a client that implements the GetCanaryRuns operation. +type GetCanaryRunsAPIClient interface { + GetCanaryRuns(context.Context, *GetCanaryRunsInput, ...func(*Options)) (*GetCanaryRunsOutput, error) +} + +var _ GetCanaryRunsAPIClient = (*Client)(nil) + +// GetCanaryRunsPaginatorOptions is the paginator options for GetCanaryRuns +type GetCanaryRunsPaginatorOptions struct { + // Specify this parameter to limit how many runs are returned each time you use the + // GetCanaryRuns operation. If you omit this parameter, the default of 100 is used. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetCanaryRunsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/synthetics.GetCanaryRuns +type GetCanaryRunsPaginator struct { + options GetCanaryRunsPaginatorOptions + client GetCanaryRunsAPIClient + params *GetCanaryRunsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetCanaryRunsPaginator returns a new GetCanaryRunsPaginator +func NewGetCanaryRunsPaginator(client GetCanaryRunsAPIClient, params *GetCanaryRunsInput, optFns ...func(*GetCanaryRunsPaginatorOptions)) *GetCanaryRunsPaginator { + options := GetCanaryRunsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetCanaryRunsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetCanaryRunsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetCanaryRuns page. +func (p *GetCanaryRunsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetCanaryRunsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.GetCanaryRuns(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/textract/go.sum b/service/textract/go.sum index c669e324b14..32595049f96 100644 --- a/service/textract/go.sum +++ b/service/textract/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/timestreamquery/go.sum b/service/timestreamquery/go.sum index c669e324b14..32595049f96 100644 --- a/service/timestreamquery/go.sum +++ b/service/timestreamquery/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/timestreamquery/paginators.go b/service/timestreamquery/paginators.go new file mode 100644 index 00000000000..7de9ac9f692 --- /dev/null +++ b/service/timestreamquery/paginators.go @@ -0,0 +1,85 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package timestreamquery + +import ( + "context" + "fmt" +) + +// QueryAPIClient is a client that implements the Query operation. +type QueryAPIClient interface { + Query(context.Context, *QueryInput, ...func(*Options)) (*QueryOutput, error) +} + +var _ QueryAPIClient = (*Client)(nil) + +// QueryPaginatorOptions is the paginator options for Query +type QueryPaginatorOptions struct { + // The total number of rows to return in the output. If the total number of rows + // available is more than the value specified, a NextToken is provided in the + // command's output. To resume pagination, provide the NextToken value in the + // starting-token argument of a subsequent command. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// QueryPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/timestreamquery.Query +type QueryPaginator struct { + options QueryPaginatorOptions + client QueryAPIClient + params *QueryInput + nextToken *string + firstPage bool + done bool +} + +// NewQueryPaginator returns a new QueryPaginator +func NewQueryPaginator(client QueryAPIClient, params *QueryInput, optFns ...func(*QueryPaginatorOptions)) *QueryPaginator { + options := QueryPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &QueryPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *QueryPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next Query page. +func (p *QueryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*QueryOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxRows = p.options.Limit + result, err := p.client.Query(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/timestreamwrite/go.sum b/service/timestreamwrite/go.sum index c669e324b14..32595049f96 100644 --- a/service/timestreamwrite/go.sum +++ b/service/timestreamwrite/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/timestreamwrite/paginators.go b/service/timestreamwrite/paginators.go new file mode 100644 index 00000000000..e2709eee966 --- /dev/null +++ b/service/timestreamwrite/paginators.go @@ -0,0 +1,162 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package timestreamwrite + +import ( + "context" + "fmt" +) + +// ListTablesAPIClient is a client that implements the ListTables operation. +type ListTablesAPIClient interface { + ListTables(context.Context, *ListTablesInput, ...func(*Options)) (*ListTablesOutput, error) +} + +var _ ListTablesAPIClient = (*Client)(nil) + +// ListTablesPaginatorOptions is the paginator options for ListTables +type ListTablesPaginatorOptions struct { + // The total number of items to return in the output. If the total number of items + // available is more than the value specified, a NextToken is provided in the + // output. To resume pagination, provide the NextToken value as argument of a + // subsequent API invocation. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTablesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/timestreamwrite.ListTables +type ListTablesPaginator struct { + options ListTablesPaginatorOptions + client ListTablesAPIClient + params *ListTablesInput + nextToken *string + firstPage bool + done bool +} + +// NewListTablesPaginator returns a new ListTablesPaginator +func NewListTablesPaginator(client ListTablesAPIClient, params *ListTablesInput, optFns ...func(*ListTablesPaginatorOptions)) *ListTablesPaginator { + options := ListTablesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTablesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTablesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTables page. +func (p *ListTablesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTablesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListTables(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDatabasesAPIClient is a client that implements the ListDatabases operation. +type ListDatabasesAPIClient interface { + ListDatabases(context.Context, *ListDatabasesInput, ...func(*Options)) (*ListDatabasesOutput, error) +} + +var _ ListDatabasesAPIClient = (*Client)(nil) + +// ListDatabasesPaginatorOptions is the paginator options for ListDatabases +type ListDatabasesPaginatorOptions struct { + // The total number of items to return in the output. If the total number of items + // available is more than the value specified, a NextToken is provided in the + // output. To resume pagination, provide the NextToken value as argument of a + // subsequent API invocation. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDatabasesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/timestreamwrite.ListDatabases +type ListDatabasesPaginator struct { + options ListDatabasesPaginatorOptions + client ListDatabasesAPIClient + params *ListDatabasesInput + nextToken *string + firstPage bool + done bool +} + +// NewListDatabasesPaginator returns a new ListDatabasesPaginator +func NewListDatabasesPaginator(client ListDatabasesAPIClient, params *ListDatabasesInput, optFns ...func(*ListDatabasesPaginatorOptions)) *ListDatabasesPaginator { + options := ListDatabasesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDatabasesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDatabasesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDatabases page. +func (p *ListDatabasesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDatabasesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListDatabases(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/transcribe/go.sum b/service/transcribe/go.sum index c669e324b14..32595049f96 100644 --- a/service/transcribe/go.sum +++ b/service/transcribe/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/transcribe/paginators.go b/service/transcribe/paginators.go new file mode 100644 index 00000000000..3e28ceb4566 --- /dev/null +++ b/service/transcribe/paginators.go @@ -0,0 +1,471 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package transcribe + +import ( + "context" + "fmt" +) + +// ListVocabulariesAPIClient is a client that implements the ListVocabularies +// operation. +type ListVocabulariesAPIClient interface { + ListVocabularies(context.Context, *ListVocabulariesInput, ...func(*Options)) (*ListVocabulariesOutput, error) +} + +var _ ListVocabulariesAPIClient = (*Client)(nil) + +// ListVocabulariesPaginatorOptions is the paginator options for ListVocabularies +type ListVocabulariesPaginatorOptions struct { + // The maximum number of vocabularies to return in the response. If there are fewer + // results in the list, this response contains only the actual results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListVocabulariesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/transcribe.ListVocabularies +type ListVocabulariesPaginator struct { + options ListVocabulariesPaginatorOptions + client ListVocabulariesAPIClient + params *ListVocabulariesInput + nextToken *string + firstPage bool + done bool +} + +// NewListVocabulariesPaginator returns a new ListVocabulariesPaginator +func NewListVocabulariesPaginator(client ListVocabulariesAPIClient, params *ListVocabulariesInput, optFns ...func(*ListVocabulariesPaginatorOptions)) *ListVocabulariesPaginator { + options := ListVocabulariesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListVocabulariesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListVocabulariesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListVocabularies page. +func (p *ListVocabulariesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListVocabulariesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListVocabularies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTranscriptionJobsAPIClient is a client that implements the +// ListTranscriptionJobs operation. +type ListTranscriptionJobsAPIClient interface { + ListTranscriptionJobs(context.Context, *ListTranscriptionJobsInput, ...func(*Options)) (*ListTranscriptionJobsOutput, error) +} + +var _ ListTranscriptionJobsAPIClient = (*Client)(nil) + +// ListTranscriptionJobsPaginatorOptions is the paginator options for +// ListTranscriptionJobs +type ListTranscriptionJobsPaginatorOptions struct { + // The maximum number of jobs to return in the response. If there are fewer results + // in the list, this response contains only the actual results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTranscriptionJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/transcribe.ListTranscriptionJobs +type ListTranscriptionJobsPaginator struct { + options ListTranscriptionJobsPaginatorOptions + client ListTranscriptionJobsAPIClient + params *ListTranscriptionJobsInput + nextToken *string + firstPage bool + done bool +} + +// NewListTranscriptionJobsPaginator returns a new ListTranscriptionJobsPaginator +func NewListTranscriptionJobsPaginator(client ListTranscriptionJobsAPIClient, params *ListTranscriptionJobsInput, optFns ...func(*ListTranscriptionJobsPaginatorOptions)) *ListTranscriptionJobsPaginator { + options := ListTranscriptionJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTranscriptionJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTranscriptionJobsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTranscriptionJobs page. +func (p *ListTranscriptionJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTranscriptionJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListTranscriptionJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListMedicalVocabulariesAPIClient is a client that implements the +// ListMedicalVocabularies operation. +type ListMedicalVocabulariesAPIClient interface { + ListMedicalVocabularies(context.Context, *ListMedicalVocabulariesInput, ...func(*Options)) (*ListMedicalVocabulariesOutput, error) +} + +var _ ListMedicalVocabulariesAPIClient = (*Client)(nil) + +// ListMedicalVocabulariesPaginatorOptions is the paginator options for +// ListMedicalVocabularies +type ListMedicalVocabulariesPaginatorOptions struct { + // The maximum number of vocabularies to return in the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListMedicalVocabulariesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/transcribe.ListMedicalVocabularies +type ListMedicalVocabulariesPaginator struct { + options ListMedicalVocabulariesPaginatorOptions + client ListMedicalVocabulariesAPIClient + params *ListMedicalVocabulariesInput + nextToken *string + firstPage bool + done bool +} + +// NewListMedicalVocabulariesPaginator returns a new +// ListMedicalVocabulariesPaginator +func NewListMedicalVocabulariesPaginator(client ListMedicalVocabulariesAPIClient, params *ListMedicalVocabulariesInput, optFns ...func(*ListMedicalVocabulariesPaginatorOptions)) *ListMedicalVocabulariesPaginator { + options := ListMedicalVocabulariesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListMedicalVocabulariesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMedicalVocabulariesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListMedicalVocabularies page. +func (p *ListMedicalVocabulariesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMedicalVocabulariesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListMedicalVocabularies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListVocabularyFiltersAPIClient is a client that implements the +// ListVocabularyFilters operation. +type ListVocabularyFiltersAPIClient interface { + ListVocabularyFilters(context.Context, *ListVocabularyFiltersInput, ...func(*Options)) (*ListVocabularyFiltersOutput, error) +} + +var _ ListVocabularyFiltersAPIClient = (*Client)(nil) + +// ListVocabularyFiltersPaginatorOptions is the paginator options for +// ListVocabularyFilters +type ListVocabularyFiltersPaginatorOptions struct { + // The maximum number of filters to return in the response. If there are fewer + // results in the list, this response contains only the actual results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListVocabularyFiltersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/transcribe.ListVocabularyFilters +type ListVocabularyFiltersPaginator struct { + options ListVocabularyFiltersPaginatorOptions + client ListVocabularyFiltersAPIClient + params *ListVocabularyFiltersInput + nextToken *string + firstPage bool + done bool +} + +// NewListVocabularyFiltersPaginator returns a new ListVocabularyFiltersPaginator +func NewListVocabularyFiltersPaginator(client ListVocabularyFiltersAPIClient, params *ListVocabularyFiltersInput, optFns ...func(*ListVocabularyFiltersPaginatorOptions)) *ListVocabularyFiltersPaginator { + options := ListVocabularyFiltersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListVocabularyFiltersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListVocabularyFiltersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListVocabularyFilters page. +func (p *ListVocabularyFiltersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListVocabularyFiltersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListVocabularyFilters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListMedicalTranscriptionJobsAPIClient is a client that implements the +// ListMedicalTranscriptionJobs operation. +type ListMedicalTranscriptionJobsAPIClient interface { + ListMedicalTranscriptionJobs(context.Context, *ListMedicalTranscriptionJobsInput, ...func(*Options)) (*ListMedicalTranscriptionJobsOutput, error) +} + +var _ ListMedicalTranscriptionJobsAPIClient = (*Client)(nil) + +// ListMedicalTranscriptionJobsPaginatorOptions is the paginator options for +// ListMedicalTranscriptionJobs +type ListMedicalTranscriptionJobsPaginatorOptions struct { + // The maximum number of medical transcription jobs to return in the response. IF + // there are fewer results in the list, this response contains only the actual + // results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListMedicalTranscriptionJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/transcribe.ListMedicalTranscriptionJobs +type ListMedicalTranscriptionJobsPaginator struct { + options ListMedicalTranscriptionJobsPaginatorOptions + client ListMedicalTranscriptionJobsAPIClient + params *ListMedicalTranscriptionJobsInput + nextToken *string + firstPage bool + done bool +} + +// NewListMedicalTranscriptionJobsPaginator returns a new +// ListMedicalTranscriptionJobsPaginator +func NewListMedicalTranscriptionJobsPaginator(client ListMedicalTranscriptionJobsAPIClient, params *ListMedicalTranscriptionJobsInput, optFns ...func(*ListMedicalTranscriptionJobsPaginatorOptions)) *ListMedicalTranscriptionJobsPaginator { + options := ListMedicalTranscriptionJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListMedicalTranscriptionJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMedicalTranscriptionJobsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListMedicalTranscriptionJobs page. +func (p *ListMedicalTranscriptionJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMedicalTranscriptionJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListMedicalTranscriptionJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListLanguageModelsAPIClient is a client that implements the ListLanguageModels +// operation. +type ListLanguageModelsAPIClient interface { + ListLanguageModels(context.Context, *ListLanguageModelsInput, ...func(*Options)) (*ListLanguageModelsOutput, error) +} + +var _ ListLanguageModelsAPIClient = (*Client)(nil) + +// ListLanguageModelsPaginatorOptions is the paginator options for +// ListLanguageModels +type ListLanguageModelsPaginatorOptions struct { + // The maximum number of language models to return in the response. If there are + // fewer results in the list, the response contains only the actual results. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListLanguageModelsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/transcribe.ListLanguageModels +type ListLanguageModelsPaginator struct { + options ListLanguageModelsPaginatorOptions + client ListLanguageModelsAPIClient + params *ListLanguageModelsInput + nextToken *string + firstPage bool + done bool +} + +// NewListLanguageModelsPaginator returns a new ListLanguageModelsPaginator +func NewListLanguageModelsPaginator(client ListLanguageModelsAPIClient, params *ListLanguageModelsInput, optFns ...func(*ListLanguageModelsPaginatorOptions)) *ListLanguageModelsPaginator { + options := ListLanguageModelsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListLanguageModelsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListLanguageModelsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListLanguageModels page. +func (p *ListLanguageModelsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListLanguageModelsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListLanguageModels(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/transfer/go.sum b/service/transfer/go.sum index c669e324b14..32595049f96 100644 --- a/service/transfer/go.sum +++ b/service/transfer/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/transfer/paginators.go b/service/transfer/paginators.go new file mode 100644 index 00000000000..b4a7dc35ead --- /dev/null +++ b/service/transfer/paginators.go @@ -0,0 +1,311 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package transfer + +import ( + "context" + "fmt" +) + +// ListServersAPIClient is a client that implements the ListServers operation. +type ListServersAPIClient interface { + ListServers(context.Context, *ListServersInput, ...func(*Options)) (*ListServersOutput, error) +} + +var _ ListServersAPIClient = (*Client)(nil) + +// ListServersPaginatorOptions is the paginator options for ListServers +type ListServersPaginatorOptions struct { + // Specifies the number of servers to return as a response to the ListServers + // query. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListServersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/transfer.ListServers +type ListServersPaginator struct { + options ListServersPaginatorOptions + client ListServersAPIClient + params *ListServersInput + nextToken *string + firstPage bool + done bool +} + +// NewListServersPaginator returns a new ListServersPaginator +func NewListServersPaginator(client ListServersAPIClient, params *ListServersInput, optFns ...func(*ListServersPaginatorOptions)) *ListServersPaginator { + options := ListServersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListServersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListServersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListServers page. +func (p *ListServersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListServersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListServers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListSecurityPoliciesAPIClient is a client that implements the +// ListSecurityPolicies operation. +type ListSecurityPoliciesAPIClient interface { + ListSecurityPolicies(context.Context, *ListSecurityPoliciesInput, ...func(*Options)) (*ListSecurityPoliciesOutput, error) +} + +var _ ListSecurityPoliciesAPIClient = (*Client)(nil) + +// ListSecurityPoliciesPaginatorOptions is the paginator options for +// ListSecurityPolicies +type ListSecurityPoliciesPaginatorOptions struct { + // Specifies the number of security policies to return as a response to the + // ListSecurityPolicies query. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListSecurityPoliciesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/transfer.ListSecurityPolicies +type ListSecurityPoliciesPaginator struct { + options ListSecurityPoliciesPaginatorOptions + client ListSecurityPoliciesAPIClient + params *ListSecurityPoliciesInput + nextToken *string + firstPage bool + done bool +} + +// NewListSecurityPoliciesPaginator returns a new ListSecurityPoliciesPaginator +func NewListSecurityPoliciesPaginator(client ListSecurityPoliciesAPIClient, params *ListSecurityPoliciesInput, optFns ...func(*ListSecurityPoliciesPaginatorOptions)) *ListSecurityPoliciesPaginator { + options := ListSecurityPoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListSecurityPoliciesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSecurityPoliciesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListSecurityPolicies page. +func (p *ListSecurityPoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSecurityPoliciesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListSecurityPolicies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTagsForResourceAPIClient is a client that implements the ListTagsForResource +// operation. +type ListTagsForResourceAPIClient interface { + ListTagsForResource(context.Context, *ListTagsForResourceInput, ...func(*Options)) (*ListTagsForResourceOutput, error) +} + +var _ ListTagsForResourceAPIClient = (*Client)(nil) + +// ListTagsForResourcePaginatorOptions is the paginator options for +// ListTagsForResource +type ListTagsForResourcePaginatorOptions struct { + // Specifies the number of tags to return as a response to the ListTagsForResource + // request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTagsForResourcePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/transfer.ListTagsForResource +type ListTagsForResourcePaginator struct { + options ListTagsForResourcePaginatorOptions + client ListTagsForResourceAPIClient + params *ListTagsForResourceInput + nextToken *string + firstPage bool + done bool +} + +// NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator +func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator { + options := ListTagsForResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTagsForResourcePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTagsForResourcePaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTagsForResource page. +func (p *ListTagsForResourcePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListTagsForResource(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListUsersAPIClient is a client that implements the ListUsers operation. +type ListUsersAPIClient interface { + ListUsers(context.Context, *ListUsersInput, ...func(*Options)) (*ListUsersOutput, error) +} + +var _ ListUsersAPIClient = (*Client)(nil) + +// ListUsersPaginatorOptions is the paginator options for ListUsers +type ListUsersPaginatorOptions struct { + // Specifies the number of users to return as a response to the ListUsers request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListUsersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/transfer.ListUsers +type ListUsersPaginator struct { + options ListUsersPaginatorOptions + client ListUsersAPIClient + params *ListUsersInput + nextToken *string + firstPage bool + done bool +} + +// NewListUsersPaginator returns a new ListUsersPaginator +func NewListUsersPaginator(client ListUsersAPIClient, params *ListUsersInput, optFns ...func(*ListUsersPaginatorOptions)) *ListUsersPaginator { + options := ListUsersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListUsersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListUsersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListUsers page. +func (p *ListUsersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListUsersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListUsers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/translate/go.sum b/service/translate/go.sum index c669e324b14..32595049f96 100644 --- a/service/translate/go.sum +++ b/service/translate/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/translate/paginators.go b/service/translate/paginators.go new file mode 100644 index 00000000000..d4671dd2669 --- /dev/null +++ b/service/translate/paginators.go @@ -0,0 +1,160 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package translate + +import ( + "context" + "fmt" +) + +// ListTextTranslationJobsAPIClient is a client that implements the +// ListTextTranslationJobs operation. +type ListTextTranslationJobsAPIClient interface { + ListTextTranslationJobs(context.Context, *ListTextTranslationJobsInput, ...func(*Options)) (*ListTextTranslationJobsOutput, error) +} + +var _ ListTextTranslationJobsAPIClient = (*Client)(nil) + +// ListTextTranslationJobsPaginatorOptions is the paginator options for +// ListTextTranslationJobs +type ListTextTranslationJobsPaginatorOptions struct { + // The maximum number of results to return in each page. The default value is 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTextTranslationJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/translate.ListTextTranslationJobs +type ListTextTranslationJobsPaginator struct { + options ListTextTranslationJobsPaginatorOptions + client ListTextTranslationJobsAPIClient + params *ListTextTranslationJobsInput + nextToken *string + firstPage bool + done bool +} + +// NewListTextTranslationJobsPaginator returns a new +// ListTextTranslationJobsPaginator +func NewListTextTranslationJobsPaginator(client ListTextTranslationJobsAPIClient, params *ListTextTranslationJobsInput, optFns ...func(*ListTextTranslationJobsPaginatorOptions)) *ListTextTranslationJobsPaginator { + options := ListTextTranslationJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTextTranslationJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTextTranslationJobsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTextTranslationJobs page. +func (p *ListTextTranslationJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTextTranslationJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListTextTranslationJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListTerminologiesAPIClient is a client that implements the ListTerminologies +// operation. +type ListTerminologiesAPIClient interface { + ListTerminologies(context.Context, *ListTerminologiesInput, ...func(*Options)) (*ListTerminologiesOutput, error) +} + +var _ ListTerminologiesAPIClient = (*Client)(nil) + +// ListTerminologiesPaginatorOptions is the paginator options for ListTerminologies +type ListTerminologiesPaginatorOptions struct { + // The maximum number of custom terminologies returned per list request. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListTerminologiesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/translate.ListTerminologies +type ListTerminologiesPaginator struct { + options ListTerminologiesPaginatorOptions + client ListTerminologiesAPIClient + params *ListTerminologiesInput + nextToken *string + firstPage bool + done bool +} + +// NewListTerminologiesPaginator returns a new ListTerminologiesPaginator +func NewListTerminologiesPaginator(client ListTerminologiesAPIClient, params *ListTerminologiesInput, optFns ...func(*ListTerminologiesPaginatorOptions)) *ListTerminologiesPaginator { + options := ListTerminologiesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListTerminologiesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTerminologiesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListTerminologies page. +func (p *ListTerminologiesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTerminologiesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListTerminologies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/waf/go.sum b/service/waf/go.sum index c669e324b14..32595049f96 100644 --- a/service/waf/go.sum +++ b/service/waf/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/wafregional/go.sum b/service/wafregional/go.sum index c669e324b14..32595049f96 100644 --- a/service/wafregional/go.sum +++ b/service/wafregional/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/wafv2/go.sum b/service/wafv2/go.sum index c669e324b14..32595049f96 100644 --- a/service/wafv2/go.sum +++ b/service/wafv2/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/workdocs/go.sum b/service/workdocs/go.sum index c669e324b14..32595049f96 100644 --- a/service/workdocs/go.sum +++ b/service/workdocs/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/workdocs/paginators.go b/service/workdocs/paginators.go new file mode 100644 index 00000000000..88d3bab7949 --- /dev/null +++ b/service/workdocs/paginators.go @@ -0,0 +1,235 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workdocs + +import ( + "context" + "fmt" +) + +// DescribeDocumentVersionsAPIClient is a client that implements the +// DescribeDocumentVersions operation. +type DescribeDocumentVersionsAPIClient interface { + DescribeDocumentVersions(context.Context, *DescribeDocumentVersionsInput, ...func(*Options)) (*DescribeDocumentVersionsOutput, error) +} + +var _ DescribeDocumentVersionsAPIClient = (*Client)(nil) + +// DescribeDocumentVersionsPaginatorOptions is the paginator options for +// DescribeDocumentVersions +type DescribeDocumentVersionsPaginatorOptions struct { + // The maximum number of versions to return with this call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeDocumentVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/workdocs.DescribeDocumentVersions +type DescribeDocumentVersionsPaginator struct { + options DescribeDocumentVersionsPaginatorOptions + client DescribeDocumentVersionsAPIClient + params *DescribeDocumentVersionsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeDocumentVersionsPaginator returns a new +// DescribeDocumentVersionsPaginator +func NewDescribeDocumentVersionsPaginator(client DescribeDocumentVersionsAPIClient, params *DescribeDocumentVersionsInput, optFns ...func(*DescribeDocumentVersionsPaginatorOptions)) *DescribeDocumentVersionsPaginator { + options := DescribeDocumentVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeDocumentVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDocumentVersionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeDocumentVersions page. +func (p *DescribeDocumentVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDocumentVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.DescribeDocumentVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeUsersAPIClient is a client that implements the DescribeUsers operation. +type DescribeUsersAPIClient interface { + DescribeUsers(context.Context, *DescribeUsersInput, ...func(*Options)) (*DescribeUsersOutput, error) +} + +var _ DescribeUsersAPIClient = (*Client)(nil) + +// DescribeUsersPaginatorOptions is the paginator options for DescribeUsers +type DescribeUsersPaginatorOptions struct { + // The maximum number of items to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeUsersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/workdocs.DescribeUsers +type DescribeUsersPaginator struct { + options DescribeUsersPaginatorOptions + client DescribeUsersAPIClient + params *DescribeUsersInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeUsersPaginator returns a new DescribeUsersPaginator +func NewDescribeUsersPaginator(client DescribeUsersAPIClient, params *DescribeUsersInput, optFns ...func(*DescribeUsersPaginatorOptions)) *DescribeUsersPaginator { + options := DescribeUsersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeUsersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeUsersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeUsers page. +func (p *DescribeUsersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeUsersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.DescribeUsers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeFolderContentsAPIClient is a client that implements the +// DescribeFolderContents operation. +type DescribeFolderContentsAPIClient interface { + DescribeFolderContents(context.Context, *DescribeFolderContentsInput, ...func(*Options)) (*DescribeFolderContentsOutput, error) +} + +var _ DescribeFolderContentsAPIClient = (*Client)(nil) + +// DescribeFolderContentsPaginatorOptions is the paginator options for +// DescribeFolderContents +type DescribeFolderContentsPaginatorOptions struct { + // The maximum number of items to return with this call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeFolderContentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/workdocs.DescribeFolderContents +type DescribeFolderContentsPaginator struct { + options DescribeFolderContentsPaginatorOptions + client DescribeFolderContentsAPIClient + params *DescribeFolderContentsInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeFolderContentsPaginator returns a new DescribeFolderContentsPaginator +func NewDescribeFolderContentsPaginator(client DescribeFolderContentsAPIClient, params *DescribeFolderContentsInput, optFns ...func(*DescribeFolderContentsPaginatorOptions)) *DescribeFolderContentsPaginator { + options := DescribeFolderContentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeFolderContentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeFolderContentsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeFolderContents page. +func (p *DescribeFolderContentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeFolderContentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.DescribeFolderContents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && params.Marker != nil && p.nextToken != nil && *params.Marker == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/worklink/go.sum b/service/worklink/go.sum index c669e324b14..32595049f96 100644 --- a/service/worklink/go.sum +++ b/service/worklink/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/worklink/paginators.go b/service/worklink/paginators.go new file mode 100644 index 00000000000..bfa83e7ced3 --- /dev/null +++ b/service/worklink/paginators.go @@ -0,0 +1,384 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package worklink + +import ( + "context" + "fmt" +) + +// ListWebsiteCertificateAuthoritiesAPIClient is a client that implements the +// ListWebsiteCertificateAuthorities operation. +type ListWebsiteCertificateAuthoritiesAPIClient interface { + ListWebsiteCertificateAuthorities(context.Context, *ListWebsiteCertificateAuthoritiesInput, ...func(*Options)) (*ListWebsiteCertificateAuthoritiesOutput, error) +} + +var _ ListWebsiteCertificateAuthoritiesAPIClient = (*Client)(nil) + +// ListWebsiteCertificateAuthoritiesPaginatorOptions is the paginator options for +// ListWebsiteCertificateAuthorities +type ListWebsiteCertificateAuthoritiesPaginatorOptions struct { + // The maximum number of results to be included in the next page. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListWebsiteCertificateAuthoritiesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/worklink.ListWebsiteCertificateAuthorities +type ListWebsiteCertificateAuthoritiesPaginator struct { + options ListWebsiteCertificateAuthoritiesPaginatorOptions + client ListWebsiteCertificateAuthoritiesAPIClient + params *ListWebsiteCertificateAuthoritiesInput + nextToken *string + firstPage bool + done bool +} + +// NewListWebsiteCertificateAuthoritiesPaginator returns a new +// ListWebsiteCertificateAuthoritiesPaginator +func NewListWebsiteCertificateAuthoritiesPaginator(client ListWebsiteCertificateAuthoritiesAPIClient, params *ListWebsiteCertificateAuthoritiesInput, optFns ...func(*ListWebsiteCertificateAuthoritiesPaginatorOptions)) *ListWebsiteCertificateAuthoritiesPaginator { + options := ListWebsiteCertificateAuthoritiesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListWebsiteCertificateAuthoritiesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListWebsiteCertificateAuthoritiesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListWebsiteCertificateAuthorities page. +func (p *ListWebsiteCertificateAuthoritiesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListWebsiteCertificateAuthoritiesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListWebsiteCertificateAuthorities(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDomainsAPIClient is a client that implements the ListDomains operation. +type ListDomainsAPIClient interface { + ListDomains(context.Context, *ListDomainsInput, ...func(*Options)) (*ListDomainsOutput, error) +} + +var _ ListDomainsAPIClient = (*Client)(nil) + +// ListDomainsPaginatorOptions is the paginator options for ListDomains +type ListDomainsPaginatorOptions struct { + // The maximum number of results to be included in the next page. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDomainsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/worklink.ListDomains +type ListDomainsPaginator struct { + options ListDomainsPaginatorOptions + client ListDomainsAPIClient + params *ListDomainsInput + nextToken *string + firstPage bool + done bool +} + +// NewListDomainsPaginator returns a new ListDomainsPaginator +func NewListDomainsPaginator(client ListDomainsAPIClient, params *ListDomainsInput, optFns ...func(*ListDomainsPaginatorOptions)) *ListDomainsPaginator { + options := ListDomainsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDomainsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDomainsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDomains page. +func (p *ListDomainsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDomainsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListDomains(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListFleetsAPIClient is a client that implements the ListFleets operation. +type ListFleetsAPIClient interface { + ListFleets(context.Context, *ListFleetsInput, ...func(*Options)) (*ListFleetsOutput, error) +} + +var _ ListFleetsAPIClient = (*Client)(nil) + +// ListFleetsPaginatorOptions is the paginator options for ListFleets +type ListFleetsPaginatorOptions struct { + // The maximum number of results to be included in the next page. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListFleetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/worklink.ListFleets +type ListFleetsPaginator struct { + options ListFleetsPaginatorOptions + client ListFleetsAPIClient + params *ListFleetsInput + nextToken *string + firstPage bool + done bool +} + +// NewListFleetsPaginator returns a new ListFleetsPaginator +func NewListFleetsPaginator(client ListFleetsAPIClient, params *ListFleetsInput, optFns ...func(*ListFleetsPaginatorOptions)) *ListFleetsPaginator { + options := ListFleetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListFleetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListFleetsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListFleets page. +func (p *ListFleetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFleetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListFleets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListDevicesAPIClient is a client that implements the ListDevices operation. +type ListDevicesAPIClient interface { + ListDevices(context.Context, *ListDevicesInput, ...func(*Options)) (*ListDevicesOutput, error) +} + +var _ ListDevicesAPIClient = (*Client)(nil) + +// ListDevicesPaginatorOptions is the paginator options for ListDevices +type ListDevicesPaginatorOptions struct { + // The maximum number of results to be included in the next page. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListDevicesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/worklink.ListDevices +type ListDevicesPaginator struct { + options ListDevicesPaginatorOptions + client ListDevicesAPIClient + params *ListDevicesInput + nextToken *string + firstPage bool + done bool +} + +// NewListDevicesPaginator returns a new ListDevicesPaginator +func NewListDevicesPaginator(client ListDevicesAPIClient, params *ListDevicesInput, optFns ...func(*ListDevicesPaginatorOptions)) *ListDevicesPaginator { + options := ListDevicesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListDevicesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDevicesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListDevices page. +func (p *ListDevicesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDevicesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListDevices(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListWebsiteAuthorizationProvidersAPIClient is a client that implements the +// ListWebsiteAuthorizationProviders operation. +type ListWebsiteAuthorizationProvidersAPIClient interface { + ListWebsiteAuthorizationProviders(context.Context, *ListWebsiteAuthorizationProvidersInput, ...func(*Options)) (*ListWebsiteAuthorizationProvidersOutput, error) +} + +var _ ListWebsiteAuthorizationProvidersAPIClient = (*Client)(nil) + +// ListWebsiteAuthorizationProvidersPaginatorOptions is the paginator options for +// ListWebsiteAuthorizationProviders +type ListWebsiteAuthorizationProvidersPaginatorOptions struct { + // The maximum number of results to be included in the next page. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListWebsiteAuthorizationProvidersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/worklink.ListWebsiteAuthorizationProviders +type ListWebsiteAuthorizationProvidersPaginator struct { + options ListWebsiteAuthorizationProvidersPaginatorOptions + client ListWebsiteAuthorizationProvidersAPIClient + params *ListWebsiteAuthorizationProvidersInput + nextToken *string + firstPage bool + done bool +} + +// NewListWebsiteAuthorizationProvidersPaginator returns a new +// ListWebsiteAuthorizationProvidersPaginator +func NewListWebsiteAuthorizationProvidersPaginator(client ListWebsiteAuthorizationProvidersAPIClient, params *ListWebsiteAuthorizationProvidersInput, optFns ...func(*ListWebsiteAuthorizationProvidersPaginatorOptions)) *ListWebsiteAuthorizationProvidersPaginator { + options := ListWebsiteAuthorizationProvidersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListWebsiteAuthorizationProvidersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListWebsiteAuthorizationProvidersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListWebsiteAuthorizationProviders page. +func (p *ListWebsiteAuthorizationProvidersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListWebsiteAuthorizationProvidersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListWebsiteAuthorizationProviders(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/workmail/go.sum b/service/workmail/go.sum index c669e324b14..32595049f96 100644 --- a/service/workmail/go.sum +++ b/service/workmail/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/workmail/paginators.go b/service/workmail/paginators.go new file mode 100644 index 00000000000..e0177267448 --- /dev/null +++ b/service/workmail/paginators.go @@ -0,0 +1,682 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workmail + +import ( + "context" + "fmt" +) + +// ListGroupMembersAPIClient is a client that implements the ListGroupMembers +// operation. +type ListGroupMembersAPIClient interface { + ListGroupMembers(context.Context, *ListGroupMembersInput, ...func(*Options)) (*ListGroupMembersOutput, error) +} + +var _ ListGroupMembersAPIClient = (*Client)(nil) + +// ListGroupMembersPaginatorOptions is the paginator options for ListGroupMembers +type ListGroupMembersPaginatorOptions struct { + // The maximum number of results to return in a single call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListGroupMembersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/workmail.ListGroupMembers +type ListGroupMembersPaginator struct { + options ListGroupMembersPaginatorOptions + client ListGroupMembersAPIClient + params *ListGroupMembersInput + nextToken *string + firstPage bool + done bool +} + +// NewListGroupMembersPaginator returns a new ListGroupMembersPaginator +func NewListGroupMembersPaginator(client ListGroupMembersAPIClient, params *ListGroupMembersInput, optFns ...func(*ListGroupMembersPaginatorOptions)) *ListGroupMembersPaginator { + options := ListGroupMembersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListGroupMembersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListGroupMembersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListGroupMembers page. +func (p *ListGroupMembersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListGroupMembersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListGroupMembers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListResourceDelegatesAPIClient is a client that implements the +// ListResourceDelegates operation. +type ListResourceDelegatesAPIClient interface { + ListResourceDelegates(context.Context, *ListResourceDelegatesInput, ...func(*Options)) (*ListResourceDelegatesOutput, error) +} + +var _ ListResourceDelegatesAPIClient = (*Client)(nil) + +// ListResourceDelegatesPaginatorOptions is the paginator options for +// ListResourceDelegates +type ListResourceDelegatesPaginatorOptions struct { + // The number of maximum results in a page. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListResourceDelegatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/workmail.ListResourceDelegates +type ListResourceDelegatesPaginator struct { + options ListResourceDelegatesPaginatorOptions + client ListResourceDelegatesAPIClient + params *ListResourceDelegatesInput + nextToken *string + firstPage bool + done bool +} + +// NewListResourceDelegatesPaginator returns a new ListResourceDelegatesPaginator +func NewListResourceDelegatesPaginator(client ListResourceDelegatesAPIClient, params *ListResourceDelegatesInput, optFns ...func(*ListResourceDelegatesPaginatorOptions)) *ListResourceDelegatesPaginator { + options := ListResourceDelegatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListResourceDelegatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListResourceDelegatesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListResourceDelegates page. +func (p *ListResourceDelegatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListResourceDelegatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListResourceDelegates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListAliasesAPIClient is a client that implements the ListAliases operation. +type ListAliasesAPIClient interface { + ListAliases(context.Context, *ListAliasesInput, ...func(*Options)) (*ListAliasesOutput, error) +} + +var _ ListAliasesAPIClient = (*Client)(nil) + +// ListAliasesPaginatorOptions is the paginator options for ListAliases +type ListAliasesPaginatorOptions struct { + // The maximum number of results to return in a single call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListAliasesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/workmail.ListAliases +type ListAliasesPaginator struct { + options ListAliasesPaginatorOptions + client ListAliasesAPIClient + params *ListAliasesInput + nextToken *string + firstPage bool + done bool +} + +// NewListAliasesPaginator returns a new ListAliasesPaginator +func NewListAliasesPaginator(client ListAliasesAPIClient, params *ListAliasesInput, optFns ...func(*ListAliasesPaginatorOptions)) *ListAliasesPaginator { + options := ListAliasesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListAliasesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAliasesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListAliases page. +func (p *ListAliasesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAliasesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListAliases(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListMailboxExportJobsAPIClient is a client that implements the +// ListMailboxExportJobs operation. +type ListMailboxExportJobsAPIClient interface { + ListMailboxExportJobs(context.Context, *ListMailboxExportJobsInput, ...func(*Options)) (*ListMailboxExportJobsOutput, error) +} + +var _ ListMailboxExportJobsAPIClient = (*Client)(nil) + +// ListMailboxExportJobsPaginatorOptions is the paginator options for +// ListMailboxExportJobs +type ListMailboxExportJobsPaginatorOptions struct { + // The maximum number of results to return in a single call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListMailboxExportJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/workmail.ListMailboxExportJobs +type ListMailboxExportJobsPaginator struct { + options ListMailboxExportJobsPaginatorOptions + client ListMailboxExportJobsAPIClient + params *ListMailboxExportJobsInput + nextToken *string + firstPage bool + done bool +} + +// NewListMailboxExportJobsPaginator returns a new ListMailboxExportJobsPaginator +func NewListMailboxExportJobsPaginator(client ListMailboxExportJobsAPIClient, params *ListMailboxExportJobsInput, optFns ...func(*ListMailboxExportJobsPaginatorOptions)) *ListMailboxExportJobsPaginator { + options := ListMailboxExportJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListMailboxExportJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMailboxExportJobsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListMailboxExportJobs page. +func (p *ListMailboxExportJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMailboxExportJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListMailboxExportJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListUsersAPIClient is a client that implements the ListUsers operation. +type ListUsersAPIClient interface { + ListUsers(context.Context, *ListUsersInput, ...func(*Options)) (*ListUsersOutput, error) +} + +var _ ListUsersAPIClient = (*Client)(nil) + +// ListUsersPaginatorOptions is the paginator options for ListUsers +type ListUsersPaginatorOptions struct { + // The maximum number of results to return in a single call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListUsersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/workmail.ListUsers +type ListUsersPaginator struct { + options ListUsersPaginatorOptions + client ListUsersAPIClient + params *ListUsersInput + nextToken *string + firstPage bool + done bool +} + +// NewListUsersPaginator returns a new ListUsersPaginator +func NewListUsersPaginator(client ListUsersAPIClient, params *ListUsersInput, optFns ...func(*ListUsersPaginatorOptions)) *ListUsersPaginator { + options := ListUsersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListUsersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListUsersPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListUsers page. +func (p *ListUsersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListUsersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListUsers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListResourcesAPIClient is a client that implements the ListResources operation. +type ListResourcesAPIClient interface { + ListResources(context.Context, *ListResourcesInput, ...func(*Options)) (*ListResourcesOutput, error) +} + +var _ ListResourcesAPIClient = (*Client)(nil) + +// ListResourcesPaginatorOptions is the paginator options for ListResources +type ListResourcesPaginatorOptions struct { + // The maximum number of results to return in a single call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListResourcesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/workmail.ListResources +type ListResourcesPaginator struct { + options ListResourcesPaginatorOptions + client ListResourcesAPIClient + params *ListResourcesInput + nextToken *string + firstPage bool + done bool +} + +// NewListResourcesPaginator returns a new ListResourcesPaginator +func NewListResourcesPaginator(client ListResourcesAPIClient, params *ListResourcesInput, optFns ...func(*ListResourcesPaginatorOptions)) *ListResourcesPaginator { + options := ListResourcesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListResourcesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListResourcesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListResources page. +func (p *ListResourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListResourcesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListResources(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListOrganizationsAPIClient is a client that implements the ListOrganizations +// operation. +type ListOrganizationsAPIClient interface { + ListOrganizations(context.Context, *ListOrganizationsInput, ...func(*Options)) (*ListOrganizationsOutput, error) +} + +var _ ListOrganizationsAPIClient = (*Client)(nil) + +// ListOrganizationsPaginatorOptions is the paginator options for ListOrganizations +type ListOrganizationsPaginatorOptions struct { + // The maximum number of results to return in a single call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListOrganizationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/workmail.ListOrganizations +type ListOrganizationsPaginator struct { + options ListOrganizationsPaginatorOptions + client ListOrganizationsAPIClient + params *ListOrganizationsInput + nextToken *string + firstPage bool + done bool +} + +// NewListOrganizationsPaginator returns a new ListOrganizationsPaginator +func NewListOrganizationsPaginator(client ListOrganizationsAPIClient, params *ListOrganizationsInput, optFns ...func(*ListOrganizationsPaginatorOptions)) *ListOrganizationsPaginator { + options := ListOrganizationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListOrganizationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListOrganizationsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListOrganizations page. +func (p *ListOrganizationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListOrganizationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListOrganizations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListGroupsAPIClient is a client that implements the ListGroups operation. +type ListGroupsAPIClient interface { + ListGroups(context.Context, *ListGroupsInput, ...func(*Options)) (*ListGroupsOutput, error) +} + +var _ ListGroupsAPIClient = (*Client)(nil) + +// ListGroupsPaginatorOptions is the paginator options for ListGroups +type ListGroupsPaginatorOptions struct { + // The maximum number of results to return in a single call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/workmail.ListGroups +type ListGroupsPaginator struct { + options ListGroupsPaginatorOptions + client ListGroupsAPIClient + params *ListGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewListGroupsPaginator returns a new ListGroupsPaginator +func NewListGroupsPaginator(client ListGroupsAPIClient, params *ListGroupsInput, optFns ...func(*ListGroupsPaginatorOptions)) *ListGroupsPaginator { + options := ListGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListGroups page. +func (p *ListGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// ListMailboxPermissionsAPIClient is a client that implements the +// ListMailboxPermissions operation. +type ListMailboxPermissionsAPIClient interface { + ListMailboxPermissions(context.Context, *ListMailboxPermissionsInput, ...func(*Options)) (*ListMailboxPermissionsOutput, error) +} + +var _ ListMailboxPermissionsAPIClient = (*Client)(nil) + +// ListMailboxPermissionsPaginatorOptions is the paginator options for +// ListMailboxPermissions +type ListMailboxPermissionsPaginatorOptions struct { + // The maximum number of results to return in a single call. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// ListMailboxPermissionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/workmail.ListMailboxPermissions +type ListMailboxPermissionsPaginator struct { + options ListMailboxPermissionsPaginatorOptions + client ListMailboxPermissionsAPIClient + params *ListMailboxPermissionsInput + nextToken *string + firstPage bool + done bool +} + +// NewListMailboxPermissionsPaginator returns a new ListMailboxPermissionsPaginator +func NewListMailboxPermissionsPaginator(client ListMailboxPermissionsAPIClient, params *ListMailboxPermissionsInput, optFns ...func(*ListMailboxPermissionsPaginatorOptions)) *ListMailboxPermissionsPaginator { + options := ListMailboxPermissionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &ListMailboxPermissionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMailboxPermissionsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next ListMailboxPermissions page. +func (p *ListMailboxPermissionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMailboxPermissionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.MaxResults = p.options.Limit + result, err := p.client.ListMailboxPermissions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/workmailmessageflow/go.sum b/service/workmailmessageflow/go.sum index c669e324b14..32595049f96 100644 --- a/service/workmailmessageflow/go.sum +++ b/service/workmailmessageflow/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/workspaces/go.sum b/service/workspaces/go.sum index c669e324b14..32595049f96 100644 --- a/service/workspaces/go.sum +++ b/service/workspaces/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/workspaces/paginators.go b/service/workspaces/paginators.go new file mode 100644 index 00000000000..58bbf204b30 --- /dev/null +++ b/service/workspaces/paginators.go @@ -0,0 +1,230 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workspaces + +import ( + "context" + "fmt" +) + +// DescribeWorkspaceBundlesAPIClient is a client that implements the +// DescribeWorkspaceBundles operation. +type DescribeWorkspaceBundlesAPIClient interface { + DescribeWorkspaceBundles(context.Context, *DescribeWorkspaceBundlesInput, ...func(*Options)) (*DescribeWorkspaceBundlesOutput, error) +} + +var _ DescribeWorkspaceBundlesAPIClient = (*Client)(nil) + +// DescribeWorkspaceBundlesPaginatorOptions is the paginator options for +// DescribeWorkspaceBundles +type DescribeWorkspaceBundlesPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeWorkspaceBundlesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/workspaces.DescribeWorkspaceBundles +type DescribeWorkspaceBundlesPaginator struct { + options DescribeWorkspaceBundlesPaginatorOptions + client DescribeWorkspaceBundlesAPIClient + params *DescribeWorkspaceBundlesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeWorkspaceBundlesPaginator returns a new +// DescribeWorkspaceBundlesPaginator +func NewDescribeWorkspaceBundlesPaginator(client DescribeWorkspaceBundlesAPIClient, params *DescribeWorkspaceBundlesInput, optFns ...func(*DescribeWorkspaceBundlesPaginatorOptions)) *DescribeWorkspaceBundlesPaginator { + options := DescribeWorkspaceBundlesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeWorkspaceBundlesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeWorkspaceBundlesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeWorkspaceBundles page. +func (p *DescribeWorkspaceBundlesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeWorkspaceBundlesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.DescribeWorkspaceBundles(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeWorkspaceDirectoriesAPIClient is a client that implements the +// DescribeWorkspaceDirectories operation. +type DescribeWorkspaceDirectoriesAPIClient interface { + DescribeWorkspaceDirectories(context.Context, *DescribeWorkspaceDirectoriesInput, ...func(*Options)) (*DescribeWorkspaceDirectoriesOutput, error) +} + +var _ DescribeWorkspaceDirectoriesAPIClient = (*Client)(nil) + +// DescribeWorkspaceDirectoriesPaginatorOptions is the paginator options for +// DescribeWorkspaceDirectories +type DescribeWorkspaceDirectoriesPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeWorkspaceDirectoriesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/workspaces.DescribeWorkspaceDirectories +type DescribeWorkspaceDirectoriesPaginator struct { + options DescribeWorkspaceDirectoriesPaginatorOptions + client DescribeWorkspaceDirectoriesAPIClient + params *DescribeWorkspaceDirectoriesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeWorkspaceDirectoriesPaginator returns a new +// DescribeWorkspaceDirectoriesPaginator +func NewDescribeWorkspaceDirectoriesPaginator(client DescribeWorkspaceDirectoriesAPIClient, params *DescribeWorkspaceDirectoriesInput, optFns ...func(*DescribeWorkspaceDirectoriesPaginatorOptions)) *DescribeWorkspaceDirectoriesPaginator { + options := DescribeWorkspaceDirectoriesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeWorkspaceDirectoriesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeWorkspaceDirectoriesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeWorkspaceDirectories page. +func (p *DescribeWorkspaceDirectoriesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeWorkspaceDirectoriesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.DescribeWorkspaceDirectories(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// DescribeWorkspacesAPIClient is a client that implements the DescribeWorkspaces +// operation. +type DescribeWorkspacesAPIClient interface { + DescribeWorkspaces(context.Context, *DescribeWorkspacesInput, ...func(*Options)) (*DescribeWorkspacesOutput, error) +} + +var _ DescribeWorkspacesAPIClient = (*Client)(nil) + +// DescribeWorkspacesPaginatorOptions is the paginator options for +// DescribeWorkspaces +type DescribeWorkspacesPaginatorOptions struct { + // The maximum number of items to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// DescribeWorkspacesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/workspaces.DescribeWorkspaces +type DescribeWorkspacesPaginator struct { + options DescribeWorkspacesPaginatorOptions + client DescribeWorkspacesAPIClient + params *DescribeWorkspacesInput + nextToken *string + firstPage bool + done bool +} + +// NewDescribeWorkspacesPaginator returns a new DescribeWorkspacesPaginator +func NewDescribeWorkspacesPaginator(client DescribeWorkspacesAPIClient, params *DescribeWorkspacesInput, optFns ...func(*DescribeWorkspacesPaginatorOptions)) *DescribeWorkspacesPaginator { + options := DescribeWorkspacesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &DescribeWorkspacesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeWorkspacesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next DescribeWorkspaces page. +func (p *DescribeWorkspacesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeWorkspacesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + params.Limit = p.options.Limit + result, err := p.client.DescribeWorkspaces(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} diff --git a/service/xray/go.sum b/service/xray/go.sum index c669e324b14..32595049f96 100644 --- a/service/xray/go.sum +++ b/service/xray/go.sum @@ -1,3 +1,5 @@ +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 h1:NDg6Bwjf66s4oWQbGK+j5izWT/HdOnCEWahy5ZfQRfY= +github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= diff --git a/service/xray/paginators.go b/service/xray/paginators.go new file mode 100644 index 00000000000..3dd6fd982e4 --- /dev/null +++ b/service/xray/paginators.go @@ -0,0 +1,578 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package xray + +import ( + "context" + "fmt" +) + +// GetServiceGraphAPIClient is a client that implements the GetServiceGraph +// operation. +type GetServiceGraphAPIClient interface { + GetServiceGraph(context.Context, *GetServiceGraphInput, ...func(*Options)) (*GetServiceGraphOutput, error) +} + +var _ GetServiceGraphAPIClient = (*Client)(nil) + +// GetServiceGraphPaginatorOptions is the paginator options for GetServiceGraph +type GetServiceGraphPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetServiceGraphPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/xray.GetServiceGraph +type GetServiceGraphPaginator struct { + options GetServiceGraphPaginatorOptions + client GetServiceGraphAPIClient + params *GetServiceGraphInput + nextToken *string + firstPage bool + done bool +} + +// NewGetServiceGraphPaginator returns a new GetServiceGraphPaginator +func NewGetServiceGraphPaginator(client GetServiceGraphAPIClient, params *GetServiceGraphInput, optFns ...func(*GetServiceGraphPaginatorOptions)) *GetServiceGraphPaginator { + options := GetServiceGraphPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetServiceGraphPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetServiceGraphPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetServiceGraph page. +func (p *GetServiceGraphPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetServiceGraphOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.GetServiceGraph(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetTraceGraphAPIClient is a client that implements the GetTraceGraph operation. +type GetTraceGraphAPIClient interface { + GetTraceGraph(context.Context, *GetTraceGraphInput, ...func(*Options)) (*GetTraceGraphOutput, error) +} + +var _ GetTraceGraphAPIClient = (*Client)(nil) + +// GetTraceGraphPaginatorOptions is the paginator options for GetTraceGraph +type GetTraceGraphPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetTraceGraphPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/xray.GetTraceGraph +type GetTraceGraphPaginator struct { + options GetTraceGraphPaginatorOptions + client GetTraceGraphAPIClient + params *GetTraceGraphInput + nextToken *string + firstPage bool + done bool +} + +// NewGetTraceGraphPaginator returns a new GetTraceGraphPaginator +func NewGetTraceGraphPaginator(client GetTraceGraphAPIClient, params *GetTraceGraphInput, optFns ...func(*GetTraceGraphPaginatorOptions)) *GetTraceGraphPaginator { + options := GetTraceGraphPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetTraceGraphPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetTraceGraphPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetTraceGraph page. +func (p *GetTraceGraphPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetTraceGraphOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.GetTraceGraph(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetSamplingStatisticSummariesAPIClient is a client that implements the +// GetSamplingStatisticSummaries operation. +type GetSamplingStatisticSummariesAPIClient interface { + GetSamplingStatisticSummaries(context.Context, *GetSamplingStatisticSummariesInput, ...func(*Options)) (*GetSamplingStatisticSummariesOutput, error) +} + +var _ GetSamplingStatisticSummariesAPIClient = (*Client)(nil) + +// GetSamplingStatisticSummariesPaginatorOptions is the paginator options for +// GetSamplingStatisticSummaries +type GetSamplingStatisticSummariesPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetSamplingStatisticSummariesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/xray.GetSamplingStatisticSummaries +type GetSamplingStatisticSummariesPaginator struct { + options GetSamplingStatisticSummariesPaginatorOptions + client GetSamplingStatisticSummariesAPIClient + params *GetSamplingStatisticSummariesInput + nextToken *string + firstPage bool + done bool +} + +// NewGetSamplingStatisticSummariesPaginator returns a new +// GetSamplingStatisticSummariesPaginator +func NewGetSamplingStatisticSummariesPaginator(client GetSamplingStatisticSummariesAPIClient, params *GetSamplingStatisticSummariesInput, optFns ...func(*GetSamplingStatisticSummariesPaginatorOptions)) *GetSamplingStatisticSummariesPaginator { + options := GetSamplingStatisticSummariesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetSamplingStatisticSummariesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetSamplingStatisticSummariesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetSamplingStatisticSummaries page. +func (p *GetSamplingStatisticSummariesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetSamplingStatisticSummariesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.GetSamplingStatisticSummaries(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetGroupsAPIClient is a client that implements the GetGroups operation. +type GetGroupsAPIClient interface { + GetGroups(context.Context, *GetGroupsInput, ...func(*Options)) (*GetGroupsOutput, error) +} + +var _ GetGroupsAPIClient = (*Client)(nil) + +// GetGroupsPaginatorOptions is the paginator options for GetGroups +type GetGroupsPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/xray.GetGroups +type GetGroupsPaginator struct { + options GetGroupsPaginatorOptions + client GetGroupsAPIClient + params *GetGroupsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetGroupsPaginator returns a new GetGroupsPaginator +func NewGetGroupsPaginator(client GetGroupsAPIClient, params *GetGroupsInput, optFns ...func(*GetGroupsPaginatorOptions)) *GetGroupsPaginator { + options := GetGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetGroupsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetGroups page. +func (p *GetGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.GetGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// BatchGetTracesAPIClient is a client that implements the BatchGetTraces +// operation. +type BatchGetTracesAPIClient interface { + BatchGetTraces(context.Context, *BatchGetTracesInput, ...func(*Options)) (*BatchGetTracesOutput, error) +} + +var _ BatchGetTracesAPIClient = (*Client)(nil) + +// BatchGetTracesPaginatorOptions is the paginator options for BatchGetTraces +type BatchGetTracesPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// BatchGetTracesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/xray.BatchGetTraces +type BatchGetTracesPaginator struct { + options BatchGetTracesPaginatorOptions + client BatchGetTracesAPIClient + params *BatchGetTracesInput + nextToken *string + firstPage bool + done bool +} + +// NewBatchGetTracesPaginator returns a new BatchGetTracesPaginator +func NewBatchGetTracesPaginator(client BatchGetTracesAPIClient, params *BatchGetTracesInput, optFns ...func(*BatchGetTracesPaginatorOptions)) *BatchGetTracesPaginator { + options := BatchGetTracesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &BatchGetTracesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *BatchGetTracesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next BatchGetTraces page. +func (p *BatchGetTracesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*BatchGetTracesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.BatchGetTraces(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetTraceSummariesAPIClient is a client that implements the GetTraceSummaries +// operation. +type GetTraceSummariesAPIClient interface { + GetTraceSummaries(context.Context, *GetTraceSummariesInput, ...func(*Options)) (*GetTraceSummariesOutput, error) +} + +var _ GetTraceSummariesAPIClient = (*Client)(nil) + +// GetTraceSummariesPaginatorOptions is the paginator options for GetTraceSummaries +type GetTraceSummariesPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetTraceSummariesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/xray.GetTraceSummaries +type GetTraceSummariesPaginator struct { + options GetTraceSummariesPaginatorOptions + client GetTraceSummariesAPIClient + params *GetTraceSummariesInput + nextToken *string + firstPage bool + done bool +} + +// NewGetTraceSummariesPaginator returns a new GetTraceSummariesPaginator +func NewGetTraceSummariesPaginator(client GetTraceSummariesAPIClient, params *GetTraceSummariesInput, optFns ...func(*GetTraceSummariesPaginatorOptions)) *GetTraceSummariesPaginator { + options := GetTraceSummariesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetTraceSummariesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetTraceSummariesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetTraceSummaries page. +func (p *GetTraceSummariesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetTraceSummariesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.GetTraceSummaries(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetTimeSeriesServiceStatisticsAPIClient is a client that implements the +// GetTimeSeriesServiceStatistics operation. +type GetTimeSeriesServiceStatisticsAPIClient interface { + GetTimeSeriesServiceStatistics(context.Context, *GetTimeSeriesServiceStatisticsInput, ...func(*Options)) (*GetTimeSeriesServiceStatisticsOutput, error) +} + +var _ GetTimeSeriesServiceStatisticsAPIClient = (*Client)(nil) + +// GetTimeSeriesServiceStatisticsPaginatorOptions is the paginator options for +// GetTimeSeriesServiceStatistics +type GetTimeSeriesServiceStatisticsPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetTimeSeriesServiceStatisticsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/xray.GetTimeSeriesServiceStatistics +type GetTimeSeriesServiceStatisticsPaginator struct { + options GetTimeSeriesServiceStatisticsPaginatorOptions + client GetTimeSeriesServiceStatisticsAPIClient + params *GetTimeSeriesServiceStatisticsInput + nextToken *string + firstPage bool + done bool +} + +// NewGetTimeSeriesServiceStatisticsPaginator returns a new +// GetTimeSeriesServiceStatisticsPaginator +func NewGetTimeSeriesServiceStatisticsPaginator(client GetTimeSeriesServiceStatisticsAPIClient, params *GetTimeSeriesServiceStatisticsInput, optFns ...func(*GetTimeSeriesServiceStatisticsPaginatorOptions)) *GetTimeSeriesServiceStatisticsPaginator { + options := GetTimeSeriesServiceStatisticsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetTimeSeriesServiceStatisticsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetTimeSeriesServiceStatisticsPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetTimeSeriesServiceStatistics page. +func (p *GetTimeSeriesServiceStatisticsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetTimeSeriesServiceStatisticsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.GetTimeSeriesServiceStatistics(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +} + +// GetSamplingRulesAPIClient is a client that implements the GetSamplingRules +// operation. +type GetSamplingRulesAPIClient interface { + GetSamplingRules(context.Context, *GetSamplingRulesInput, ...func(*Options)) (*GetSamplingRulesOutput, error) +} + +var _ GetSamplingRulesAPIClient = (*Client)(nil) + +// GetSamplingRulesPaginatorOptions is the paginator options for GetSamplingRules +type GetSamplingRulesPaginatorOptions struct { + // Set to true if pagination should stop if the service returns the same taken + // passed to it + StopOnDuplicateToken bool +} + +// GetSamplingRulesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/xray.GetSamplingRules +type GetSamplingRulesPaginator struct { + options GetSamplingRulesPaginatorOptions + client GetSamplingRulesAPIClient + params *GetSamplingRulesInput + nextToken *string + firstPage bool + done bool +} + +// NewGetSamplingRulesPaginator returns a new GetSamplingRulesPaginator +func NewGetSamplingRulesPaginator(client GetSamplingRulesAPIClient, params *GetSamplingRulesInput, optFns ...func(*GetSamplingRulesPaginatorOptions)) *GetSamplingRulesPaginator { + options := GetSamplingRulesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + return &GetSamplingRulesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetSamplingRulesPaginator) HasMorePages() bool { + if p.done { + return false + } + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) > 0) +} + +// NextPage retrieves the next GetSamplingRules page. +func (p *GetSamplingRulesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetSamplingRulesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.GetSamplingRules(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && params.NextToken != nil && p.nextToken != nil && *params.NextToken == *p.nextToken { + p.done = true + } else { + p.done = false + } + + return result, nil +}