diff --git a/config/go.mod b/config/go.mod index 199160872f3..ea624bedaaf 100644 --- a/config/go.mod +++ b/config/go.mod @@ -7,7 +7,7 @@ require ( github.com/aws/aws-sdk-go-v2/credentials v0.1.4 github.com/aws/aws-sdk-go-v2/ec2imds v0.1.4 github.com/aws/aws-sdk-go-v2/service/sts v0.29.0 - github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace ( diff --git a/config/go.sum b/config/go.sum index e91289bf27f..fbe56b0515e 100644 --- a/config/go.sum +++ b/config/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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.mod b/credentials/go.mod index 9adc21d23f8..bce503fe7ee 100644 --- a/credentials/go.mod +++ b/credentials/go.mod @@ -6,7 +6,7 @@ require ( github.com/aws/aws-sdk-go-v2 v0.29.0 github.com/aws/aws-sdk-go-v2/ec2imds v0.1.4 github.com/aws/aws-sdk-go-v2/service/sts v0.29.0 - github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace ( diff --git a/credentials/go.sum b/credentials/go.sum index 625759526c2..02be59d959e 100644 --- a/credentials/go.sum +++ b/credentials/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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/example/service/s3/listObjects/go.sum b/example/service/s3/listObjects/go.sum index 5912fa6728c..23bc36dd9f5 100644 --- a/example/service/s3/listObjects/go.sum +++ b/example/service/s3/listObjects/go.sum @@ -1,6 +1,8 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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.mod b/feature/s3/manager/go.mod index 37a74b4a810..04ed3cb1352 100644 --- a/feature/s3/manager/go.mod +++ b/feature/s3/manager/go.mod @@ -7,7 +7,7 @@ require ( github.com/aws/aws-sdk-go-v2/config v0.2.2 github.com/aws/aws-sdk-go-v2/service/internal/s3shared v0.3.1 // indirect github.com/aws/aws-sdk-go-v2/service/s3 v0.29.0 - github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 github.com/google/go-cmp v0.4.1 ) diff --git a/feature/s3/manager/go.sum b/feature/s3/manager/go.sum index d4252855102..5202c525231 100644 --- a/feature/s3/manager/go.sum +++ b/feature/s3/manager/go.sum @@ -1,6 +1,8 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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.mod b/internal/protocoltest/awsrestjson/go.mod index cc4406750eb..9c269174f41 100644 --- a/internal/protocoltest/awsrestjson/go.mod +++ b/internal/protocoltest/awsrestjson/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 github.com/google/go-cmp v0.4.1 ) diff --git a/internal/protocoltest/awsrestjson/go.sum b/internal/protocoltest/awsrestjson/go.sum index 32595049f96..4c337b66cbc 100644 --- a/internal/protocoltest/awsrestjson/go.sum +++ b/internal/protocoltest/awsrestjson/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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/go.mod b/internal/protocoltest/ec2query/go.mod index 1a72c94390b..f8e33802a8b 100644 --- a/internal/protocoltest/ec2query/go.mod +++ b/internal/protocoltest/ec2query/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 github.com/google/go-cmp v0.4.1 ) diff --git a/internal/protocoltest/ec2query/go.sum b/internal/protocoltest/ec2query/go.sum index 32595049f96..4c337b66cbc 100644 --- a/internal/protocoltest/ec2query/go.sum +++ b/internal/protocoltest/ec2query/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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/go.mod b/internal/protocoltest/jsonrpc/go.mod index dd597b8e7e8..5de477190fc 100644 --- a/internal/protocoltest/jsonrpc/go.mod +++ b/internal/protocoltest/jsonrpc/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 github.com/google/go-cmp v0.4.1 ) diff --git a/internal/protocoltest/jsonrpc/go.sum b/internal/protocoltest/jsonrpc/go.sum index 32595049f96..4c337b66cbc 100644 --- a/internal/protocoltest/jsonrpc/go.sum +++ b/internal/protocoltest/jsonrpc/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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/go.mod b/internal/protocoltest/jsonrpc10/go.mod index 519e9fbb9de..df380f50c19 100644 --- a/internal/protocoltest/jsonrpc10/go.mod +++ b/internal/protocoltest/jsonrpc10/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 github.com/google/go-cmp v0.4.1 ) diff --git a/internal/protocoltest/jsonrpc10/go.sum b/internal/protocoltest/jsonrpc10/go.sum index 32595049f96..4c337b66cbc 100644 --- a/internal/protocoltest/jsonrpc10/go.sum +++ b/internal/protocoltest/jsonrpc10/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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/go.mod b/internal/protocoltest/query/go.mod index 4720a971a7a..dd64ccbe175 100644 --- a/internal/protocoltest/query/go.mod +++ b/internal/protocoltest/query/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 github.com/google/go-cmp v0.4.1 ) diff --git a/internal/protocoltest/query/go.sum b/internal/protocoltest/query/go.sum index 32595049f96..4c337b66cbc 100644 --- a/internal/protocoltest/query/go.sum +++ b/internal/protocoltest/query/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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/go.mod b/internal/protocoltest/restxml/go.mod index babd7395587..00e0b7fc466 100644 --- a/internal/protocoltest/restxml/go.mod +++ b/internal/protocoltest/restxml/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 github.com/google/go-cmp v0.4.1 ) diff --git a/internal/protocoltest/restxml/go.sum b/internal/protocoltest/restxml/go.sum index 32595049f96..4c337b66cbc 100644 --- a/internal/protocoltest/restxml/go.sum +++ b/internal/protocoltest/restxml/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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/api_op_ListAnalyzedResources.go b/service/accessanalyzer/api_op_ListAnalyzedResources.go index ea116a50faf..22cb18c1364 100644 --- a/service/accessanalyzer/api_op_ListAnalyzedResources.go +++ b/service/accessanalyzer/api_op_ListAnalyzedResources.go @@ -4,6 +4,7 @@ package accessanalyzer import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/accessanalyzer/types" @@ -121,6 +122,82 @@ func addOperationListAnalyzedResourcesMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAnalyzedResourcesPaginator returns a new ListAnalyzedResourcesPaginator +func NewListAnalyzedResourcesPaginator(client ListAnalyzedResourcesAPIClient, params *ListAnalyzedResourcesInput, optFns ...func(*ListAnalyzedResourcesPaginatorOptions)) *ListAnalyzedResourcesPaginator { + options := ListAnalyzedResourcesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAnalyzedResourcesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAnalyzedResources(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/accessanalyzer/api_op_ListAnalyzers.go b/service/accessanalyzer/api_op_ListAnalyzers.go index 56ef9875571..7a4a78e4244 100644 --- a/service/accessanalyzer/api_op_ListAnalyzers.go +++ b/service/accessanalyzer/api_op_ListAnalyzers.go @@ -4,6 +4,7 @@ package accessanalyzer import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/accessanalyzer/types" @@ -108,3 +109,77 @@ func addOperationListAnalyzersMiddlewares(stack *middleware.Stack, options Optio } return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAnalyzersPaginator returns a new ListAnalyzersPaginator +func NewListAnalyzersPaginator(client ListAnalyzersAPIClient, params *ListAnalyzersInput, optFns ...func(*ListAnalyzersPaginatorOptions)) *ListAnalyzersPaginator { + options := ListAnalyzersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAnalyzersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} diff --git a/service/accessanalyzer/api_op_ListArchiveRules.go b/service/accessanalyzer/api_op_ListArchiveRules.go index b8e1fd3ae70..c0558d2223d 100644 --- a/service/accessanalyzer/api_op_ListArchiveRules.go +++ b/service/accessanalyzer/api_op_ListArchiveRules.go @@ -4,6 +4,7 @@ package accessanalyzer import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/accessanalyzer/types" @@ -113,3 +114,78 @@ func addOperationListArchiveRulesMiddlewares(stack *middleware.Stack, options Op } return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListArchiveRulesPaginator returns a new ListArchiveRulesPaginator +func NewListArchiveRulesPaginator(client ListArchiveRulesAPIClient, params *ListArchiveRulesInput, optFns ...func(*ListArchiveRulesPaginatorOptions)) *ListArchiveRulesPaginator { + options := ListArchiveRulesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListArchiveRulesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} diff --git a/service/accessanalyzer/api_op_ListFindings.go b/service/accessanalyzer/api_op_ListFindings.go index 2e4015495ec..eaefea66375 100644 --- a/service/accessanalyzer/api_op_ListFindings.go +++ b/service/accessanalyzer/api_op_ListFindings.go @@ -4,6 +4,7 @@ package accessanalyzer import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/accessanalyzer/types" @@ -124,6 +125,80 @@ func addOperationListFindingsMiddlewares(stack *middleware.Stack, options Option return 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 results to return in the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListFindingsPaginator returns a new ListFindingsPaginator +func NewListFindingsPaginator(client ListFindingsAPIClient, params *ListFindingsInput, optFns ...func(*ListFindingsPaginatorOptions)) *ListFindingsPaginator { + options := ListFindingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListFindingsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListFindings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/accessanalyzer/go.mod b/service/accessanalyzer/go.mod index 58d55986fc5..5173e3628c8 100644 --- a/service/accessanalyzer/go.mod +++ b/service/accessanalyzer/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/accessanalyzer/go.sum b/service/accessanalyzer/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/accessanalyzer/go.sum +++ b/service/accessanalyzer/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 516f0f1f198..00000000000 --- a/service/accessanalyzer/paginators.go +++ /dev/null @@ -1,307 +0,0 @@ -// 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/api_op_ListCertificates.go b/service/acm/api_op_ListCertificates.go index 5aa315aff9a..564a9aadd16 100644 --- a/service/acm/api_op_ListCertificates.go +++ b/service/acm/api_op_ListCertificates.go @@ -4,6 +4,7 @@ package acm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/acm/types" @@ -120,6 +121,84 @@ func addOperationListCertificatesMiddlewares(stack *middleware.Stack, options Op return 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 { + // 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListCertificatesPaginator returns a new ListCertificatesPaginator +func NewListCertificatesPaginator(client ListCertificatesAPIClient, params *ListCertificatesInput, optFns ...func(*ListCertificatesPaginatorOptions)) *ListCertificatesPaginator { + options := ListCertificatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListCertificatesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListCertificates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/acm/go.mod b/service/acm/go.mod index 66d0b4040df..fbca33301cc 100644 --- a/service/acm/go.mod +++ b/service/acm/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/acm/go.sum b/service/acm/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/acm/go.sum +++ b/service/acm/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 9c59a351a4f..00000000000 --- a/service/acm/paginators.go +++ /dev/null @@ -1,86 +0,0 @@ -// 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/api_op_ListCertificateAuthorities.go b/service/acmpca/api_op_ListCertificateAuthorities.go index af64f13bf08..0ef3825f671 100644 --- a/service/acmpca/api_op_ListCertificateAuthorities.go +++ b/service/acmpca/api_op_ListCertificateAuthorities.go @@ -4,6 +4,7 @@ package acmpca import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/acmpca/types" @@ -118,6 +119,86 @@ func addOperationListCertificateAuthoritiesMiddlewares(stack *middleware.Stack, return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListCertificateAuthoritiesPaginator returns a new +// ListCertificateAuthoritiesPaginator +func NewListCertificateAuthoritiesPaginator(client ListCertificateAuthoritiesAPIClient, params *ListCertificateAuthoritiesInput, optFns ...func(*ListCertificateAuthoritiesPaginatorOptions)) *ListCertificateAuthoritiesPaginator { + options := ListCertificateAuthoritiesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListCertificateAuthoritiesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListCertificateAuthorities(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/acmpca/api_op_ListPermissions.go b/service/acmpca/api_op_ListPermissions.go index 9e6fbae4418..60e48399a28 100644 --- a/service/acmpca/api_op_ListPermissions.go +++ b/service/acmpca/api_op_ListPermissions.go @@ -4,6 +4,7 @@ package acmpca import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/acmpca/types" @@ -148,6 +149,84 @@ func addOperationListPermissionsMiddlewares(stack *middleware.Stack, options Opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListPermissionsPaginator returns a new ListPermissionsPaginator +func NewListPermissionsPaginator(client ListPermissionsAPIClient, params *ListPermissionsInput, optFns ...func(*ListPermissionsPaginatorOptions)) *ListPermissionsPaginator { + options := ListPermissionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPermissionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPermissions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/acmpca/api_op_ListTags.go b/service/acmpca/api_op_ListTags.go index 9e04ca97d33..b41ff27a6aa 100644 --- a/service/acmpca/api_op_ListTags.go +++ b/service/acmpca/api_op_ListTags.go @@ -4,6 +4,7 @@ package acmpca import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/acmpca/types" @@ -130,6 +131,83 @@ func addOperationListTagsMiddlewares(stack *middleware.Stack, options Options) ( return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTagsPaginator returns a new ListTagsPaginator +func NewListTagsPaginator(client ListTagsAPIClient, params *ListTagsInput, optFns ...func(*ListTagsPaginatorOptions)) *ListTagsPaginator { + options := ListTagsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTagsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTags(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/acmpca/go.mod b/service/acmpca/go.mod index 82f7746fbe5..c4178ab3a17 100644 --- a/service/acmpca/go.mod +++ b/service/acmpca/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/acmpca/go.sum b/service/acmpca/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/acmpca/go.sum +++ b/service/acmpca/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index f7ad71d37d0..00000000000 --- a/service/acmpca/paginators.go +++ /dev/null @@ -1,243 +0,0 @@ -// 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/api_op_ListBusinessReportSchedules.go b/service/alexaforbusiness/api_op_ListBusinessReportSchedules.go index 23db45c505c..02aec9507f9 100644 --- a/service/alexaforbusiness/api_op_ListBusinessReportSchedules.go +++ b/service/alexaforbusiness/api_op_ListBusinessReportSchedules.go @@ -4,6 +4,7 @@ package alexaforbusiness import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/alexaforbusiness/types" @@ -107,6 +108,83 @@ func addOperationListBusinessReportSchedulesMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListBusinessReportSchedulesPaginator returns a new +// ListBusinessReportSchedulesPaginator +func NewListBusinessReportSchedulesPaginator(client ListBusinessReportSchedulesAPIClient, params *ListBusinessReportSchedulesInput, optFns ...func(*ListBusinessReportSchedulesPaginatorOptions)) *ListBusinessReportSchedulesPaginator { + options := ListBusinessReportSchedulesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListBusinessReportSchedulesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListBusinessReportSchedules(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/alexaforbusiness/api_op_ListConferenceProviders.go b/service/alexaforbusiness/api_op_ListConferenceProviders.go index cc64e5482f3..026d75b03f7 100644 --- a/service/alexaforbusiness/api_op_ListConferenceProviders.go +++ b/service/alexaforbusiness/api_op_ListConferenceProviders.go @@ -4,6 +4,7 @@ package alexaforbusiness import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/alexaforbusiness/types" @@ -105,6 +106,83 @@ func addOperationListConferenceProvidersMiddlewares(stack *middleware.Stack, opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListConferenceProvidersPaginator returns a new +// ListConferenceProvidersPaginator +func NewListConferenceProvidersPaginator(client ListConferenceProvidersAPIClient, params *ListConferenceProvidersInput, optFns ...func(*ListConferenceProvidersPaginatorOptions)) *ListConferenceProvidersPaginator { + options := ListConferenceProvidersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListConferenceProvidersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListConferenceProviders(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/alexaforbusiness/api_op_ListDeviceEvents.go b/service/alexaforbusiness/api_op_ListDeviceEvents.go index d5ac4d02f40..0b699d10014 100644 --- a/service/alexaforbusiness/api_op_ListDeviceEvents.go +++ b/service/alexaforbusiness/api_op_ListDeviceEvents.go @@ -4,6 +4,7 @@ package alexaforbusiness import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/alexaforbusiness/types" @@ -125,6 +126,83 @@ func addOperationListDeviceEventsMiddlewares(stack *middleware.Stack, options Op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDeviceEventsPaginator returns a new ListDeviceEventsPaginator +func NewListDeviceEventsPaginator(client ListDeviceEventsAPIClient, params *ListDeviceEventsInput, optFns ...func(*ListDeviceEventsPaginatorOptions)) *ListDeviceEventsPaginator { + options := ListDeviceEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDeviceEventsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDeviceEvents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/alexaforbusiness/api_op_ListGatewayGroups.go b/service/alexaforbusiness/api_op_ListGatewayGroups.go index 86ff833fa28..52b98ec211b 100644 --- a/service/alexaforbusiness/api_op_ListGatewayGroups.go +++ b/service/alexaforbusiness/api_op_ListGatewayGroups.go @@ -4,6 +4,7 @@ package alexaforbusiness import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/alexaforbusiness/types" @@ -106,6 +107,81 @@ func addOperationListGatewayGroupsMiddlewares(stack *middleware.Stack, options O return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListGatewayGroupsPaginator returns a new ListGatewayGroupsPaginator +func NewListGatewayGroupsPaginator(client ListGatewayGroupsAPIClient, params *ListGatewayGroupsInput, optFns ...func(*ListGatewayGroupsPaginatorOptions)) *ListGatewayGroupsPaginator { + options := ListGatewayGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListGatewayGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListGatewayGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/alexaforbusiness/api_op_ListGateways.go b/service/alexaforbusiness/api_op_ListGateways.go index 9b5f66cefb0..6cd1a797461 100644 --- a/service/alexaforbusiness/api_op_ListGateways.go +++ b/service/alexaforbusiness/api_op_ListGateways.go @@ -4,6 +4,7 @@ package alexaforbusiness import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/alexaforbusiness/types" @@ -110,6 +111,80 @@ func addOperationListGatewaysMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListGatewaysPaginator returns a new ListGatewaysPaginator +func NewListGatewaysPaginator(client ListGatewaysAPIClient, params *ListGatewaysInput, optFns ...func(*ListGatewaysPaginatorOptions)) *ListGatewaysPaginator { + options := ListGatewaysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListGatewaysInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListGateways(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/alexaforbusiness/api_op_ListSkills.go b/service/alexaforbusiness/api_op_ListSkills.go index d8c76d33300..82647acd2f2 100644 --- a/service/alexaforbusiness/api_op_ListSkills.go +++ b/service/alexaforbusiness/api_op_ListSkills.go @@ -4,6 +4,7 @@ package alexaforbusiness import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/alexaforbusiness/types" @@ -118,6 +119,82 @@ func addOperationListSkillsMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListSkillsPaginator returns a new ListSkillsPaginator +func NewListSkillsPaginator(client ListSkillsAPIClient, params *ListSkillsInput, optFns ...func(*ListSkillsPaginatorOptions)) *ListSkillsPaginator { + options := ListSkillsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSkillsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSkills(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/alexaforbusiness/api_op_ListSkillsStoreCategories.go b/service/alexaforbusiness/api_op_ListSkillsStoreCategories.go index 16b3d235cb9..fe7ecb1dd30 100644 --- a/service/alexaforbusiness/api_op_ListSkillsStoreCategories.go +++ b/service/alexaforbusiness/api_op_ListSkillsStoreCategories.go @@ -4,6 +4,7 @@ package alexaforbusiness import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/alexaforbusiness/types" @@ -105,6 +106,83 @@ func addOperationListSkillsStoreCategoriesMiddlewares(stack *middleware.Stack, o return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListSkillsStoreCategoriesPaginator returns a new +// ListSkillsStoreCategoriesPaginator +func NewListSkillsStoreCategoriesPaginator(client ListSkillsStoreCategoriesAPIClient, params *ListSkillsStoreCategoriesInput, optFns ...func(*ListSkillsStoreCategoriesPaginatorOptions)) *ListSkillsStoreCategoriesPaginator { + options := ListSkillsStoreCategoriesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSkillsStoreCategoriesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSkillsStoreCategories(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/alexaforbusiness/api_op_ListSkillsStoreSkillsByCategory.go b/service/alexaforbusiness/api_op_ListSkillsStoreSkillsByCategory.go index a17f7e794cb..0396492f6b0 100644 --- a/service/alexaforbusiness/api_op_ListSkillsStoreSkillsByCategory.go +++ b/service/alexaforbusiness/api_op_ListSkillsStoreSkillsByCategory.go @@ -4,6 +4,7 @@ package alexaforbusiness import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/alexaforbusiness/types" @@ -113,6 +114,83 @@ func addOperationListSkillsStoreSkillsByCategoryMiddlewares(stack *middleware.St return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListSkillsStoreSkillsByCategoryPaginator returns a new +// ListSkillsStoreSkillsByCategoryPaginator +func NewListSkillsStoreSkillsByCategoryPaginator(client ListSkillsStoreSkillsByCategoryAPIClient, params *ListSkillsStoreSkillsByCategoryInput, optFns ...func(*ListSkillsStoreSkillsByCategoryPaginatorOptions)) *ListSkillsStoreSkillsByCategoryPaginator { + options := ListSkillsStoreSkillsByCategoryPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSkillsStoreSkillsByCategoryInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSkillsStoreSkillsByCategory(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/alexaforbusiness/api_op_ListSmartHomeAppliances.go b/service/alexaforbusiness/api_op_ListSmartHomeAppliances.go index b671e068bda..a9761328c85 100644 --- a/service/alexaforbusiness/api_op_ListSmartHomeAppliances.go +++ b/service/alexaforbusiness/api_op_ListSmartHomeAppliances.go @@ -4,6 +4,7 @@ package alexaforbusiness import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/alexaforbusiness/types" @@ -113,6 +114,83 @@ func addOperationListSmartHomeAppliancesMiddlewares(stack *middleware.Stack, opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListSmartHomeAppliancesPaginator returns a new +// ListSmartHomeAppliancesPaginator +func NewListSmartHomeAppliancesPaginator(client ListSmartHomeAppliancesAPIClient, params *ListSmartHomeAppliancesInput, optFns ...func(*ListSmartHomeAppliancesPaginatorOptions)) *ListSmartHomeAppliancesPaginator { + options := ListSmartHomeAppliancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSmartHomeAppliancesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSmartHomeAppliances(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/alexaforbusiness/api_op_ListTags.go b/service/alexaforbusiness/api_op_ListTags.go index f97a56483b7..b215d2b95ec 100644 --- a/service/alexaforbusiness/api_op_ListTags.go +++ b/service/alexaforbusiness/api_op_ListTags.go @@ -4,6 +4,7 @@ package alexaforbusiness import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/alexaforbusiness/types" @@ -117,6 +118,82 @@ func addOperationListTagsMiddlewares(stack *middleware.Stack, options Options) ( return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTagsPaginator returns a new ListTagsPaginator +func NewListTagsPaginator(client ListTagsAPIClient, params *ListTagsInput, optFns ...func(*ListTagsPaginatorOptions)) *ListTagsPaginator { + options := ListTagsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTagsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTags(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/alexaforbusiness/api_op_SearchAddressBooks.go b/service/alexaforbusiness/api_op_SearchAddressBooks.go index fb129471201..9f73a4f3c7a 100644 --- a/service/alexaforbusiness/api_op_SearchAddressBooks.go +++ b/service/alexaforbusiness/api_op_SearchAddressBooks.go @@ -4,6 +4,7 @@ package alexaforbusiness import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/alexaforbusiness/types" @@ -124,6 +125,84 @@ func addOperationSearchAddressBooksMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewSearchAddressBooksPaginator returns a new SearchAddressBooksPaginator +func NewSearchAddressBooksPaginator(client SearchAddressBooksAPIClient, params *SearchAddressBooksInput, optFns ...func(*SearchAddressBooksPaginatorOptions)) *SearchAddressBooksPaginator { + options := SearchAddressBooksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchAddressBooksInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearchAddressBooks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/alexaforbusiness/api_op_SearchContacts.go b/service/alexaforbusiness/api_op_SearchContacts.go index 3a65242d8e1..091ed236091 100644 --- a/service/alexaforbusiness/api_op_SearchContacts.go +++ b/service/alexaforbusiness/api_op_SearchContacts.go @@ -4,6 +4,7 @@ package alexaforbusiness import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/alexaforbusiness/types" @@ -124,6 +125,83 @@ func addOperationSearchContactsMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewSearchContactsPaginator returns a new SearchContactsPaginator +func NewSearchContactsPaginator(client SearchContactsAPIClient, params *SearchContactsInput, optFns ...func(*SearchContactsPaginatorOptions)) *SearchContactsPaginator { + options := SearchContactsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchContactsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearchContacts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/alexaforbusiness/api_op_SearchDevices.go b/service/alexaforbusiness/api_op_SearchDevices.go index 3f2d5c22da0..8c0e2b5ea25 100644 --- a/service/alexaforbusiness/api_op_SearchDevices.go +++ b/service/alexaforbusiness/api_op_SearchDevices.go @@ -4,6 +4,7 @@ package alexaforbusiness import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/alexaforbusiness/types" @@ -127,6 +128,82 @@ func addOperationSearchDevicesMiddlewares(stack *middleware.Stack, options Optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewSearchDevicesPaginator returns a new SearchDevicesPaginator +func NewSearchDevicesPaginator(client SearchDevicesAPIClient, params *SearchDevicesInput, optFns ...func(*SearchDevicesPaginatorOptions)) *SearchDevicesPaginator { + options := SearchDevicesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchDevicesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearchDevices(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/alexaforbusiness/api_op_SearchNetworkProfiles.go b/service/alexaforbusiness/api_op_SearchNetworkProfiles.go index 35226f2962d..de747462b9a 100644 --- a/service/alexaforbusiness/api_op_SearchNetworkProfiles.go +++ b/service/alexaforbusiness/api_op_SearchNetworkProfiles.go @@ -4,6 +4,7 @@ package alexaforbusiness import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/alexaforbusiness/types" @@ -127,6 +128,84 @@ func addOperationSearchNetworkProfilesMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewSearchNetworkProfilesPaginator returns a new SearchNetworkProfilesPaginator +func NewSearchNetworkProfilesPaginator(client SearchNetworkProfilesAPIClient, params *SearchNetworkProfilesInput, optFns ...func(*SearchNetworkProfilesPaginatorOptions)) *SearchNetworkProfilesPaginator { + options := SearchNetworkProfilesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchNetworkProfilesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearchNetworkProfiles(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/alexaforbusiness/api_op_SearchProfiles.go b/service/alexaforbusiness/api_op_SearchProfiles.go index 325828195ab..11623a03bfd 100644 --- a/service/alexaforbusiness/api_op_SearchProfiles.go +++ b/service/alexaforbusiness/api_op_SearchProfiles.go @@ -4,6 +4,7 @@ package alexaforbusiness import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/alexaforbusiness/types" @@ -123,6 +124,83 @@ func addOperationSearchProfilesMiddlewares(stack *middleware.Stack, options Opti return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewSearchProfilesPaginator returns a new SearchProfilesPaginator +func NewSearchProfilesPaginator(client SearchProfilesAPIClient, params *SearchProfilesInput, optFns ...func(*SearchProfilesPaginatorOptions)) *SearchProfilesPaginator { + options := SearchProfilesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchProfilesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearchProfiles(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/alexaforbusiness/api_op_SearchRooms.go b/service/alexaforbusiness/api_op_SearchRooms.go index fc68c1a641d..d99a37d1cd4 100644 --- a/service/alexaforbusiness/api_op_SearchRooms.go +++ b/service/alexaforbusiness/api_op_SearchRooms.go @@ -4,6 +4,7 @@ package alexaforbusiness import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/alexaforbusiness/types" @@ -123,6 +124,82 @@ func addOperationSearchRoomsMiddlewares(stack *middleware.Stack, options Options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewSearchRoomsPaginator returns a new SearchRoomsPaginator +func NewSearchRoomsPaginator(client SearchRoomsAPIClient, params *SearchRoomsInput, optFns ...func(*SearchRoomsPaginatorOptions)) *SearchRoomsPaginator { + options := SearchRoomsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchRoomsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearchRooms(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/alexaforbusiness/api_op_SearchSkillGroups.go b/service/alexaforbusiness/api_op_SearchSkillGroups.go index 97e6a538dd9..77d38e9ee6d 100644 --- a/service/alexaforbusiness/api_op_SearchSkillGroups.go +++ b/service/alexaforbusiness/api_op_SearchSkillGroups.go @@ -4,6 +4,7 @@ package alexaforbusiness import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/alexaforbusiness/types" @@ -125,6 +126,83 @@ func addOperationSearchSkillGroupsMiddlewares(stack *middleware.Stack, options O return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewSearchSkillGroupsPaginator returns a new SearchSkillGroupsPaginator +func NewSearchSkillGroupsPaginator(client SearchSkillGroupsAPIClient, params *SearchSkillGroupsInput, optFns ...func(*SearchSkillGroupsPaginatorOptions)) *SearchSkillGroupsPaginator { + options := SearchSkillGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchSkillGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearchSkillGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/alexaforbusiness/api_op_SearchUsers.go b/service/alexaforbusiness/api_op_SearchUsers.go index b63eb6d4139..caa3d6b8008 100644 --- a/service/alexaforbusiness/api_op_SearchUsers.go +++ b/service/alexaforbusiness/api_op_SearchUsers.go @@ -4,6 +4,7 @@ package alexaforbusiness import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/alexaforbusiness/types" @@ -124,6 +125,82 @@ func addOperationSearchUsersMiddlewares(stack *middleware.Stack, options Options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewSearchUsersPaginator returns a new SearchUsersPaginator +func NewSearchUsersPaginator(client SearchUsersAPIClient, params *SearchUsersInput, optFns ...func(*SearchUsersPaginatorOptions)) *SearchUsersPaginator { + options := SearchUsersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchUsersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearchUsers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/alexaforbusiness/go.mod b/service/alexaforbusiness/go.mod index 57de8fb78b3..8b9ef5a2fdd 100644 --- a/service/alexaforbusiness/go.mod +++ b/service/alexaforbusiness/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/alexaforbusiness/go.sum b/service/alexaforbusiness/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/alexaforbusiness/go.sum +++ b/service/alexaforbusiness/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 07dc553d222..00000000000 --- a/service/alexaforbusiness/paginators.go +++ /dev/null @@ -1,1386 +0,0 @@ -// 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.mod b/service/amplify/go.mod index 2dc97aacbfd..380ea545916 100644 --- a/service/amplify/go.mod +++ b/service/amplify/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/amplify/go.sum b/service/amplify/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/amplify/go.sum +++ b/service/amplify/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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/api_op_GetApiKeys.go b/service/apigateway/api_op_GetApiKeys.go index 2e72b5df267..345ec7eaf37 100644 --- a/service/apigateway/api_op_GetApiKeys.go +++ b/service/apigateway/api_op_GetApiKeys.go @@ -4,6 +4,7 @@ package apigateway import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/apigateway/types" @@ -128,6 +129,81 @@ func addOperationGetApiKeysMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetApiKeysPaginator returns a new GetApiKeysPaginator +func NewGetApiKeysPaginator(client GetApiKeysAPIClient, params *GetApiKeysInput, optFns ...func(*GetApiKeysPaginatorOptions)) *GetApiKeysPaginator { + options := GetApiKeysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetApiKeysInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Position + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetApiKeys(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/apigateway/api_op_GetBasePathMappings.go b/service/apigateway/api_op_GetBasePathMappings.go index ef0db2e91b9..9e3048880cf 100644 --- a/service/apigateway/api_op_GetBasePathMappings.go +++ b/service/apigateway/api_op_GetBasePathMappings.go @@ -4,6 +4,7 @@ package apigateway import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/apigateway/types" @@ -120,6 +121,83 @@ func addOperationGetBasePathMappingsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetBasePathMappingsPaginator returns a new GetBasePathMappingsPaginator +func NewGetBasePathMappingsPaginator(client GetBasePathMappingsAPIClient, params *GetBasePathMappingsInput, optFns ...func(*GetBasePathMappingsPaginatorOptions)) *GetBasePathMappingsPaginator { + options := GetBasePathMappingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetBasePathMappingsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Position + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetBasePathMappings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/apigateway/api_op_GetClientCertificates.go b/service/apigateway/api_op_GetClientCertificates.go index 65303a74980..033dd1f61ab 100644 --- a/service/apigateway/api_op_GetClientCertificates.go +++ b/service/apigateway/api_op_GetClientCertificates.go @@ -4,6 +4,7 @@ package apigateway import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/apigateway/types" @@ -113,6 +114,83 @@ func addOperationGetClientCertificatesMiddlewares(stack *middleware.Stack, optio return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetClientCertificatesPaginator returns a new GetClientCertificatesPaginator +func NewGetClientCertificatesPaginator(client GetClientCertificatesAPIClient, params *GetClientCertificatesInput, optFns ...func(*GetClientCertificatesPaginatorOptions)) *GetClientCertificatesPaginator { + options := GetClientCertificatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetClientCertificatesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Position + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetClientCertificates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/apigateway/api_op_GetDeployments.go b/service/apigateway/api_op_GetDeployments.go index 358acb2932a..f6a1c41a9fc 100644 --- a/service/apigateway/api_op_GetDeployments.go +++ b/service/apigateway/api_op_GetDeployments.go @@ -4,6 +4,7 @@ package apigateway import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/apigateway/types" @@ -129,6 +130,82 @@ func addOperationGetDeploymentsMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetDeploymentsPaginator returns a new GetDeploymentsPaginator +func NewGetDeploymentsPaginator(client GetDeploymentsAPIClient, params *GetDeploymentsInput, optFns ...func(*GetDeploymentsPaginatorOptions)) *GetDeploymentsPaginator { + options := GetDeploymentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetDeploymentsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Position + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetDeployments(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/apigateway/api_op_GetDomainNames.go b/service/apigateway/api_op_GetDomainNames.go index 03f1089fc93..9a75566e925 100644 --- a/service/apigateway/api_op_GetDomainNames.go +++ b/service/apigateway/api_op_GetDomainNames.go @@ -4,6 +4,7 @@ package apigateway import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/apigateway/types" @@ -112,6 +113,82 @@ func addOperationGetDomainNamesMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetDomainNamesPaginator returns a new GetDomainNamesPaginator +func NewGetDomainNamesPaginator(client GetDomainNamesAPIClient, params *GetDomainNamesInput, optFns ...func(*GetDomainNamesPaginatorOptions)) *GetDomainNamesPaginator { + options := GetDomainNamesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetDomainNamesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Position + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetDomainNames(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/apigateway/api_op_GetModels.go b/service/apigateway/api_op_GetModels.go index 270560d0f48..311a0c57085 100644 --- a/service/apigateway/api_op_GetModels.go +++ b/service/apigateway/api_op_GetModels.go @@ -4,6 +4,7 @@ package apigateway import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/apigateway/types" @@ -121,6 +122,81 @@ func addOperationGetModelsMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetModelsPaginator returns a new GetModelsPaginator +func NewGetModelsPaginator(client GetModelsAPIClient, params *GetModelsInput, optFns ...func(*GetModelsPaginatorOptions)) *GetModelsPaginator { + options := GetModelsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetModelsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Position + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetModels(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/apigateway/api_op_GetResources.go b/service/apigateway/api_op_GetResources.go index a857d5f84bc..b74f9920497 100644 --- a/service/apigateway/api_op_GetResources.go +++ b/service/apigateway/api_op_GetResources.go @@ -4,6 +4,7 @@ package apigateway import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/apigateway/types" @@ -128,6 +129,81 @@ func addOperationGetResourcesMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetResourcesPaginator returns a new GetResourcesPaginator +func NewGetResourcesPaginator(client GetResourcesAPIClient, params *GetResourcesInput, optFns ...func(*GetResourcesPaginatorOptions)) *GetResourcesPaginator { + options := GetResourcesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetResourcesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Position + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetResources(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/apigateway/api_op_GetRestApis.go b/service/apigateway/api_op_GetRestApis.go index a34999ad27b..7a8bda4e62b 100644 --- a/service/apigateway/api_op_GetRestApis.go +++ b/service/apigateway/api_op_GetRestApis.go @@ -4,6 +4,7 @@ package apigateway import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/apigateway/types" @@ -114,6 +115,81 @@ func addOperationGetRestApisMiddlewares(stack *middleware.Stack, options Options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetRestApisPaginator returns a new GetRestApisPaginator +func NewGetRestApisPaginator(client GetRestApisAPIClient, params *GetRestApisInput, optFns ...func(*GetRestApisPaginatorOptions)) *GetRestApisPaginator { + options := GetRestApisPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetRestApisInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Position + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetRestApis(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/apigateway/api_op_GetUsage.go b/service/apigateway/api_op_GetUsage.go index dd78bc750f1..9378c006ab5 100644 --- a/service/apigateway/api_op_GetUsage.go +++ b/service/apigateway/api_op_GetUsage.go @@ -4,6 +4,7 @@ package apigateway import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -148,6 +149,81 @@ func addOperationGetUsageMiddlewares(stack *middleware.Stack, options Options) ( return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetUsagePaginator returns a new GetUsagePaginator +func NewGetUsagePaginator(client GetUsageAPIClient, params *GetUsageInput, optFns ...func(*GetUsagePaginatorOptions)) *GetUsagePaginator { + options := GetUsagePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetUsageInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Position + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetUsage(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/apigateway/api_op_GetUsagePlanKeys.go b/service/apigateway/api_op_GetUsagePlanKeys.go index 678164be1e9..7a2d8f424f7 100644 --- a/service/apigateway/api_op_GetUsagePlanKeys.go +++ b/service/apigateway/api_op_GetUsagePlanKeys.go @@ -4,6 +4,7 @@ package apigateway import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/apigateway/types" @@ -129,6 +130,82 @@ func addOperationGetUsagePlanKeysMiddlewares(stack *middleware.Stack, options Op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetUsagePlanKeysPaginator returns a new GetUsagePlanKeysPaginator +func NewGetUsagePlanKeysPaginator(client GetUsagePlanKeysAPIClient, params *GetUsagePlanKeysInput, optFns ...func(*GetUsagePlanKeysPaginatorOptions)) *GetUsagePlanKeysPaginator { + options := GetUsagePlanKeysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetUsagePlanKeysInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Position + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetUsagePlanKeys(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/apigateway/api_op_GetUsagePlans.go b/service/apigateway/api_op_GetUsagePlans.go index 48bfa2a6461..8e59da3d024 100644 --- a/service/apigateway/api_op_GetUsagePlans.go +++ b/service/apigateway/api_op_GetUsagePlans.go @@ -4,6 +4,7 @@ package apigateway import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/apigateway/types" @@ -116,6 +117,81 @@ func addOperationGetUsagePlansMiddlewares(stack *middleware.Stack, options Optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetUsagePlansPaginator returns a new GetUsagePlansPaginator +func NewGetUsagePlansPaginator(client GetUsagePlansAPIClient, params *GetUsagePlansInput, optFns ...func(*GetUsagePlansPaginatorOptions)) *GetUsagePlansPaginator { + options := GetUsagePlansPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetUsagePlansInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Position + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetUsagePlans(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/apigateway/api_op_GetVpcLinks.go b/service/apigateway/api_op_GetVpcLinks.go index 90858a7ef27..e6909877f3d 100644 --- a/service/apigateway/api_op_GetVpcLinks.go +++ b/service/apigateway/api_op_GetVpcLinks.go @@ -4,6 +4,7 @@ package apigateway import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/apigateway/types" @@ -115,6 +116,81 @@ func addOperationGetVpcLinksMiddlewares(stack *middleware.Stack, options Options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetVpcLinksPaginator returns a new GetVpcLinksPaginator +func NewGetVpcLinksPaginator(client GetVpcLinksAPIClient, params *GetVpcLinksInput, optFns ...func(*GetVpcLinksPaginatorOptions)) *GetVpcLinksPaginator { + options := GetVpcLinksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetVpcLinksInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Position + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetVpcLinks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/apigateway/go.mod b/service/apigateway/go.mod index 19c88c44463..412a7720555 100644 --- a/service/apigateway/go.mod +++ b/service/apigateway/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/apigateway/go.sum b/service/apigateway/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/apigateway/go.sum +++ b/service/apigateway/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 4a1b3336e13..00000000000 --- a/service/apigateway/paginators.go +++ /dev/null @@ -1,915 +0,0 @@ -// 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.mod b/service/apigatewaymanagementapi/go.mod index 4eef3eebf7d..c554636d3aa 100644 --- a/service/apigatewaymanagementapi/go.mod +++ b/service/apigatewaymanagementapi/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/apigatewaymanagementapi/go.sum b/service/apigatewaymanagementapi/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/apigatewaymanagementapi/go.sum +++ b/service/apigatewaymanagementapi/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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.mod b/service/apigatewayv2/go.mod index 39ccd2518e8..b6643e69cb8 100644 --- a/service/apigatewayv2/go.mod +++ b/service/apigatewayv2/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/apigatewayv2/go.sum b/service/apigatewayv2/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/apigatewayv2/go.sum +++ b/service/apigatewayv2/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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/api_op_ListApplications.go b/service/appconfig/api_op_ListApplications.go index 85965e8bb6e..a64d264cd5b 100644 --- a/service/appconfig/api_op_ListApplications.go +++ b/service/appconfig/api_op_ListApplications.go @@ -4,6 +4,7 @@ package appconfig import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/appconfig/types" @@ -107,6 +108,82 @@ func addOperationListApplicationsMiddlewares(stack *middleware.Stack, options Op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListApplicationsPaginator returns a new ListApplicationsPaginator +func NewListApplicationsPaginator(client ListApplicationsAPIClient, params *ListApplicationsInput, optFns ...func(*ListApplicationsPaginatorOptions)) *ListApplicationsPaginator { + options := ListApplicationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListApplicationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListApplications(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/appconfig/api_op_ListConfigurationProfiles.go b/service/appconfig/api_op_ListConfigurationProfiles.go index 53562a3fd4a..e16f9ddd677 100644 --- a/service/appconfig/api_op_ListConfigurationProfiles.go +++ b/service/appconfig/api_op_ListConfigurationProfiles.go @@ -4,6 +4,7 @@ package appconfig import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/appconfig/types" @@ -115,6 +116,84 @@ func addOperationListConfigurationProfilesMiddlewares(stack *middleware.Stack, o return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListConfigurationProfilesPaginator returns a new +// ListConfigurationProfilesPaginator +func NewListConfigurationProfilesPaginator(client ListConfigurationProfilesAPIClient, params *ListConfigurationProfilesInput, optFns ...func(*ListConfigurationProfilesPaginatorOptions)) *ListConfigurationProfilesPaginator { + options := ListConfigurationProfilesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListConfigurationProfilesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListConfigurationProfiles(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/appconfig/api_op_ListDeploymentStrategies.go b/service/appconfig/api_op_ListDeploymentStrategies.go index a69b9a2563a..6da4d3fec93 100644 --- a/service/appconfig/api_op_ListDeploymentStrategies.go +++ b/service/appconfig/api_op_ListDeploymentStrategies.go @@ -4,6 +4,7 @@ package appconfig import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/appconfig/types" @@ -107,6 +108,84 @@ func addOperationListDeploymentStrategiesMiddlewares(stack *middleware.Stack, op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDeploymentStrategiesPaginator returns a new +// ListDeploymentStrategiesPaginator +func NewListDeploymentStrategiesPaginator(client ListDeploymentStrategiesAPIClient, params *ListDeploymentStrategiesInput, optFns ...func(*ListDeploymentStrategiesPaginatorOptions)) *ListDeploymentStrategiesPaginator { + options := ListDeploymentStrategiesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDeploymentStrategiesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDeploymentStrategies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/appconfig/api_op_ListDeployments.go b/service/appconfig/api_op_ListDeployments.go index a6a5965c5e6..5a224fb4dd4 100644 --- a/service/appconfig/api_op_ListDeployments.go +++ b/service/appconfig/api_op_ListDeployments.go @@ -4,6 +4,7 @@ package appconfig import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/appconfig/types" @@ -120,6 +121,82 @@ func addOperationListDeploymentsMiddlewares(stack *middleware.Stack, options Opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDeploymentsPaginator returns a new ListDeploymentsPaginator +func NewListDeploymentsPaginator(client ListDeploymentsAPIClient, params *ListDeploymentsInput, optFns ...func(*ListDeploymentsPaginatorOptions)) *ListDeploymentsPaginator { + options := ListDeploymentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDeploymentsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDeployments(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/appconfig/api_op_ListEnvironments.go b/service/appconfig/api_op_ListEnvironments.go index df5d08530cf..b0ee727ca1e 100644 --- a/service/appconfig/api_op_ListEnvironments.go +++ b/service/appconfig/api_op_ListEnvironments.go @@ -4,6 +4,7 @@ package appconfig import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/appconfig/types" @@ -115,6 +116,82 @@ func addOperationListEnvironmentsMiddlewares(stack *middleware.Stack, options Op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListEnvironmentsPaginator returns a new ListEnvironmentsPaginator +func NewListEnvironmentsPaginator(client ListEnvironmentsAPIClient, params *ListEnvironmentsInput, optFns ...func(*ListEnvironmentsPaginatorOptions)) *ListEnvironmentsPaginator { + options := ListEnvironmentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListEnvironmentsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListEnvironments(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/appconfig/api_op_ListHostedConfigurationVersions.go b/service/appconfig/api_op_ListHostedConfigurationVersions.go index a07b615a5e7..b47ce291c17 100644 --- a/service/appconfig/api_op_ListHostedConfigurationVersions.go +++ b/service/appconfig/api_op_ListHostedConfigurationVersions.go @@ -4,6 +4,7 @@ package appconfig import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/appconfig/types" @@ -121,6 +122,84 @@ func addOperationListHostedConfigurationVersionsMiddlewares(stack *middleware.St return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListHostedConfigurationVersionsPaginator returns a new +// ListHostedConfigurationVersionsPaginator +func NewListHostedConfigurationVersionsPaginator(client ListHostedConfigurationVersionsAPIClient, params *ListHostedConfigurationVersionsInput, optFns ...func(*ListHostedConfigurationVersionsPaginatorOptions)) *ListHostedConfigurationVersionsPaginator { + options := ListHostedConfigurationVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListHostedConfigurationVersionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListHostedConfigurationVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/appconfig/go.mod b/service/appconfig/go.mod index 76467d862ca..74f503472b8 100644 --- a/service/appconfig/go.mod +++ b/service/appconfig/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/appconfig/go.sum b/service/appconfig/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/appconfig/go.sum +++ b/service/appconfig/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index b2b033a33ab..00000000000 --- a/service/appconfig/paginators.go +++ /dev/null @@ -1,470 +0,0 @@ -// 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/api_op_DescribeConnectorProfiles.go b/service/appflow/api_op_DescribeConnectorProfiles.go index 9e039fb5c6c..e2babdfd47e 100644 --- a/service/appflow/api_op_DescribeConnectorProfiles.go +++ b/service/appflow/api_op_DescribeConnectorProfiles.go @@ -4,6 +4,7 @@ package appflow import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/appflow/types" @@ -118,6 +119,84 @@ func addOperationDescribeConnectorProfilesMiddlewares(stack *middleware.Stack, o return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeConnectorProfilesPaginator returns a new +// DescribeConnectorProfilesPaginator +func NewDescribeConnectorProfilesPaginator(client DescribeConnectorProfilesAPIClient, params *DescribeConnectorProfilesInput, optFns ...func(*DescribeConnectorProfilesPaginatorOptions)) *DescribeConnectorProfilesPaginator { + options := DescribeConnectorProfilesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeConnectorProfilesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeConnectorProfiles(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/appflow/api_op_DescribeConnectors.go b/service/appflow/api_op_DescribeConnectors.go index fbe44775ee3..ea921880654 100644 --- a/service/appflow/api_op_DescribeConnectors.go +++ b/service/appflow/api_op_DescribeConnectors.go @@ -4,6 +4,7 @@ package appflow import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/appflow/types" @@ -109,6 +110,78 @@ func addOperationDescribeConnectorsMiddlewares(stack *middleware.Stack, options return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeConnectorsPaginator returns a new DescribeConnectorsPaginator +func NewDescribeConnectorsPaginator(client DescribeConnectorsAPIClient, params *DescribeConnectorsInput, optFns ...func(*DescribeConnectorsPaginatorOptions)) *DescribeConnectorsPaginator { + options := DescribeConnectorsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeConnectorsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeConnectors(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/appflow/api_op_DescribeFlowExecutionRecords.go b/service/appflow/api_op_DescribeFlowExecutionRecords.go index e77c52f68d1..3ba20720549 100644 --- a/service/appflow/api_op_DescribeFlowExecutionRecords.go +++ b/service/appflow/api_op_DescribeFlowExecutionRecords.go @@ -4,6 +4,7 @@ package appflow import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/appflow/types" @@ -115,6 +116,84 @@ func addOperationDescribeFlowExecutionRecordsMiddlewares(stack *middleware.Stack return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeFlowExecutionRecordsPaginator returns a new +// DescribeFlowExecutionRecordsPaginator +func NewDescribeFlowExecutionRecordsPaginator(client DescribeFlowExecutionRecordsAPIClient, params *DescribeFlowExecutionRecordsInput, optFns ...func(*DescribeFlowExecutionRecordsPaginatorOptions)) *DescribeFlowExecutionRecordsPaginator { + options := DescribeFlowExecutionRecordsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeFlowExecutionRecordsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeFlowExecutionRecords(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/appflow/api_op_ListFlows.go b/service/appflow/api_op_ListFlows.go index 08a898e2179..0f29bcf5dc2 100644 --- a/service/appflow/api_op_ListFlows.go +++ b/service/appflow/api_op_ListFlows.go @@ -4,6 +4,7 @@ package appflow import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/appflow/types" @@ -105,6 +106,80 @@ func addOperationListFlowsMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListFlowsPaginator returns a new ListFlowsPaginator +func NewListFlowsPaginator(client ListFlowsAPIClient, params *ListFlowsInput, optFns ...func(*ListFlowsPaginatorOptions)) *ListFlowsPaginator { + options := ListFlowsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListFlowsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListFlows(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/appflow/go.mod b/service/appflow/go.mod index 6f513c201d0..36a2e75ab5e 100644 --- a/service/appflow/go.mod +++ b/service/appflow/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/appflow/go.sum b/service/appflow/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/appflow/go.sum +++ b/service/appflow/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 41c084b894a..00000000000 --- a/service/appflow/paginators.go +++ /dev/null @@ -1,310 +0,0 @@ -// 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/api_op_DescribeScalableTargets.go b/service/applicationautoscaling/api_op_DescribeScalableTargets.go index 93ab1df7561..9034ef3d230 100644 --- a/service/applicationautoscaling/api_op_DescribeScalableTargets.go +++ b/service/applicationautoscaling/api_op_DescribeScalableTargets.go @@ -4,6 +4,7 @@ package applicationautoscaling import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/applicationautoscaling/types" @@ -254,6 +255,88 @@ func addOperationDescribeScalableTargetsMiddlewares(stack *middleware.Stack, opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeScalableTargetsPaginator returns a new +// DescribeScalableTargetsPaginator +func NewDescribeScalableTargetsPaginator(client DescribeScalableTargetsAPIClient, params *DescribeScalableTargetsInput, optFns ...func(*DescribeScalableTargetsPaginatorOptions)) *DescribeScalableTargetsPaginator { + options := DescribeScalableTargetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeScalableTargetsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeScalableTargets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/applicationautoscaling/api_op_DescribeScalingActivities.go b/service/applicationautoscaling/api_op_DescribeScalingActivities.go index 6f18c4f1d64..698620019c8 100644 --- a/service/applicationautoscaling/api_op_DescribeScalingActivities.go +++ b/service/applicationautoscaling/api_op_DescribeScalingActivities.go @@ -4,6 +4,7 @@ package applicationautoscaling import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/applicationautoscaling/types" @@ -255,6 +256,88 @@ func addOperationDescribeScalingActivitiesMiddlewares(stack *middleware.Stack, o return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeScalingActivitiesPaginator returns a new +// DescribeScalingActivitiesPaginator +func NewDescribeScalingActivitiesPaginator(client DescribeScalingActivitiesAPIClient, params *DescribeScalingActivitiesInput, optFns ...func(*DescribeScalingActivitiesPaginatorOptions)) *DescribeScalingActivitiesPaginator { + options := DescribeScalingActivitiesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeScalingActivitiesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeScalingActivities(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/applicationautoscaling/api_op_DescribeScalingPolicies.go b/service/applicationautoscaling/api_op_DescribeScalingPolicies.go index 023c128a6c0..78d3845ccc2 100644 --- a/service/applicationautoscaling/api_op_DescribeScalingPolicies.go +++ b/service/applicationautoscaling/api_op_DescribeScalingPolicies.go @@ -4,6 +4,7 @@ package applicationautoscaling import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/applicationautoscaling/types" @@ -263,6 +264,88 @@ func addOperationDescribeScalingPoliciesMiddlewares(stack *middleware.Stack, opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeScalingPoliciesPaginator returns a new +// DescribeScalingPoliciesPaginator +func NewDescribeScalingPoliciesPaginator(client DescribeScalingPoliciesAPIClient, params *DescribeScalingPoliciesInput, optFns ...func(*DescribeScalingPoliciesPaginatorOptions)) *DescribeScalingPoliciesPaginator { + options := DescribeScalingPoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeScalingPoliciesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeScalingPolicies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/applicationautoscaling/api_op_DescribeScheduledActions.go b/service/applicationautoscaling/api_op_DescribeScheduledActions.go index 2e15b9184f8..946cd9f2e43 100644 --- a/service/applicationautoscaling/api_op_DescribeScheduledActions.go +++ b/service/applicationautoscaling/api_op_DescribeScheduledActions.go @@ -4,6 +4,7 @@ package applicationautoscaling import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/applicationautoscaling/types" @@ -261,6 +262,88 @@ func addOperationDescribeScheduledActionsMiddlewares(stack *middleware.Stack, op return 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 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeScheduledActionsPaginator returns a new +// DescribeScheduledActionsPaginator +func NewDescribeScheduledActionsPaginator(client DescribeScheduledActionsAPIClient, params *DescribeScheduledActionsInput, optFns ...func(*DescribeScheduledActionsPaginatorOptions)) *DescribeScheduledActionsPaginator { + options := DescribeScheduledActionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeScheduledActionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeScheduledActions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/applicationautoscaling/go.mod b/service/applicationautoscaling/go.mod index 34367d272c9..5fc3b02e86c 100644 --- a/service/applicationautoscaling/go.mod +++ b/service/applicationautoscaling/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/applicationautoscaling/go.sum b/service/applicationautoscaling/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/applicationautoscaling/go.sum +++ b/service/applicationautoscaling/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 9b6d23fc2ac..00000000000 --- a/service/applicationautoscaling/paginators.go +++ /dev/null @@ -1,336 +0,0 @@ -// 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/api_op_DescribeContinuousExports.go b/service/applicationdiscoveryservice/api_op_DescribeContinuousExports.go index 4b8d10af76a..a11a38e5452 100644 --- a/service/applicationdiscoveryservice/api_op_DescribeContinuousExports.go +++ b/service/applicationdiscoveryservice/api_op_DescribeContinuousExports.go @@ -4,6 +4,7 @@ package applicationdiscoveryservice import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/applicationdiscoveryservice/types" @@ -111,6 +112,84 @@ func addOperationDescribeContinuousExportsMiddlewares(stack *middleware.Stack, o return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeContinuousExportsPaginator returns a new +// DescribeContinuousExportsPaginator +func NewDescribeContinuousExportsPaginator(client DescribeContinuousExportsAPIClient, params *DescribeContinuousExportsInput, optFns ...func(*DescribeContinuousExportsPaginatorOptions)) *DescribeContinuousExportsPaginator { + options := DescribeContinuousExportsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeContinuousExportsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeContinuousExports(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/applicationdiscoveryservice/api_op_DescribeImportTasks.go b/service/applicationdiscoveryservice/api_op_DescribeImportTasks.go index ec2534ae34d..8369204c17f 100644 --- a/service/applicationdiscoveryservice/api_op_DescribeImportTasks.go +++ b/service/applicationdiscoveryservice/api_op_DescribeImportTasks.go @@ -4,6 +4,7 @@ package applicationdiscoveryservice import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/applicationdiscoveryservice/types" @@ -112,6 +113,82 @@ func addOperationDescribeImportTasksMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeImportTasksPaginator returns a new DescribeImportTasksPaginator +func NewDescribeImportTasksPaginator(client DescribeImportTasksAPIClient, params *DescribeImportTasksInput, optFns ...func(*DescribeImportTasksPaginatorOptions)) *DescribeImportTasksPaginator { + options := DescribeImportTasksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeImportTasksInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeImportTasks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/applicationdiscoveryservice/go.mod b/service/applicationdiscoveryservice/go.mod index 05bcde70fc6..a213c9d543f 100644 --- a/service/applicationdiscoveryservice/go.mod +++ b/service/applicationdiscoveryservice/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/applicationdiscoveryservice/go.sum b/service/applicationdiscoveryservice/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/applicationdiscoveryservice/go.sum +++ b/service/applicationdiscoveryservice/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 5d07526d020..00000000000 --- a/service/applicationdiscoveryservice/paginators.go +++ /dev/null @@ -1,162 +0,0 @@ -// 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/api_op_ListApplications.go b/service/applicationinsights/api_op_ListApplications.go index cf2577e7971..b41ca611625 100644 --- a/service/applicationinsights/api_op_ListApplications.go +++ b/service/applicationinsights/api_op_ListApplications.go @@ -4,6 +4,7 @@ package applicationinsights import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/applicationinsights/types" @@ -107,6 +108,82 @@ func addOperationListApplicationsMiddlewares(stack *middleware.Stack, options Op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListApplicationsPaginator returns a new ListApplicationsPaginator +func NewListApplicationsPaginator(client ListApplicationsAPIClient, params *ListApplicationsInput, optFns ...func(*ListApplicationsPaginatorOptions)) *ListApplicationsPaginator { + options := ListApplicationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListApplicationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListApplications(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/applicationinsights/api_op_ListComponents.go b/service/applicationinsights/api_op_ListComponents.go index 6a8dc666980..af209438402 100644 --- a/service/applicationinsights/api_op_ListComponents.go +++ b/service/applicationinsights/api_op_ListComponents.go @@ -4,6 +4,7 @@ package applicationinsights import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/applicationinsights/types" @@ -114,6 +115,82 @@ func addOperationListComponentsMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListComponentsPaginator returns a new ListComponentsPaginator +func NewListComponentsPaginator(client ListComponentsAPIClient, params *ListComponentsInput, optFns ...func(*ListComponentsPaginatorOptions)) *ListComponentsPaginator { + options := ListComponentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListComponentsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListComponents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/applicationinsights/api_op_ListConfigurationHistory.go b/service/applicationinsights/api_op_ListConfigurationHistory.go index b72f7f711ed..809ebecc5b1 100644 --- a/service/applicationinsights/api_op_ListConfigurationHistory.go +++ b/service/applicationinsights/api_op_ListConfigurationHistory.go @@ -4,6 +4,7 @@ package applicationinsights import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/applicationinsights/types" @@ -141,6 +142,88 @@ func addOperationListConfigurationHistoryMiddlewares(stack *middleware.Stack, op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListConfigurationHistoryPaginator returns a new +// ListConfigurationHistoryPaginator +func NewListConfigurationHistoryPaginator(client ListConfigurationHistoryAPIClient, params *ListConfigurationHistoryInput, optFns ...func(*ListConfigurationHistoryPaginatorOptions)) *ListConfigurationHistoryPaginator { + options := ListConfigurationHistoryPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListConfigurationHistoryInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListConfigurationHistory(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/applicationinsights/api_op_ListLogPatternSets.go b/service/applicationinsights/api_op_ListLogPatternSets.go index ec4647c40f7..d5b29c90473 100644 --- a/service/applicationinsights/api_op_ListLogPatternSets.go +++ b/service/applicationinsights/api_op_ListLogPatternSets.go @@ -4,6 +4,7 @@ package applicationinsights import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -117,6 +118,83 @@ func addOperationListLogPatternSetsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListLogPatternSetsPaginator returns a new ListLogPatternSetsPaginator +func NewListLogPatternSetsPaginator(client ListLogPatternSetsAPIClient, params *ListLogPatternSetsInput, optFns ...func(*ListLogPatternSetsPaginatorOptions)) *ListLogPatternSetsPaginator { + options := ListLogPatternSetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListLogPatternSetsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListLogPatternSets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/applicationinsights/api_op_ListLogPatterns.go b/service/applicationinsights/api_op_ListLogPatterns.go index ea9cc6edde9..4a51d83927d 100644 --- a/service/applicationinsights/api_op_ListLogPatterns.go +++ b/service/applicationinsights/api_op_ListLogPatterns.go @@ -4,6 +4,7 @@ package applicationinsights import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/applicationinsights/types" @@ -121,6 +122,82 @@ func addOperationListLogPatternsMiddlewares(stack *middleware.Stack, options Opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListLogPatternsPaginator returns a new ListLogPatternsPaginator +func NewListLogPatternsPaginator(client ListLogPatternsAPIClient, params *ListLogPatternsInput, optFns ...func(*ListLogPatternsPaginatorOptions)) *ListLogPatternsPaginator { + options := ListLogPatternsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListLogPatternsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListLogPatterns(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/applicationinsights/api_op_ListProblems.go b/service/applicationinsights/api_op_ListProblems.go index 9bc807cac4a..523b823d467 100644 --- a/service/applicationinsights/api_op_ListProblems.go +++ b/service/applicationinsights/api_op_ListProblems.go @@ -4,6 +4,7 @@ package applicationinsights import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/applicationinsights/types" @@ -119,6 +120,81 @@ func addOperationListProblemsMiddlewares(stack *middleware.Stack, options Option return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListProblemsPaginator returns a new ListProblemsPaginator +func NewListProblemsPaginator(client ListProblemsAPIClient, params *ListProblemsInput, optFns ...func(*ListProblemsPaginatorOptions)) *ListProblemsPaginator { + options := ListProblemsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListProblemsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListProblems(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/applicationinsights/go.mod b/service/applicationinsights/go.mod index 0c0139637b8..f692ce261d2 100644 --- a/service/applicationinsights/go.mod +++ b/service/applicationinsights/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/applicationinsights/go.sum b/service/applicationinsights/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/applicationinsights/go.sum +++ b/service/applicationinsights/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 3b6ff51c256..00000000000 --- a/service/applicationinsights/paginators.go +++ /dev/null @@ -1,470 +0,0 @@ -// 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/api_op_ListGatewayRoutes.go b/service/appmesh/api_op_ListGatewayRoutes.go index 05ed0b06a60..568bd4fa2ba 100644 --- a/service/appmesh/api_op_ListGatewayRoutes.go +++ b/service/appmesh/api_op_ListGatewayRoutes.go @@ -4,6 +4,7 @@ package appmesh import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/appmesh/types" @@ -136,3 +137,84 @@ func addOperationListGatewayRoutesMiddlewares(stack *middleware.Stack, options O } return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListGatewayRoutesPaginator returns a new ListGatewayRoutesPaginator +func NewListGatewayRoutesPaginator(client ListGatewayRoutesAPIClient, params *ListGatewayRoutesInput, optFns ...func(*ListGatewayRoutesPaginatorOptions)) *ListGatewayRoutesPaginator { + options := ListGatewayRoutesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListGatewayRoutesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} diff --git a/service/appmesh/api_op_ListMeshes.go b/service/appmesh/api_op_ListMeshes.go index d6c6658f33d..87b1830499f 100644 --- a/service/appmesh/api_op_ListMeshes.go +++ b/service/appmesh/api_op_ListMeshes.go @@ -4,6 +4,7 @@ package appmesh import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/appmesh/types" @@ -118,3 +119,83 @@ func addOperationListMeshesMiddlewares(stack *middleware.Stack, options Options) } return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListMeshesPaginator returns a new ListMeshesPaginator +func NewListMeshesPaginator(client ListMeshesAPIClient, params *ListMeshesInput, optFns ...func(*ListMeshesPaginatorOptions)) *ListMeshesPaginator { + options := ListMeshesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListMeshesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} diff --git a/service/appmesh/api_op_ListRoutes.go b/service/appmesh/api_op_ListRoutes.go index fcc2ec4c43b..a443bbfde15 100644 --- a/service/appmesh/api_op_ListRoutes.go +++ b/service/appmesh/api_op_ListRoutes.go @@ -4,6 +4,7 @@ package appmesh import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/appmesh/types" @@ -136,3 +137,83 @@ func addOperationListRoutesMiddlewares(stack *middleware.Stack, options Options) } return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListRoutesPaginator returns a new ListRoutesPaginator +func NewListRoutesPaginator(client ListRoutesAPIClient, params *ListRoutesInput, optFns ...func(*ListRoutesPaginatorOptions)) *ListRoutesPaginator { + options := ListRoutesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRoutesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} diff --git a/service/appmesh/api_op_ListTagsForResource.go b/service/appmesh/api_op_ListTagsForResource.go index 53646940f8b..a4477991af1 100644 --- a/service/appmesh/api_op_ListTagsForResource.go +++ b/service/appmesh/api_op_ListTagsForResource.go @@ -4,6 +4,7 @@ package appmesh import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/appmesh/types" @@ -130,6 +131,88 @@ func addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator +func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator { + options := ListTagsForResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTagsForResourceInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/appmesh/api_op_ListVirtualGateways.go b/service/appmesh/api_op_ListVirtualGateways.go index 673205574b1..e0c72186541 100644 --- a/service/appmesh/api_op_ListVirtualGateways.go +++ b/service/appmesh/api_op_ListVirtualGateways.go @@ -4,6 +4,7 @@ package appmesh import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/appmesh/types" @@ -129,3 +130,85 @@ func addOperationListVirtualGatewaysMiddlewares(stack *middleware.Stack, options } return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListVirtualGatewaysPaginator returns a new ListVirtualGatewaysPaginator +func NewListVirtualGatewaysPaginator(client ListVirtualGatewaysAPIClient, params *ListVirtualGatewaysInput, optFns ...func(*ListVirtualGatewaysPaginatorOptions)) *ListVirtualGatewaysPaginator { + options := ListVirtualGatewaysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListVirtualGatewaysInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} diff --git a/service/appmesh/api_op_ListVirtualNodes.go b/service/appmesh/api_op_ListVirtualNodes.go index c1747eb9f3c..5accfe6bf41 100644 --- a/service/appmesh/api_op_ListVirtualNodes.go +++ b/service/appmesh/api_op_ListVirtualNodes.go @@ -4,6 +4,7 @@ package appmesh import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/appmesh/types" @@ -131,3 +132,84 @@ func addOperationListVirtualNodesMiddlewares(stack *middleware.Stack, options Op } return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListVirtualNodesPaginator returns a new ListVirtualNodesPaginator +func NewListVirtualNodesPaginator(client ListVirtualNodesAPIClient, params *ListVirtualNodesInput, optFns ...func(*ListVirtualNodesPaginatorOptions)) *ListVirtualNodesPaginator { + options := ListVirtualNodesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListVirtualNodesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} diff --git a/service/appmesh/api_op_ListVirtualRouters.go b/service/appmesh/api_op_ListVirtualRouters.go index 576c9d41536..4fbc7034ea5 100644 --- a/service/appmesh/api_op_ListVirtualRouters.go +++ b/service/appmesh/api_op_ListVirtualRouters.go @@ -4,6 +4,7 @@ package appmesh import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/appmesh/types" @@ -131,3 +132,85 @@ func addOperationListVirtualRoutersMiddlewares(stack *middleware.Stack, options } return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListVirtualRoutersPaginator returns a new ListVirtualRoutersPaginator +func NewListVirtualRoutersPaginator(client ListVirtualRoutersAPIClient, params *ListVirtualRoutersInput, optFns ...func(*ListVirtualRoutersPaginatorOptions)) *ListVirtualRoutersPaginator { + options := ListVirtualRoutersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListVirtualRoutersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} diff --git a/service/appmesh/api_op_ListVirtualServices.go b/service/appmesh/api_op_ListVirtualServices.go index f1afaaef860..ab755665c6f 100644 --- a/service/appmesh/api_op_ListVirtualServices.go +++ b/service/appmesh/api_op_ListVirtualServices.go @@ -4,6 +4,7 @@ package appmesh import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/appmesh/types" @@ -131,3 +132,85 @@ func addOperationListVirtualServicesMiddlewares(stack *middleware.Stack, options } return nil } + +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListVirtualServicesPaginator returns a new ListVirtualServicesPaginator +func NewListVirtualServicesPaginator(client ListVirtualServicesAPIClient, params *ListVirtualServicesInput, optFns ...func(*ListVirtualServicesPaginatorOptions)) *ListVirtualServicesPaginator { + options := ListVirtualServicesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListVirtualServicesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} diff --git a/service/appmesh/go.mod b/service/appmesh/go.mod index 3cce4c21e01..f4441df508d 100644 --- a/service/appmesh/go.mod +++ b/service/appmesh/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/appmesh/go.sum b/service/appmesh/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/appmesh/go.sum +++ b/service/appmesh/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index d377a720467..00000000000 --- a/service/appmesh/paginators.go +++ /dev/null @@ -1,658 +0,0 @@ -// 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/api_op_DescribeImagePermissions.go b/service/appstream/api_op_DescribeImagePermissions.go index b154f4e21a2..01e1fea8473 100644 --- a/service/appstream/api_op_DescribeImagePermissions.go +++ b/service/appstream/api_op_DescribeImagePermissions.go @@ -4,6 +4,7 @@ package appstream import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/appstream/types" @@ -124,6 +125,83 @@ func addOperationDescribeImagePermissionsMiddlewares(stack *middleware.Stack, op return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeImagePermissionsPaginator returns a new +// DescribeImagePermissionsPaginator +func NewDescribeImagePermissionsPaginator(client DescribeImagePermissionsAPIClient, params *DescribeImagePermissionsInput, optFns ...func(*DescribeImagePermissionsPaginatorOptions)) *DescribeImagePermissionsPaginator { + options := DescribeImagePermissionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeImagePermissionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeImagePermissions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/appstream/api_op_DescribeImages.go b/service/appstream/api_op_DescribeImages.go index f75084dff55..7d7219c6ba4 100644 --- a/service/appstream/api_op_DescribeImages.go +++ b/service/appstream/api_op_DescribeImages.go @@ -4,6 +4,7 @@ package appstream import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/appstream/types" @@ -117,6 +118,81 @@ func addOperationDescribeImagesMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeImagesPaginator returns a new DescribeImagesPaginator +func NewDescribeImagesPaginator(client DescribeImagesAPIClient, params *DescribeImagesInput, optFns ...func(*DescribeImagesPaginatorOptions)) *DescribeImagesPaginator { + options := DescribeImagesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeImagesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeImages(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/appstream/go.mod b/service/appstream/go.mod index b5be4139798..b5d5fd9e499 100644 --- a/service/appstream/go.mod +++ b/service/appstream/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/appstream/go.sum b/service/appstream/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/appstream/go.sum +++ b/service/appstream/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index d18233153c2..00000000000 --- a/service/appstream/paginators.go +++ /dev/null @@ -1,160 +0,0 @@ -// 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.mod b/service/appsync/go.mod index ebaa7c04025..8f8116f9512 100644 --- a/service/appsync/go.mod +++ b/service/appsync/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/appsync/go.sum b/service/appsync/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/appsync/go.sum +++ b/service/appsync/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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/api_op_GetQueryResults.go b/service/athena/api_op_GetQueryResults.go index 7ce9a9af21d..2579a06216e 100644 --- a/service/athena/api_op_GetQueryResults.go +++ b/service/athena/api_op_GetQueryResults.go @@ -4,6 +4,7 @@ package athena import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/athena/types" @@ -131,6 +132,81 @@ func addOperationGetQueryResultsMiddlewares(stack *middleware.Stack, options Opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetQueryResultsPaginator returns a new GetQueryResultsPaginator +func NewGetQueryResultsPaginator(client GetQueryResultsAPIClient, params *GetQueryResultsInput, optFns ...func(*GetQueryResultsPaginatorOptions)) *GetQueryResultsPaginator { + options := GetQueryResultsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetQueryResultsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetQueryResults(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/athena/api_op_ListDataCatalogs.go b/service/athena/api_op_ListDataCatalogs.go index 3d61da89b84..c3a5f0f1cb7 100644 --- a/service/athena/api_op_ListDataCatalogs.go +++ b/service/athena/api_op_ListDataCatalogs.go @@ -4,6 +4,7 @@ package athena import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/athena/types" @@ -109,6 +110,81 @@ func addOperationListDataCatalogsMiddlewares(stack *middleware.Stack, options Op return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDataCatalogsPaginator returns a new ListDataCatalogsPaginator +func NewListDataCatalogsPaginator(client ListDataCatalogsAPIClient, params *ListDataCatalogsInput, optFns ...func(*ListDataCatalogsPaginatorOptions)) *ListDataCatalogsPaginator { + options := ListDataCatalogsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDataCatalogsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDataCatalogs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/athena/api_op_ListDatabases.go b/service/athena/api_op_ListDatabases.go index 08b7bf21fab..73a9c348070 100644 --- a/service/athena/api_op_ListDatabases.go +++ b/service/athena/api_op_ListDatabases.go @@ -4,6 +4,7 @@ package athena import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/athena/types" @@ -117,6 +118,80 @@ func addOperationListDatabasesMiddlewares(stack *middleware.Stack, options Optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDatabasesPaginator returns a new ListDatabasesPaginator +func NewListDatabasesPaginator(client ListDatabasesAPIClient, params *ListDatabasesInput, optFns ...func(*ListDatabasesPaginatorOptions)) *ListDatabasesPaginator { + options := ListDatabasesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDatabasesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDatabases(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/athena/api_op_ListNamedQueries.go b/service/athena/api_op_ListNamedQueries.go index 9a75898cc31..c63cb2a6c75 100644 --- a/service/athena/api_op_ListNamedQueries.go +++ b/service/athena/api_op_ListNamedQueries.go @@ -4,6 +4,7 @@ package athena import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -118,6 +119,81 @@ func addOperationListNamedQueriesMiddlewares(stack *middleware.Stack, options Op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListNamedQueriesPaginator returns a new ListNamedQueriesPaginator +func NewListNamedQueriesPaginator(client ListNamedQueriesAPIClient, params *ListNamedQueriesInput, optFns ...func(*ListNamedQueriesPaginatorOptions)) *ListNamedQueriesPaginator { + options := ListNamedQueriesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListNamedQueriesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListNamedQueries(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/athena/api_op_ListQueryExecutions.go b/service/athena/api_op_ListQueryExecutions.go index 8ee63c604b2..06fab65d158 100644 --- a/service/athena/api_op_ListQueryExecutions.go +++ b/service/athena/api_op_ListQueryExecutions.go @@ -4,6 +4,7 @@ package athena import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -117,6 +118,82 @@ func addOperationListQueryExecutionsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListQueryExecutionsPaginator returns a new ListQueryExecutionsPaginator +func NewListQueryExecutionsPaginator(client ListQueryExecutionsAPIClient, params *ListQueryExecutionsInput, optFns ...func(*ListQueryExecutionsPaginatorOptions)) *ListQueryExecutionsPaginator { + options := ListQueryExecutionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListQueryExecutionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListQueryExecutions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/athena/api_op_ListTableMetadata.go b/service/athena/api_op_ListTableMetadata.go index d00d035220b..980c647d46e 100644 --- a/service/athena/api_op_ListTableMetadata.go +++ b/service/athena/api_op_ListTableMetadata.go @@ -4,6 +4,7 @@ package athena import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/athena/types" @@ -126,6 +127,81 @@ func addOperationListTableMetadataMiddlewares(stack *middleware.Stack, options O return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTableMetadataPaginator returns a new ListTableMetadataPaginator +func NewListTableMetadataPaginator(client ListTableMetadataAPIClient, params *ListTableMetadataInput, optFns ...func(*ListTableMetadataPaginatorOptions)) *ListTableMetadataPaginator { + options := ListTableMetadataPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTableMetadataInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTableMetadata(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/athena/api_op_ListTagsForResource.go b/service/athena/api_op_ListTagsForResource.go index ba20bb1f75c..d3513ee1608 100644 --- a/service/athena/api_op_ListTagsForResource.go +++ b/service/athena/api_op_ListTagsForResource.go @@ -4,6 +4,7 @@ package athena import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/athena/types" @@ -116,6 +117,83 @@ func addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator +func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator { + options := ListTagsForResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTagsForResourceInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/athena/api_op_ListWorkGroups.go b/service/athena/api_op_ListWorkGroups.go index 4e6224581ed..ca6ef55706d 100644 --- a/service/athena/api_op_ListWorkGroups.go +++ b/service/athena/api_op_ListWorkGroups.go @@ -4,6 +4,7 @@ package athena import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/athena/types" @@ -110,6 +111,81 @@ func addOperationListWorkGroupsMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListWorkGroupsPaginator returns a new ListWorkGroupsPaginator +func NewListWorkGroupsPaginator(client ListWorkGroupsAPIClient, params *ListWorkGroupsInput, optFns ...func(*ListWorkGroupsPaginatorOptions)) *ListWorkGroupsPaginator { + options := ListWorkGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListWorkGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListWorkGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/athena/go.mod b/service/athena/go.mod index 2e109321bf1..6e91432896d 100644 --- a/service/athena/go.mod +++ b/service/athena/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/athena/go.sum b/service/athena/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/athena/go.sum +++ b/service/athena/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 5627e3c6ced..00000000000 --- a/service/athena/paginators.go +++ /dev/null @@ -1,610 +0,0 @@ -// 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/api_op_DescribeAutoScalingGroups.go b/service/autoscaling/api_op_DescribeAutoScalingGroups.go index c5b526450e6..74814a058ec 100644 --- a/service/autoscaling/api_op_DescribeAutoScalingGroups.go +++ b/service/autoscaling/api_op_DescribeAutoScalingGroups.go @@ -4,6 +4,7 @@ package autoscaling import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/autoscaling/types" @@ -118,6 +119,84 @@ func addOperationDescribeAutoScalingGroupsMiddlewares(stack *middleware.Stack, o return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeAutoScalingGroupsPaginator returns a new +// DescribeAutoScalingGroupsPaginator +func NewDescribeAutoScalingGroupsPaginator(client DescribeAutoScalingGroupsAPIClient, params *DescribeAutoScalingGroupsInput, optFns ...func(*DescribeAutoScalingGroupsPaginatorOptions)) *DescribeAutoScalingGroupsPaginator { + options := DescribeAutoScalingGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeAutoScalingGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeAutoScalingGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/autoscaling/api_op_DescribeAutoScalingInstances.go b/service/autoscaling/api_op_DescribeAutoScalingInstances.go index 3b4238605d0..d51ea018310 100644 --- a/service/autoscaling/api_op_DescribeAutoScalingInstances.go +++ b/service/autoscaling/api_op_DescribeAutoScalingInstances.go @@ -4,6 +4,7 @@ package autoscaling import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/autoscaling/types" @@ -115,6 +116,84 @@ func addOperationDescribeAutoScalingInstancesMiddlewares(stack *middleware.Stack return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeAutoScalingInstancesPaginator returns a new +// DescribeAutoScalingInstancesPaginator +func NewDescribeAutoScalingInstancesPaginator(client DescribeAutoScalingInstancesAPIClient, params *DescribeAutoScalingInstancesInput, optFns ...func(*DescribeAutoScalingInstancesPaginatorOptions)) *DescribeAutoScalingInstancesPaginator { + options := DescribeAutoScalingInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeAutoScalingInstancesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeAutoScalingInstances(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/autoscaling/api_op_DescribeLaunchConfigurations.go b/service/autoscaling/api_op_DescribeLaunchConfigurations.go index dc5206ff8f3..81e51dde04b 100644 --- a/service/autoscaling/api_op_DescribeLaunchConfigurations.go +++ b/service/autoscaling/api_op_DescribeLaunchConfigurations.go @@ -4,6 +4,7 @@ package autoscaling import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/autoscaling/types" @@ -116,6 +117,84 @@ func addOperationDescribeLaunchConfigurationsMiddlewares(stack *middleware.Stack return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeLaunchConfigurationsPaginator returns a new +// DescribeLaunchConfigurationsPaginator +func NewDescribeLaunchConfigurationsPaginator(client DescribeLaunchConfigurationsAPIClient, params *DescribeLaunchConfigurationsInput, optFns ...func(*DescribeLaunchConfigurationsPaginatorOptions)) *DescribeLaunchConfigurationsPaginator { + options := DescribeLaunchConfigurationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeLaunchConfigurationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeLaunchConfigurations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/autoscaling/api_op_DescribeNotificationConfigurations.go b/service/autoscaling/api_op_DescribeNotificationConfigurations.go index a64d429effe..59d10704acf 100644 --- a/service/autoscaling/api_op_DescribeNotificationConfigurations.go +++ b/service/autoscaling/api_op_DescribeNotificationConfigurations.go @@ -4,6 +4,7 @@ package autoscaling import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/autoscaling/types" @@ -116,6 +117,84 @@ func addOperationDescribeNotificationConfigurationsMiddlewares(stack *middleware return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeNotificationConfigurationsPaginator returns a new +// DescribeNotificationConfigurationsPaginator +func NewDescribeNotificationConfigurationsPaginator(client DescribeNotificationConfigurationsAPIClient, params *DescribeNotificationConfigurationsInput, optFns ...func(*DescribeNotificationConfigurationsPaginatorOptions)) *DescribeNotificationConfigurationsPaginator { + options := DescribeNotificationConfigurationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeNotificationConfigurationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeNotificationConfigurations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/autoscaling/api_op_DescribePolicies.go b/service/autoscaling/api_op_DescribePolicies.go index 1f723d77c05..3969ea82d5b 100644 --- a/service/autoscaling/api_op_DescribePolicies.go +++ b/service/autoscaling/api_op_DescribePolicies.go @@ -4,6 +4,7 @@ package autoscaling import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/autoscaling/types" @@ -123,6 +124,82 @@ func addOperationDescribePoliciesMiddlewares(stack *middleware.Stack, options Op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribePoliciesPaginator returns a new DescribePoliciesPaginator +func NewDescribePoliciesPaginator(client DescribePoliciesAPIClient, params *DescribePoliciesInput, optFns ...func(*DescribePoliciesPaginatorOptions)) *DescribePoliciesPaginator { + options := DescribePoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribePoliciesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribePolicies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/autoscaling/api_op_DescribeScalingActivities.go b/service/autoscaling/api_op_DescribeScalingActivities.go index 82281d483a4..9837a3c4f65 100644 --- a/service/autoscaling/api_op_DescribeScalingActivities.go +++ b/service/autoscaling/api_op_DescribeScalingActivities.go @@ -4,6 +4,7 @@ package autoscaling import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/autoscaling/types" @@ -122,6 +123,84 @@ func addOperationDescribeScalingActivitiesMiddlewares(stack *middleware.Stack, o return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeScalingActivitiesPaginator returns a new +// DescribeScalingActivitiesPaginator +func NewDescribeScalingActivitiesPaginator(client DescribeScalingActivitiesAPIClient, params *DescribeScalingActivitiesInput, optFns ...func(*DescribeScalingActivitiesPaginatorOptions)) *DescribeScalingActivitiesPaginator { + options := DescribeScalingActivitiesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeScalingActivitiesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeScalingActivities(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/autoscaling/api_op_DescribeScheduledActions.go b/service/autoscaling/api_op_DescribeScheduledActions.go index f010a6e928f..ade0dd763a6 100644 --- a/service/autoscaling/api_op_DescribeScheduledActions.go +++ b/service/autoscaling/api_op_DescribeScheduledActions.go @@ -4,6 +4,7 @@ package autoscaling import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/autoscaling/types" @@ -129,6 +130,84 @@ func addOperationDescribeScheduledActionsMiddlewares(stack *middleware.Stack, op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeScheduledActionsPaginator returns a new +// DescribeScheduledActionsPaginator +func NewDescribeScheduledActionsPaginator(client DescribeScheduledActionsAPIClient, params *DescribeScheduledActionsInput, optFns ...func(*DescribeScheduledActionsPaginatorOptions)) *DescribeScheduledActionsPaginator { + options := DescribeScheduledActionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeScheduledActionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeScheduledActions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/autoscaling/api_op_DescribeTags.go b/service/autoscaling/api_op_DescribeTags.go index 2bd3647a55e..42092462442 100644 --- a/service/autoscaling/api_op_DescribeTags.go +++ b/service/autoscaling/api_op_DescribeTags.go @@ -4,6 +4,7 @@ package autoscaling import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/autoscaling/types" @@ -122,6 +123,81 @@ func addOperationDescribeTagsMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeTagsPaginator returns a new DescribeTagsPaginator +func NewDescribeTagsPaginator(client DescribeTagsAPIClient, params *DescribeTagsInput, optFns ...func(*DescribeTagsPaginatorOptions)) *DescribeTagsPaginator { + options := DescribeTagsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeTagsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeTags(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/autoscaling/go.mod b/service/autoscaling/go.mod index a08279c044a..aae66f66237 100644 --- a/service/autoscaling/go.mod +++ b/service/autoscaling/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/autoscaling/go.sum b/service/autoscaling/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/autoscaling/go.sum +++ b/service/autoscaling/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index ba0fab07aa6..00000000000 --- a/service/autoscaling/paginators.go +++ /dev/null @@ -1,627 +0,0 @@ -// 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.mod b/service/autoscalingplans/go.mod index 1f618ff649e..b4e8845494b 100644 --- a/service/autoscalingplans/go.mod +++ b/service/autoscalingplans/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/autoscalingplans/go.sum b/service/autoscalingplans/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/autoscalingplans/go.sum +++ b/service/autoscalingplans/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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/api_op_ListBackupJobs.go b/service/backup/api_op_ListBackupJobs.go index e0337469f08..3dfe4f1925a 100644 --- a/service/backup/api_op_ListBackupJobs.go +++ b/service/backup/api_op_ListBackupJobs.go @@ -4,6 +4,7 @@ package backup import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/backup/types" @@ -154,6 +155,81 @@ func addOperationListBackupJobsMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListBackupJobsPaginator returns a new ListBackupJobsPaginator +func NewListBackupJobsPaginator(client ListBackupJobsAPIClient, params *ListBackupJobsInput, optFns ...func(*ListBackupJobsPaginatorOptions)) *ListBackupJobsPaginator { + options := ListBackupJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListBackupJobsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListBackupJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/backup/api_op_ListBackupPlanTemplates.go b/service/backup/api_op_ListBackupPlanTemplates.go index 35ec9efd30d..778159c2570 100644 --- a/service/backup/api_op_ListBackupPlanTemplates.go +++ b/service/backup/api_op_ListBackupPlanTemplates.go @@ -4,6 +4,7 @@ package backup import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/backup/types" @@ -112,6 +113,83 @@ func addOperationListBackupPlanTemplatesMiddlewares(stack *middleware.Stack, opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListBackupPlanTemplatesPaginator returns a new +// ListBackupPlanTemplatesPaginator +func NewListBackupPlanTemplatesPaginator(client ListBackupPlanTemplatesAPIClient, params *ListBackupPlanTemplatesInput, optFns ...func(*ListBackupPlanTemplatesPaginatorOptions)) *ListBackupPlanTemplatesPaginator { + options := ListBackupPlanTemplatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListBackupPlanTemplatesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListBackupPlanTemplates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/backup/api_op_ListBackupPlanVersions.go b/service/backup/api_op_ListBackupPlanVersions.go index af18cbc00d4..dbe33af423e 100644 --- a/service/backup/api_op_ListBackupPlanVersions.go +++ b/service/backup/api_op_ListBackupPlanVersions.go @@ -4,6 +4,7 @@ package backup import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/backup/types" @@ -121,6 +122,82 @@ func addOperationListBackupPlanVersionsMiddlewares(stack *middleware.Stack, opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListBackupPlanVersionsPaginator returns a new ListBackupPlanVersionsPaginator +func NewListBackupPlanVersionsPaginator(client ListBackupPlanVersionsAPIClient, params *ListBackupPlanVersionsInput, optFns ...func(*ListBackupPlanVersionsPaginatorOptions)) *ListBackupPlanVersionsPaginator { + options := ListBackupPlanVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListBackupPlanVersionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListBackupPlanVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/backup/api_op_ListBackupPlans.go b/service/backup/api_op_ListBackupPlans.go index 3f677159091..02cdba54677 100644 --- a/service/backup/api_op_ListBackupPlans.go +++ b/service/backup/api_op_ListBackupPlans.go @@ -4,6 +4,7 @@ package backup import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/backup/types" @@ -119,6 +120,81 @@ func addOperationListBackupPlansMiddlewares(stack *middleware.Stack, options Opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListBackupPlansPaginator returns a new ListBackupPlansPaginator +func NewListBackupPlansPaginator(client ListBackupPlansAPIClient, params *ListBackupPlansInput, optFns ...func(*ListBackupPlansPaginatorOptions)) *ListBackupPlansPaginator { + options := ListBackupPlansPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListBackupPlansInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListBackupPlans(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/backup/api_op_ListBackupSelections.go b/service/backup/api_op_ListBackupSelections.go index fa632d107ee..302bef0e32e 100644 --- a/service/backup/api_op_ListBackupSelections.go +++ b/service/backup/api_op_ListBackupSelections.go @@ -4,6 +4,7 @@ package backup import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/backup/types" @@ -121,6 +122,82 @@ func addOperationListBackupSelectionsMiddlewares(stack *middleware.Stack, option return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListBackupSelectionsPaginator returns a new ListBackupSelectionsPaginator +func NewListBackupSelectionsPaginator(client ListBackupSelectionsAPIClient, params *ListBackupSelectionsInput, optFns ...func(*ListBackupSelectionsPaginatorOptions)) *ListBackupSelectionsPaginator { + options := ListBackupSelectionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListBackupSelectionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListBackupSelections(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/backup/api_op_ListBackupVaults.go b/service/backup/api_op_ListBackupVaults.go index 07ac38e1949..d51cbb1ee62 100644 --- a/service/backup/api_op_ListBackupVaults.go +++ b/service/backup/api_op_ListBackupVaults.go @@ -4,6 +4,7 @@ package backup import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/backup/types" @@ -115,6 +116,81 @@ func addOperationListBackupVaultsMiddlewares(stack *middleware.Stack, options Op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListBackupVaultsPaginator returns a new ListBackupVaultsPaginator +func NewListBackupVaultsPaginator(client ListBackupVaultsAPIClient, params *ListBackupVaultsInput, optFns ...func(*ListBackupVaultsPaginatorOptions)) *ListBackupVaultsPaginator { + options := ListBackupVaultsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListBackupVaultsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListBackupVaults(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/backup/api_op_ListCopyJobs.go b/service/backup/api_op_ListCopyJobs.go index 70c096c62f5..6b5cdd7cd0e 100644 --- a/service/backup/api_op_ListCopyJobs.go +++ b/service/backup/api_op_ListCopyJobs.go @@ -4,6 +4,7 @@ package backup import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/backup/types" @@ -153,6 +154,80 @@ func addOperationListCopyJobsMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListCopyJobsPaginator returns a new ListCopyJobsPaginator +func NewListCopyJobsPaginator(client ListCopyJobsAPIClient, params *ListCopyJobsInput, optFns ...func(*ListCopyJobsPaginatorOptions)) *ListCopyJobsPaginator { + options := ListCopyJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListCopyJobsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListCopyJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/backup/api_op_ListProtectedResources.go b/service/backup/api_op_ListProtectedResources.go index d3f30f099f9..8a9b98e75e6 100644 --- a/service/backup/api_op_ListProtectedResources.go +++ b/service/backup/api_op_ListProtectedResources.go @@ -4,6 +4,7 @@ package backup import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/backup/types" @@ -115,6 +116,82 @@ func addOperationListProtectedResourcesMiddlewares(stack *middleware.Stack, opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListProtectedResourcesPaginator returns a new ListProtectedResourcesPaginator +func NewListProtectedResourcesPaginator(client ListProtectedResourcesAPIClient, params *ListProtectedResourcesInput, optFns ...func(*ListProtectedResourcesPaginatorOptions)) *ListProtectedResourcesPaginator { + options := ListProtectedResourcesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListProtectedResourcesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListProtectedResources(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/backup/api_op_ListRecoveryPointsByBackupVault.go b/service/backup/api_op_ListRecoveryPointsByBackupVault.go index 7132338c193..17a363e2fec 100644 --- a/service/backup/api_op_ListRecoveryPointsByBackupVault.go +++ b/service/backup/api_op_ListRecoveryPointsByBackupVault.go @@ -4,6 +4,7 @@ package backup import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/backup/types" @@ -140,6 +141,83 @@ func addOperationListRecoveryPointsByBackupVaultMiddlewares(stack *middleware.St return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListRecoveryPointsByBackupVaultPaginator returns a new +// ListRecoveryPointsByBackupVaultPaginator +func NewListRecoveryPointsByBackupVaultPaginator(client ListRecoveryPointsByBackupVaultAPIClient, params *ListRecoveryPointsByBackupVaultInput, optFns ...func(*ListRecoveryPointsByBackupVaultPaginatorOptions)) *ListRecoveryPointsByBackupVaultPaginator { + options := ListRecoveryPointsByBackupVaultPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRecoveryPointsByBackupVaultInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRecoveryPointsByBackupVault(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/backup/api_op_ListRecoveryPointsByResource.go b/service/backup/api_op_ListRecoveryPointsByResource.go index 66d7ae80cd7..a6ca30bbd83 100644 --- a/service/backup/api_op_ListRecoveryPointsByResource.go +++ b/service/backup/api_op_ListRecoveryPointsByResource.go @@ -4,6 +4,7 @@ package backup import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/backup/types" @@ -122,6 +123,83 @@ func addOperationListRecoveryPointsByResourceMiddlewares(stack *middleware.Stack return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListRecoveryPointsByResourcePaginator returns a new +// ListRecoveryPointsByResourcePaginator +func NewListRecoveryPointsByResourcePaginator(client ListRecoveryPointsByResourceAPIClient, params *ListRecoveryPointsByResourceInput, optFns ...func(*ListRecoveryPointsByResourcePaginatorOptions)) *ListRecoveryPointsByResourcePaginator { + options := ListRecoveryPointsByResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRecoveryPointsByResourceInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRecoveryPointsByResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/backup/api_op_ListRestoreJobs.go b/service/backup/api_op_ListRestoreJobs.go index 5865da450cf..beb5dce4d65 100644 --- a/service/backup/api_op_ListRestoreJobs.go +++ b/service/backup/api_op_ListRestoreJobs.go @@ -4,6 +4,7 @@ package backup import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/backup/types" @@ -127,6 +128,81 @@ func addOperationListRestoreJobsMiddlewares(stack *middleware.Stack, options Opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListRestoreJobsPaginator returns a new ListRestoreJobsPaginator +func NewListRestoreJobsPaginator(client ListRestoreJobsAPIClient, params *ListRestoreJobsInput, optFns ...func(*ListRestoreJobsPaginatorOptions)) *ListRestoreJobsPaginator { + options := ListRestoreJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRestoreJobsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRestoreJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/backup/api_op_ListTags.go b/service/backup/api_op_ListTags.go index ed4dd314b6c..48ae34d213c 100644 --- a/service/backup/api_op_ListTags.go +++ b/service/backup/api_op_ListTags.go @@ -4,6 +4,7 @@ package backup import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -123,6 +124,80 @@ func addOperationListTagsMiddlewares(stack *middleware.Stack, options Options) ( return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTagsPaginator returns a new ListTagsPaginator +func NewListTagsPaginator(client ListTagsAPIClient, params *ListTagsInput, optFns ...func(*ListTagsPaginatorOptions)) *ListTagsPaginator { + options := ListTagsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTagsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTags(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/backup/go.mod b/service/backup/go.mod index 537103d349d..2ea61df2f3e 100644 --- a/service/backup/go.mod +++ b/service/backup/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/backup/go.sum b/service/backup/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/backup/go.sum +++ b/service/backup/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index e59b694ee8d..00000000000 --- a/service/backup/paginators.go +++ /dev/null @@ -1,915 +0,0 @@ -// 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/api_op_DescribeComputeEnvironments.go b/service/batch/api_op_DescribeComputeEnvironments.go index d08be2955e1..bb15da5791d 100644 --- a/service/batch/api_op_DescribeComputeEnvironments.go +++ b/service/batch/api_op_DescribeComputeEnvironments.go @@ -4,6 +4,7 @@ package batch import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/batch/types" @@ -128,6 +129,90 @@ func addOperationDescribeComputeEnvironmentsMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeComputeEnvironmentsPaginator returns a new +// DescribeComputeEnvironmentsPaginator +func NewDescribeComputeEnvironmentsPaginator(client DescribeComputeEnvironmentsAPIClient, params *DescribeComputeEnvironmentsInput, optFns ...func(*DescribeComputeEnvironmentsPaginatorOptions)) *DescribeComputeEnvironmentsPaginator { + options := DescribeComputeEnvironmentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeComputeEnvironmentsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeComputeEnvironments(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/batch/api_op_DescribeJobDefinitions.go b/service/batch/api_op_DescribeJobDefinitions.go index 5220e490f32..051f63cbf60 100644 --- a/service/batch/api_op_DescribeJobDefinitions.go +++ b/service/batch/api_op_DescribeJobDefinitions.go @@ -4,6 +4,7 @@ package batch import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/batch/types" @@ -131,6 +132,88 @@ func addOperationDescribeJobDefinitionsMiddlewares(stack *middleware.Stack, opti return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeJobDefinitionsPaginator returns a new DescribeJobDefinitionsPaginator +func NewDescribeJobDefinitionsPaginator(client DescribeJobDefinitionsAPIClient, params *DescribeJobDefinitionsInput, optFns ...func(*DescribeJobDefinitionsPaginatorOptions)) *DescribeJobDefinitionsPaginator { + options := DescribeJobDefinitionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeJobDefinitionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeJobDefinitions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/batch/api_op_DescribeJobQueues.go b/service/batch/api_op_DescribeJobQueues.go index 4cd3b1d8e39..964a70bb4d3 100644 --- a/service/batch/api_op_DescribeJobQueues.go +++ b/service/batch/api_op_DescribeJobQueues.go @@ -4,6 +4,7 @@ package batch import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/batch/types" @@ -123,6 +124,87 @@ func addOperationDescribeJobQueuesMiddlewares(stack *middleware.Stack, options O return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeJobQueuesPaginator returns a new DescribeJobQueuesPaginator +func NewDescribeJobQueuesPaginator(client DescribeJobQueuesAPIClient, params *DescribeJobQueuesInput, optFns ...func(*DescribeJobQueuesPaginatorOptions)) *DescribeJobQueuesPaginator { + options := DescribeJobQueuesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeJobQueuesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeJobQueues(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/batch/api_op_ListJobs.go b/service/batch/api_op_ListJobs.go index 6d531908b5e..10149d715ab 100644 --- a/service/batch/api_op_ListJobs.go +++ b/service/batch/api_op_ListJobs.go @@ -4,6 +4,7 @@ package batch import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/batch/types" @@ -151,6 +152,86 @@ func addOperationListJobsMiddlewares(stack *middleware.Stack, options Options) ( return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListJobsPaginator returns a new ListJobsPaginator +func NewListJobsPaginator(client ListJobsAPIClient, params *ListJobsInput, optFns ...func(*ListJobsPaginatorOptions)) *ListJobsPaginator { + options := ListJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListJobsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/batch/go.mod b/service/batch/go.mod index 7c9b1a4ae76..3fff5c90570 100644 --- a/service/batch/go.mod +++ b/service/batch/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/batch/go.sum b/service/batch/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/batch/go.sum +++ b/service/batch/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index f8af7bc6608..00000000000 --- a/service/batch/paginators.go +++ /dev/null @@ -1,335 +0,0 @@ -// 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/api_op_SearchDevices.go b/service/braket/api_op_SearchDevices.go index 57aa73b2905..e9d8554adb1 100644 --- a/service/braket/api_op_SearchDevices.go +++ b/service/braket/api_op_SearchDevices.go @@ -4,6 +4,7 @@ package braket import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/braket/types" @@ -116,3 +117,77 @@ func addOperationSearchDevicesMiddlewares(stack *middleware.Stack, options Optio } return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewSearchDevicesPaginator returns a new SearchDevicesPaginator +func NewSearchDevicesPaginator(client SearchDevicesAPIClient, params *SearchDevicesInput, optFns ...func(*SearchDevicesPaginatorOptions)) *SearchDevicesPaginator { + options := SearchDevicesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchDevicesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} diff --git a/service/braket/api_op_SearchQuantumTasks.go b/service/braket/api_op_SearchQuantumTasks.go index dd3779cac62..99c45c26d08 100644 --- a/service/braket/api_op_SearchQuantumTasks.go +++ b/service/braket/api_op_SearchQuantumTasks.go @@ -4,6 +4,7 @@ package braket import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/braket/types" @@ -116,3 +117,79 @@ func addOperationSearchQuantumTasksMiddlewares(stack *middleware.Stack, options } return nil } + +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewSearchQuantumTasksPaginator returns a new SearchQuantumTasksPaginator +func NewSearchQuantumTasksPaginator(client SearchQuantumTasksAPIClient, params *SearchQuantumTasksInput, optFns ...func(*SearchQuantumTasksPaginatorOptions)) *SearchQuantumTasksPaginator { + options := SearchQuantumTasksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchQuantumTasksInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} diff --git a/service/braket/go.mod b/service/braket/go.mod index 6ddcc5c1bf6..d4242c30a7b 100644 --- a/service/braket/go.mod +++ b/service/braket/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/braket/go.sum b/service/braket/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/braket/go.sum +++ b/service/braket/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 502203db3ad..00000000000 --- a/service/braket/paginators.go +++ /dev/null @@ -1,158 +0,0 @@ -// 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/api_op_DescribeBudgetActionHistories.go b/service/budgets/api_op_DescribeBudgetActionHistories.go index 133b02a785a..9ac0c03fa2e 100644 --- a/service/budgets/api_op_DescribeBudgetActionHistories.go +++ b/service/budgets/api_op_DescribeBudgetActionHistories.go @@ -4,6 +4,7 @@ package budgets import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/budgets/types" @@ -132,6 +133,84 @@ func addOperationDescribeBudgetActionHistoriesMiddlewares(stack *middleware.Stac return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeBudgetActionHistoriesPaginator returns a new +// DescribeBudgetActionHistoriesPaginator +func NewDescribeBudgetActionHistoriesPaginator(client DescribeBudgetActionHistoriesAPIClient, params *DescribeBudgetActionHistoriesInput, optFns ...func(*DescribeBudgetActionHistoriesPaginatorOptions)) *DescribeBudgetActionHistoriesPaginator { + options := DescribeBudgetActionHistoriesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeBudgetActionHistoriesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeBudgetActionHistories(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/budgets/api_op_DescribeBudgetActionsForAccount.go b/service/budgets/api_op_DescribeBudgetActionsForAccount.go index 8f3b3bbd061..3599a572e7b 100644 --- a/service/budgets/api_op_DescribeBudgetActionsForAccount.go +++ b/service/budgets/api_op_DescribeBudgetActionsForAccount.go @@ -4,6 +4,7 @@ package budgets import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/budgets/types" @@ -116,6 +117,84 @@ func addOperationDescribeBudgetActionsForAccountMiddlewares(stack *middleware.St return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeBudgetActionsForAccountPaginator returns a new +// DescribeBudgetActionsForAccountPaginator +func NewDescribeBudgetActionsForAccountPaginator(client DescribeBudgetActionsForAccountAPIClient, params *DescribeBudgetActionsForAccountInput, optFns ...func(*DescribeBudgetActionsForAccountPaginatorOptions)) *DescribeBudgetActionsForAccountPaginator { + options := DescribeBudgetActionsForAccountPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeBudgetActionsForAccountInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeBudgetActionsForAccount(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/budgets/api_op_DescribeBudgetActionsForBudget.go b/service/budgets/api_op_DescribeBudgetActionsForBudget.go index 49d2fa5124e..ea9168085c3 100644 --- a/service/budgets/api_op_DescribeBudgetActionsForBudget.go +++ b/service/budgets/api_op_DescribeBudgetActionsForBudget.go @@ -4,6 +4,7 @@ package budgets import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/budgets/types" @@ -122,6 +123,84 @@ func addOperationDescribeBudgetActionsForBudgetMiddlewares(stack *middleware.Sta return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeBudgetActionsForBudgetPaginator returns a new +// DescribeBudgetActionsForBudgetPaginator +func NewDescribeBudgetActionsForBudgetPaginator(client DescribeBudgetActionsForBudgetAPIClient, params *DescribeBudgetActionsForBudgetInput, optFns ...func(*DescribeBudgetActionsForBudgetPaginatorOptions)) *DescribeBudgetActionsForBudgetPaginator { + options := DescribeBudgetActionsForBudgetPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeBudgetActionsForBudgetInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeBudgetActionsForBudget(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/budgets/api_op_DescribeBudgets.go b/service/budgets/api_op_DescribeBudgets.go index 3a687b19e7f..ed2bc3a76af 100644 --- a/service/budgets/api_op_DescribeBudgets.go +++ b/service/budgets/api_op_DescribeBudgets.go @@ -4,6 +4,7 @@ package budgets import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/budgets/types" @@ -121,6 +122,82 @@ func addOperationDescribeBudgetsMiddlewares(stack *middleware.Stack, options Opt return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeBudgetsPaginator returns a new DescribeBudgetsPaginator +func NewDescribeBudgetsPaginator(client DescribeBudgetsAPIClient, params *DescribeBudgetsInput, optFns ...func(*DescribeBudgetsPaginatorOptions)) *DescribeBudgetsPaginator { + options := DescribeBudgetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeBudgetsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeBudgets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/budgets/api_op_DescribeNotificationsForBudget.go b/service/budgets/api_op_DescribeNotificationsForBudget.go index c1426bbc4b8..a2537563f00 100644 --- a/service/budgets/api_op_DescribeNotificationsForBudget.go +++ b/service/budgets/api_op_DescribeNotificationsForBudget.go @@ -4,6 +4,7 @@ package budgets import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/budgets/types" @@ -124,6 +125,84 @@ func addOperationDescribeNotificationsForBudgetMiddlewares(stack *middleware.Sta return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeNotificationsForBudgetPaginator returns a new +// DescribeNotificationsForBudgetPaginator +func NewDescribeNotificationsForBudgetPaginator(client DescribeNotificationsForBudgetAPIClient, params *DescribeNotificationsForBudgetInput, optFns ...func(*DescribeNotificationsForBudgetPaginatorOptions)) *DescribeNotificationsForBudgetPaginator { + options := DescribeNotificationsForBudgetPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeNotificationsForBudgetInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeNotificationsForBudget(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/budgets/api_op_DescribeSubscribersForNotification.go b/service/budgets/api_op_DescribeSubscribersForNotification.go index 94349f5abb0..16e3fc85074 100644 --- a/service/budgets/api_op_DescribeSubscribersForNotification.go +++ b/service/budgets/api_op_DescribeSubscribersForNotification.go @@ -4,6 +4,7 @@ package budgets import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/budgets/types" @@ -129,6 +130,84 @@ func addOperationDescribeSubscribersForNotificationMiddlewares(stack *middleware return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeSubscribersForNotificationPaginator returns a new +// DescribeSubscribersForNotificationPaginator +func NewDescribeSubscribersForNotificationPaginator(client DescribeSubscribersForNotificationAPIClient, params *DescribeSubscribersForNotificationInput, optFns ...func(*DescribeSubscribersForNotificationPaginatorOptions)) *DescribeSubscribersForNotificationPaginator { + options := DescribeSubscribersForNotificationPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeSubscribersForNotificationInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeSubscribersForNotification(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/budgets/go.mod b/service/budgets/go.mod index 81e7d2c948b..a7bee65651d 100644 --- a/service/budgets/go.mod +++ b/service/budgets/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/budgets/go.sum b/service/budgets/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/budgets/go.sum +++ b/service/budgets/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index a1ea9d83003..00000000000 --- a/service/budgets/paginators.go +++ /dev/null @@ -1,474 +0,0 @@ -// 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/api_op_ListAccounts.go b/service/chime/api_op_ListAccounts.go index 8fbece0e1b4..42419bb0f81 100644 --- a/service/chime/api_op_ListAccounts.go +++ b/service/chime/api_op_ListAccounts.go @@ -4,6 +4,7 @@ package chime import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/chime/types" @@ -114,6 +115,80 @@ func addOperationListAccountsMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAccountsPaginator returns a new ListAccountsPaginator +func NewListAccountsPaginator(client ListAccountsAPIClient, params *ListAccountsInput, optFns ...func(*ListAccountsPaginatorOptions)) *ListAccountsPaginator { + options := ListAccountsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAccountsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAccounts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/chime/api_op_ListAttendees.go b/service/chime/api_op_ListAttendees.go index 222d3b04a7f..e579093dc5f 100644 --- a/service/chime/api_op_ListAttendees.go +++ b/service/chime/api_op_ListAttendees.go @@ -4,6 +4,7 @@ package chime import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/chime/types" @@ -116,6 +117,80 @@ func addOperationListAttendeesMiddlewares(stack *middleware.Stack, options Optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAttendeesPaginator returns a new ListAttendeesPaginator +func NewListAttendeesPaginator(client ListAttendeesAPIClient, params *ListAttendeesInput, optFns ...func(*ListAttendeesPaginatorOptions)) *ListAttendeesPaginator { + options := ListAttendeesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAttendeesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAttendees(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/chime/api_op_ListBots.go b/service/chime/api_op_ListBots.go index cad80284924..3613c54f4e4 100644 --- a/service/chime/api_op_ListBots.go +++ b/service/chime/api_op_ListBots.go @@ -4,6 +4,7 @@ package chime import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/chime/types" @@ -114,6 +115,80 @@ func addOperationListBotsMiddlewares(stack *middleware.Stack, options Options) ( return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListBotsPaginator returns a new ListBotsPaginator +func NewListBotsPaginator(client ListBotsAPIClient, params *ListBotsInput, optFns ...func(*ListBotsPaginatorOptions)) *ListBotsPaginator { + options := ListBotsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListBotsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListBots(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/chime/api_op_ListMeetings.go b/service/chime/api_op_ListMeetings.go index 7fc36ed390b..b4da57d9aaa 100644 --- a/service/chime/api_op_ListMeetings.go +++ b/service/chime/api_op_ListMeetings.go @@ -4,6 +4,7 @@ package chime import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/chime/types" @@ -108,6 +109,80 @@ func addOperationListMeetingsMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListMeetingsPaginator returns a new ListMeetingsPaginator +func NewListMeetingsPaginator(client ListMeetingsAPIClient, params *ListMeetingsInput, optFns ...func(*ListMeetingsPaginatorOptions)) *ListMeetingsPaginator { + options := ListMeetingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListMeetingsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListMeetings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/chime/api_op_ListPhoneNumberOrders.go b/service/chime/api_op_ListPhoneNumberOrders.go index 6bcb3851730..322be6f9b1b 100644 --- a/service/chime/api_op_ListPhoneNumberOrders.go +++ b/service/chime/api_op_ListPhoneNumberOrders.go @@ -4,6 +4,7 @@ package chime import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/chime/types" @@ -105,6 +106,82 @@ func addOperationListPhoneNumberOrdersMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListPhoneNumberOrdersPaginator returns a new ListPhoneNumberOrdersPaginator +func NewListPhoneNumberOrdersPaginator(client ListPhoneNumberOrdersAPIClient, params *ListPhoneNumberOrdersInput, optFns ...func(*ListPhoneNumberOrdersPaginatorOptions)) *ListPhoneNumberOrdersPaginator { + options := ListPhoneNumberOrdersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPhoneNumberOrdersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPhoneNumberOrders(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/chime/api_op_ListPhoneNumbers.go b/service/chime/api_op_ListPhoneNumbers.go index c69c9fc8f42..fc8f11ed956 100644 --- a/service/chime/api_op_ListPhoneNumbers.go +++ b/service/chime/api_op_ListPhoneNumbers.go @@ -4,6 +4,7 @@ package chime import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/chime/types" @@ -118,6 +119,81 @@ func addOperationListPhoneNumbersMiddlewares(stack *middleware.Stack, options Op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListPhoneNumbersPaginator returns a new ListPhoneNumbersPaginator +func NewListPhoneNumbersPaginator(client ListPhoneNumbersAPIClient, params *ListPhoneNumbersInput, optFns ...func(*ListPhoneNumbersPaginatorOptions)) *ListPhoneNumbersPaginator { + options := ListPhoneNumbersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPhoneNumbersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPhoneNumbers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/chime/api_op_ListProxySessions.go b/service/chime/api_op_ListProxySessions.go index e30d4ac98e0..9fbc7116884 100644 --- a/service/chime/api_op_ListProxySessions.go +++ b/service/chime/api_op_ListProxySessions.go @@ -4,6 +4,7 @@ package chime import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/chime/types" @@ -116,6 +117,81 @@ func addOperationListProxySessionsMiddlewares(stack *middleware.Stack, options O return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListProxySessionsPaginator returns a new ListProxySessionsPaginator +func NewListProxySessionsPaginator(client ListProxySessionsAPIClient, params *ListProxySessionsInput, optFns ...func(*ListProxySessionsPaginatorOptions)) *ListProxySessionsPaginator { + options := ListProxySessionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListProxySessionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListProxySessions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/chime/api_op_ListRoomMemberships.go b/service/chime/api_op_ListRoomMemberships.go index 00f4ffa9f1c..4a7c6259eb4 100644 --- a/service/chime/api_op_ListRoomMemberships.go +++ b/service/chime/api_op_ListRoomMemberships.go @@ -4,6 +4,7 @@ package chime import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/chime/types" @@ -119,6 +120,82 @@ func addOperationListRoomMembershipsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListRoomMembershipsPaginator returns a new ListRoomMembershipsPaginator +func NewListRoomMembershipsPaginator(client ListRoomMembershipsAPIClient, params *ListRoomMembershipsInput, optFns ...func(*ListRoomMembershipsPaginatorOptions)) *ListRoomMembershipsPaginator { + options := ListRoomMembershipsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRoomMembershipsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRoomMemberships(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/chime/api_op_ListRooms.go b/service/chime/api_op_ListRooms.go index 3c499c1d18b..911441365db 100644 --- a/service/chime/api_op_ListRooms.go +++ b/service/chime/api_op_ListRooms.go @@ -4,6 +4,7 @@ package chime import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/chime/types" @@ -118,6 +119,80 @@ func addOperationListRoomsMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListRoomsPaginator returns a new ListRoomsPaginator +func NewListRoomsPaginator(client ListRoomsAPIClient, params *ListRoomsInput, optFns ...func(*ListRoomsPaginatorOptions)) *ListRoomsPaginator { + options := ListRoomsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRoomsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRooms(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/chime/api_op_ListUsers.go b/service/chime/api_op_ListUsers.go index 3eede25fa73..9a2f1c7bfcd 100644 --- a/service/chime/api_op_ListUsers.go +++ b/service/chime/api_op_ListUsers.go @@ -4,6 +4,7 @@ package chime import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/chime/types" @@ -121,6 +122,80 @@ func addOperationListUsersMiddlewares(stack *middleware.Stack, options Options) return 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. Defaults to 100. + Limit *int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListUsersPaginator returns a new ListUsersPaginator +func NewListUsersPaginator(client ListUsersAPIClient, params *ListUsersInput, optFns ...func(*ListUsersPaginatorOptions)) *ListUsersPaginator { + options := ListUsersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListUsersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListUsers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/chime/api_op_ListVoiceConnectorGroups.go b/service/chime/api_op_ListVoiceConnectorGroups.go index 4906cac91c2..428a357aaeb 100644 --- a/service/chime/api_op_ListVoiceConnectorGroups.go +++ b/service/chime/api_op_ListVoiceConnectorGroups.go @@ -4,6 +4,7 @@ package chime import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/chime/types" @@ -106,6 +107,83 @@ func addOperationListVoiceConnectorGroupsMiddlewares(stack *middleware.Stack, op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListVoiceConnectorGroupsPaginator returns a new +// ListVoiceConnectorGroupsPaginator +func NewListVoiceConnectorGroupsPaginator(client ListVoiceConnectorGroupsAPIClient, params *ListVoiceConnectorGroupsInput, optFns ...func(*ListVoiceConnectorGroupsPaginatorOptions)) *ListVoiceConnectorGroupsPaginator { + options := ListVoiceConnectorGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListVoiceConnectorGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListVoiceConnectorGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/chime/api_op_ListVoiceConnectors.go b/service/chime/api_op_ListVoiceConnectors.go index e5bf7955b3a..7fb2dc22a8a 100644 --- a/service/chime/api_op_ListVoiceConnectors.go +++ b/service/chime/api_op_ListVoiceConnectors.go @@ -4,6 +4,7 @@ package chime import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/chime/types" @@ -105,6 +106,82 @@ func addOperationListVoiceConnectorsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListVoiceConnectorsPaginator returns a new ListVoiceConnectorsPaginator +func NewListVoiceConnectorsPaginator(client ListVoiceConnectorsAPIClient, params *ListVoiceConnectorsInput, optFns ...func(*ListVoiceConnectorsPaginatorOptions)) *ListVoiceConnectorsPaginator { + options := ListVoiceConnectorsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListVoiceConnectorsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListVoiceConnectors(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/chime/go.mod b/service/chime/go.mod index f2b18aec011..085654c0be6 100644 --- a/service/chime/go.mod +++ b/service/chime/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/chime/go.sum b/service/chime/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/chime/go.sum +++ b/service/chime/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index be50e47a3cc..00000000000 --- a/service/chime/paginators.go +++ /dev/null @@ -1,907 +0,0 @@ -// 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/api_op_DescribeEnvironmentMemberships.go b/service/cloud9/api_op_DescribeEnvironmentMemberships.go index 93f1af5a06c..b46e304de44 100644 --- a/service/cloud9/api_op_DescribeEnvironmentMemberships.go +++ b/service/cloud9/api_op_DescribeEnvironmentMemberships.go @@ -4,6 +4,7 @@ package cloud9 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/cloud9/types" @@ -137,6 +138,83 @@ func addOperationDescribeEnvironmentMembershipsMiddlewares(stack *middleware.Sta return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeEnvironmentMembershipsPaginator returns a new +// DescribeEnvironmentMembershipsPaginator +func NewDescribeEnvironmentMembershipsPaginator(client DescribeEnvironmentMembershipsAPIClient, params *DescribeEnvironmentMembershipsInput, optFns ...func(*DescribeEnvironmentMembershipsPaginatorOptions)) *DescribeEnvironmentMembershipsPaginator { + options := DescribeEnvironmentMembershipsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEnvironmentMembershipsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEnvironmentMemberships(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloud9/api_op_ListEnvironments.go b/service/cloud9/api_op_ListEnvironments.go index 40e9c0e521b..b056567884e 100644 --- a/service/cloud9/api_op_ListEnvironments.go +++ b/service/cloud9/api_op_ListEnvironments.go @@ -4,6 +4,7 @@ package cloud9 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -112,6 +113,81 @@ func addOperationListEnvironmentsMiddlewares(stack *middleware.Stack, options Op return 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 environments to get identifiers for. + Limit *int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListEnvironmentsPaginator returns a new ListEnvironmentsPaginator +func NewListEnvironmentsPaginator(client ListEnvironmentsAPIClient, params *ListEnvironmentsInput, optFns ...func(*ListEnvironmentsPaginatorOptions)) *ListEnvironmentsPaginator { + options := ListEnvironmentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListEnvironmentsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListEnvironments(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloud9/go.mod b/service/cloud9/go.mod index d13e033f74f..7e0649b1116 100644 --- a/service/cloud9/go.mod +++ b/service/cloud9/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/cloud9/go.sum b/service/cloud9/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/cloud9/go.sum +++ b/service/cloud9/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 6951591fd68..00000000000 --- a/service/cloud9/paginators.go +++ /dev/null @@ -1,160 +0,0 @@ -// 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/api_op_ListAppliedSchemaArns.go b/service/clouddirectory/api_op_ListAppliedSchemaArns.go index 0c9c8bb27d3..ac27d6debd2 100644 --- a/service/clouddirectory/api_op_ListAppliedSchemaArns.go +++ b/service/clouddirectory/api_op_ListAppliedSchemaArns.go @@ -4,6 +4,7 @@ package clouddirectory import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -117,6 +118,82 @@ func addOperationListAppliedSchemaArnsMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAppliedSchemaArnsPaginator returns a new ListAppliedSchemaArnsPaginator +func NewListAppliedSchemaArnsPaginator(client ListAppliedSchemaArnsAPIClient, params *ListAppliedSchemaArnsInput, optFns ...func(*ListAppliedSchemaArnsPaginatorOptions)) *ListAppliedSchemaArnsPaginator { + options := ListAppliedSchemaArnsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAppliedSchemaArnsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAppliedSchemaArns(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/clouddirectory/api_op_ListAttachedIndices.go b/service/clouddirectory/api_op_ListAttachedIndices.go index bf16582d117..588fa1c84ec 100644 --- a/service/clouddirectory/api_op_ListAttachedIndices.go +++ b/service/clouddirectory/api_op_ListAttachedIndices.go @@ -4,6 +4,7 @@ package clouddirectory import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/clouddirectory/types" @@ -121,6 +122,82 @@ func addOperationListAttachedIndicesMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAttachedIndicesPaginator returns a new ListAttachedIndicesPaginator +func NewListAttachedIndicesPaginator(client ListAttachedIndicesAPIClient, params *ListAttachedIndicesInput, optFns ...func(*ListAttachedIndicesPaginatorOptions)) *ListAttachedIndicesPaginator { + options := ListAttachedIndicesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAttachedIndicesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAttachedIndices(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/clouddirectory/api_op_ListDevelopmentSchemaArns.go b/service/clouddirectory/api_op_ListDevelopmentSchemaArns.go index 249cd7609dd..5d6d560fc86 100644 --- a/service/clouddirectory/api_op_ListDevelopmentSchemaArns.go +++ b/service/clouddirectory/api_op_ListDevelopmentSchemaArns.go @@ -4,6 +4,7 @@ package clouddirectory import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -104,6 +105,83 @@ func addOperationListDevelopmentSchemaArnsMiddlewares(stack *middleware.Stack, o return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDevelopmentSchemaArnsPaginator returns a new +// ListDevelopmentSchemaArnsPaginator +func NewListDevelopmentSchemaArnsPaginator(client ListDevelopmentSchemaArnsAPIClient, params *ListDevelopmentSchemaArnsInput, optFns ...func(*ListDevelopmentSchemaArnsPaginatorOptions)) *ListDevelopmentSchemaArnsPaginator { + options := ListDevelopmentSchemaArnsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDevelopmentSchemaArnsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDevelopmentSchemaArns(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/clouddirectory/api_op_ListDirectories.go b/service/clouddirectory/api_op_ListDirectories.go index 08debbb481a..42d0ca938ea 100644 --- a/service/clouddirectory/api_op_ListDirectories.go +++ b/service/clouddirectory/api_op_ListDirectories.go @@ -4,6 +4,7 @@ package clouddirectory import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/clouddirectory/types" @@ -112,6 +113,81 @@ func addOperationListDirectoriesMiddlewares(stack *middleware.Stack, options Opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDirectoriesPaginator returns a new ListDirectoriesPaginator +func NewListDirectoriesPaginator(client ListDirectoriesAPIClient, params *ListDirectoriesInput, optFns ...func(*ListDirectoriesPaginatorOptions)) *ListDirectoriesPaginator { + options := ListDirectoriesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDirectoriesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDirectories(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/clouddirectory/api_op_ListFacetAttributes.go b/service/clouddirectory/api_op_ListFacetAttributes.go index 186b0530919..fb5cb32a31e 100644 --- a/service/clouddirectory/api_op_ListFacetAttributes.go +++ b/service/clouddirectory/api_op_ListFacetAttributes.go @@ -4,6 +4,7 @@ package clouddirectory import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/clouddirectory/types" @@ -118,6 +119,82 @@ func addOperationListFacetAttributesMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListFacetAttributesPaginator returns a new ListFacetAttributesPaginator +func NewListFacetAttributesPaginator(client ListFacetAttributesAPIClient, params *ListFacetAttributesInput, optFns ...func(*ListFacetAttributesPaginatorOptions)) *ListFacetAttributesPaginator { + options := ListFacetAttributesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListFacetAttributesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListFacetAttributes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/clouddirectory/api_op_ListFacetNames.go b/service/clouddirectory/api_op_ListFacetNames.go index f861f867aa1..a69a581d238 100644 --- a/service/clouddirectory/api_op_ListFacetNames.go +++ b/service/clouddirectory/api_op_ListFacetNames.go @@ -4,6 +4,7 @@ package clouddirectory import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -112,6 +113,81 @@ func addOperationListFacetNamesMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListFacetNamesPaginator returns a new ListFacetNamesPaginator +func NewListFacetNamesPaginator(client ListFacetNamesAPIClient, params *ListFacetNamesInput, optFns ...func(*ListFacetNamesPaginatorOptions)) *ListFacetNamesPaginator { + options := ListFacetNamesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListFacetNamesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListFacetNames(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/clouddirectory/api_op_ListIndex.go b/service/clouddirectory/api_op_ListIndex.go index 1966ca79754..788c3e5e6f9 100644 --- a/service/clouddirectory/api_op_ListIndex.go +++ b/service/clouddirectory/api_op_ListIndex.go @@ -4,6 +4,7 @@ package clouddirectory import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/clouddirectory/types" @@ -126,6 +127,82 @@ func addOperationListIndexMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListIndexPaginator returns a new ListIndexPaginator +func NewListIndexPaginator(client ListIndexAPIClient, params *ListIndexInput, optFns ...func(*ListIndexPaginatorOptions)) *ListIndexPaginator { + options := ListIndexPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListIndexInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListIndex(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/clouddirectory/api_op_ListManagedSchemaArns.go b/service/clouddirectory/api_op_ListManagedSchemaArns.go index b1b84c528e0..eec7c329e33 100644 --- a/service/clouddirectory/api_op_ListManagedSchemaArns.go +++ b/service/clouddirectory/api_op_ListManagedSchemaArns.go @@ -4,6 +4,7 @@ package clouddirectory import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -110,6 +111,82 @@ func addOperationListManagedSchemaArnsMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListManagedSchemaArnsPaginator returns a new ListManagedSchemaArnsPaginator +func NewListManagedSchemaArnsPaginator(client ListManagedSchemaArnsAPIClient, params *ListManagedSchemaArnsInput, optFns ...func(*ListManagedSchemaArnsPaginatorOptions)) *ListManagedSchemaArnsPaginator { + options := ListManagedSchemaArnsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListManagedSchemaArnsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListManagedSchemaArns(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/clouddirectory/api_op_ListObjectAttributes.go b/service/clouddirectory/api_op_ListObjectAttributes.go index 9626d241804..b4f6753427c 100644 --- a/service/clouddirectory/api_op_ListObjectAttributes.go +++ b/service/clouddirectory/api_op_ListObjectAttributes.go @@ -4,6 +4,7 @@ package clouddirectory import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/clouddirectory/types" @@ -129,6 +130,83 @@ func addOperationListObjectAttributesMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListObjectAttributesPaginator returns a new ListObjectAttributesPaginator +func NewListObjectAttributesPaginator(client ListObjectAttributesAPIClient, params *ListObjectAttributesInput, optFns ...func(*ListObjectAttributesPaginatorOptions)) *ListObjectAttributesPaginator { + options := ListObjectAttributesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListObjectAttributesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListObjectAttributes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/clouddirectory/api_op_ListObjectChildren.go b/service/clouddirectory/api_op_ListObjectChildren.go index 3e20f3953fd..7627ca77ccc 100644 --- a/service/clouddirectory/api_op_ListObjectChildren.go +++ b/service/clouddirectory/api_op_ListObjectChildren.go @@ -4,6 +4,7 @@ package clouddirectory import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/clouddirectory/types" @@ -127,6 +128,83 @@ func addOperationListObjectChildrenMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListObjectChildrenPaginator returns a new ListObjectChildrenPaginator +func NewListObjectChildrenPaginator(client ListObjectChildrenAPIClient, params *ListObjectChildrenInput, optFns ...func(*ListObjectChildrenPaginatorOptions)) *ListObjectChildrenPaginator { + options := ListObjectChildrenPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListObjectChildrenInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListObjectChildren(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/clouddirectory/api_op_ListObjectParentPaths.go b/service/clouddirectory/api_op_ListObjectParentPaths.go index f42d953c997..457f58b3407 100644 --- a/service/clouddirectory/api_op_ListObjectParentPaths.go +++ b/service/clouddirectory/api_op_ListObjectParentPaths.go @@ -4,6 +4,7 @@ package clouddirectory import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/clouddirectory/types" @@ -129,6 +130,83 @@ func addOperationListObjectParentPathsMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListObjectParentPathsPaginator returns a new ListObjectParentPathsPaginator +func NewListObjectParentPathsPaginator(client ListObjectParentPathsAPIClient, params *ListObjectParentPathsInput, optFns ...func(*ListObjectParentPathsPaginatorOptions)) *ListObjectParentPathsPaginator { + options := ListObjectParentPathsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListObjectParentPathsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListObjectParentPaths(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/clouddirectory/api_op_ListObjectParents.go b/service/clouddirectory/api_op_ListObjectParents.go index 24a2071a84a..1f172e76ced 100644 --- a/service/clouddirectory/api_op_ListObjectParents.go +++ b/service/clouddirectory/api_op_ListObjectParents.go @@ -4,6 +4,7 @@ package clouddirectory import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/clouddirectory/types" @@ -134,6 +135,82 @@ func addOperationListObjectParentsMiddlewares(stack *middleware.Stack, options O return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListObjectParentsPaginator returns a new ListObjectParentsPaginator +func NewListObjectParentsPaginator(client ListObjectParentsAPIClient, params *ListObjectParentsInput, optFns ...func(*ListObjectParentsPaginatorOptions)) *ListObjectParentsPaginator { + options := ListObjectParentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListObjectParentsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListObjectParents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/clouddirectory/api_op_ListObjectPolicies.go b/service/clouddirectory/api_op_ListObjectPolicies.go index 737fcebf675..c10ef0241a0 100644 --- a/service/clouddirectory/api_op_ListObjectPolicies.go +++ b/service/clouddirectory/api_op_ListObjectPolicies.go @@ -4,6 +4,7 @@ package clouddirectory import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/clouddirectory/types" @@ -124,6 +125,83 @@ func addOperationListObjectPoliciesMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListObjectPoliciesPaginator returns a new ListObjectPoliciesPaginator +func NewListObjectPoliciesPaginator(client ListObjectPoliciesAPIClient, params *ListObjectPoliciesInput, optFns ...func(*ListObjectPoliciesPaginatorOptions)) *ListObjectPoliciesPaginator { + options := ListObjectPoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListObjectPoliciesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListObjectPolicies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/clouddirectory/api_op_ListPolicyAttachments.go b/service/clouddirectory/api_op_ListPolicyAttachments.go index d1121ec45ee..729d19c792b 100644 --- a/service/clouddirectory/api_op_ListPolicyAttachments.go +++ b/service/clouddirectory/api_op_ListPolicyAttachments.go @@ -4,6 +4,7 @@ package clouddirectory import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/clouddirectory/types" @@ -124,6 +125,83 @@ func addOperationListPolicyAttachmentsMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListPolicyAttachmentsPaginator returns a new ListPolicyAttachmentsPaginator +func NewListPolicyAttachmentsPaginator(client ListPolicyAttachmentsAPIClient, params *ListPolicyAttachmentsInput, optFns ...func(*ListPolicyAttachmentsPaginatorOptions)) *ListPolicyAttachmentsPaginator { + options := ListPolicyAttachmentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPolicyAttachmentsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPolicyAttachments(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/clouddirectory/api_op_ListPublishedSchemaArns.go b/service/clouddirectory/api_op_ListPublishedSchemaArns.go index 2bba9911410..e11f7d84442 100644 --- a/service/clouddirectory/api_op_ListPublishedSchemaArns.go +++ b/service/clouddirectory/api_op_ListPublishedSchemaArns.go @@ -4,6 +4,7 @@ package clouddirectory import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -110,6 +111,83 @@ func addOperationListPublishedSchemaArnsMiddlewares(stack *middleware.Stack, opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListPublishedSchemaArnsPaginator returns a new +// ListPublishedSchemaArnsPaginator +func NewListPublishedSchemaArnsPaginator(client ListPublishedSchemaArnsAPIClient, params *ListPublishedSchemaArnsInput, optFns ...func(*ListPublishedSchemaArnsPaginatorOptions)) *ListPublishedSchemaArnsPaginator { + options := ListPublishedSchemaArnsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPublishedSchemaArnsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPublishedSchemaArns(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/clouddirectory/api_op_ListTagsForResource.go b/service/clouddirectory/api_op_ListTagsForResource.go index 3bf3a1479b3..9aa012aa56f 100644 --- a/service/clouddirectory/api_op_ListTagsForResource.go +++ b/service/clouddirectory/api_op_ListTagsForResource.go @@ -4,6 +4,7 @@ package clouddirectory import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/clouddirectory/types" @@ -119,6 +120,83 @@ func addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator +func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator { + options := ListTagsForResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTagsForResourceInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/clouddirectory/api_op_ListTypedLinkFacetAttributes.go b/service/clouddirectory/api_op_ListTypedLinkFacetAttributes.go index 509f84a50ca..300506dc7d6 100644 --- a/service/clouddirectory/api_op_ListTypedLinkFacetAttributes.go +++ b/service/clouddirectory/api_op_ListTypedLinkFacetAttributes.go @@ -4,6 +4,7 @@ package clouddirectory import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/clouddirectory/types" @@ -121,6 +122,83 @@ func addOperationListTypedLinkFacetAttributesMiddlewares(stack *middleware.Stack return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTypedLinkFacetAttributesPaginator returns a new +// ListTypedLinkFacetAttributesPaginator +func NewListTypedLinkFacetAttributesPaginator(client ListTypedLinkFacetAttributesAPIClient, params *ListTypedLinkFacetAttributesInput, optFns ...func(*ListTypedLinkFacetAttributesPaginatorOptions)) *ListTypedLinkFacetAttributesPaginator { + options := ListTypedLinkFacetAttributesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTypedLinkFacetAttributesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTypedLinkFacetAttributes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/clouddirectory/api_op_ListTypedLinkFacetNames.go b/service/clouddirectory/api_op_ListTypedLinkFacetNames.go index 633fff71db7..0a220e951df 100644 --- a/service/clouddirectory/api_op_ListTypedLinkFacetNames.go +++ b/service/clouddirectory/api_op_ListTypedLinkFacetNames.go @@ -4,6 +4,7 @@ package clouddirectory import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -115,6 +116,83 @@ func addOperationListTypedLinkFacetNamesMiddlewares(stack *middleware.Stack, opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTypedLinkFacetNamesPaginator returns a new +// ListTypedLinkFacetNamesPaginator +func NewListTypedLinkFacetNamesPaginator(client ListTypedLinkFacetNamesAPIClient, params *ListTypedLinkFacetNamesInput, optFns ...func(*ListTypedLinkFacetNamesPaginatorOptions)) *ListTypedLinkFacetNamesPaginator { + options := ListTypedLinkFacetNamesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTypedLinkFacetNamesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTypedLinkFacetNames(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/clouddirectory/api_op_LookupPolicy.go b/service/clouddirectory/api_op_LookupPolicy.go index 3f67879871d..89f483ddb09 100644 --- a/service/clouddirectory/api_op_LookupPolicy.go +++ b/service/clouddirectory/api_op_LookupPolicy.go @@ -4,6 +4,7 @@ package clouddirectory import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/clouddirectory/types" @@ -128,6 +129,81 @@ func addOperationLookupPolicyMiddlewares(stack *middleware.Stack, options Option return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewLookupPolicyPaginator returns a new LookupPolicyPaginator +func NewLookupPolicyPaginator(client LookupPolicyAPIClient, params *LookupPolicyInput, optFns ...func(*LookupPolicyPaginatorOptions)) *LookupPolicyPaginator { + options := LookupPolicyPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &LookupPolicyInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opLookupPolicy(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/clouddirectory/go.mod b/service/clouddirectory/go.mod index 3d2946f3dc3..bf97d1a3ae4 100644 --- a/service/clouddirectory/go.mod +++ b/service/clouddirectory/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/clouddirectory/go.sum b/service/clouddirectory/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/clouddirectory/go.sum +++ b/service/clouddirectory/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 973bc923e10..00000000000 --- a/service/clouddirectory/paginators.go +++ /dev/null @@ -1,1459 +0,0 @@ -// 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/api_op_DescribeAccountLimits.go b/service/cloudformation/api_op_DescribeAccountLimits.go index 68c483eac50..2f6baa368b2 100644 --- a/service/cloudformation/api_op_DescribeAccountLimits.go +++ b/service/cloudformation/api_op_DescribeAccountLimits.go @@ -4,6 +4,7 @@ package cloudformation import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/cloudformation/types" @@ -110,6 +111,78 @@ func addOperationDescribeAccountLimitsMiddlewares(stack *middleware.Stack, optio return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeAccountLimitsPaginator returns a new DescribeAccountLimitsPaginator +func NewDescribeAccountLimitsPaginator(client DescribeAccountLimitsAPIClient, params *DescribeAccountLimitsInput, optFns ...func(*DescribeAccountLimitsPaginatorOptions)) *DescribeAccountLimitsPaginator { + options := DescribeAccountLimitsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeAccountLimitsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeAccountLimits(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudformation/api_op_DescribeStackEvents.go b/service/cloudformation/api_op_DescribeStackEvents.go index 7d9a98419a3..3a2fd4ecbfc 100644 --- a/service/cloudformation/api_op_DescribeStackEvents.go +++ b/service/cloudformation/api_op_DescribeStackEvents.go @@ -4,6 +4,7 @@ package cloudformation import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/cloudformation/types" @@ -122,6 +123,78 @@ func addOperationDescribeStackEventsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeStackEventsPaginator returns a new DescribeStackEventsPaginator +func NewDescribeStackEventsPaginator(client DescribeStackEventsAPIClient, params *DescribeStackEventsInput, optFns ...func(*DescribeStackEventsPaginatorOptions)) *DescribeStackEventsPaginator { + options := DescribeStackEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeStackEventsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeStackEvents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudformation/api_op_DescribeStackResourceDrifts.go b/service/cloudformation/api_op_DescribeStackResourceDrifts.go index a75bf02c826..43e9179c0c9 100644 --- a/service/cloudformation/api_op_DescribeStackResourceDrifts.go +++ b/service/cloudformation/api_op_DescribeStackResourceDrifts.go @@ -4,6 +4,7 @@ package cloudformation import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/cloudformation/types" @@ -155,6 +156,86 @@ func addOperationDescribeStackResourceDriftsMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeStackResourceDriftsPaginator returns a new +// DescribeStackResourceDriftsPaginator +func NewDescribeStackResourceDriftsPaginator(client DescribeStackResourceDriftsAPIClient, params *DescribeStackResourceDriftsInput, optFns ...func(*DescribeStackResourceDriftsPaginatorOptions)) *DescribeStackResourceDriftsPaginator { + options := DescribeStackResourceDriftsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeStackResourceDriftsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeStackResourceDrifts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudformation/api_op_DescribeStacks.go b/service/cloudformation/api_op_DescribeStacks.go index 3b2066f466f..f1ccc740d75 100644 --- a/service/cloudformation/api_op_DescribeStacks.go +++ b/service/cloudformation/api_op_DescribeStacks.go @@ -4,6 +4,7 @@ package cloudformation import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/cloudformation/types" @@ -119,6 +120,77 @@ func addOperationDescribeStacksMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeStacksPaginator returns a new DescribeStacksPaginator +func NewDescribeStacksPaginator(client DescribeStacksAPIClient, params *DescribeStacksInput, optFns ...func(*DescribeStacksPaginatorOptions)) *DescribeStacksPaginator { + options := DescribeStacksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeStacksInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeStacks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudformation/api_op_ListChangeSets.go b/service/cloudformation/api_op_ListChangeSets.go index 2bbe8ab6e2f..70e8956aa02 100644 --- a/service/cloudformation/api_op_ListChangeSets.go +++ b/service/cloudformation/api_op_ListChangeSets.go @@ -4,6 +4,7 @@ package cloudformation import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/cloudformation/types" @@ -118,6 +119,77 @@ func addOperationListChangeSetsMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListChangeSetsPaginator returns a new ListChangeSetsPaginator +func NewListChangeSetsPaginator(client ListChangeSetsAPIClient, params *ListChangeSetsInput, optFns ...func(*ListChangeSetsPaginatorOptions)) *ListChangeSetsPaginator { + options := ListChangeSetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListChangeSetsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListChangeSets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudformation/api_op_ListExports.go b/service/cloudformation/api_op_ListExports.go index cc180030e02..c387b31c90f 100644 --- a/service/cloudformation/api_op_ListExports.go +++ b/service/cloudformation/api_op_ListExports.go @@ -4,6 +4,7 @@ package cloudformation import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/cloudformation/types" @@ -110,6 +111,76 @@ func addOperationListExportsMiddlewares(stack *middleware.Stack, options Options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListExportsPaginator returns a new ListExportsPaginator +func NewListExportsPaginator(client ListExportsAPIClient, params *ListExportsInput, optFns ...func(*ListExportsPaginatorOptions)) *ListExportsPaginator { + options := ListExportsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListExportsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListExports(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudformation/api_op_ListImports.go b/service/cloudformation/api_op_ListImports.go index e8474a60d86..d3408af20f6 100644 --- a/service/cloudformation/api_op_ListImports.go +++ b/service/cloudformation/api_op_ListImports.go @@ -4,6 +4,7 @@ package cloudformation import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -118,6 +119,76 @@ func addOperationListImportsMiddlewares(stack *middleware.Stack, options Options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListImportsPaginator returns a new ListImportsPaginator +func NewListImportsPaginator(client ListImportsAPIClient, params *ListImportsInput, optFns ...func(*ListImportsPaginatorOptions)) *ListImportsPaginator { + options := ListImportsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListImportsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListImports(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudformation/api_op_ListStackInstances.go b/service/cloudformation/api_op_ListStackInstances.go index 2b6b1c0f7f1..213ff926e1d 100644 --- a/service/cloudformation/api_op_ListStackInstances.go +++ b/service/cloudformation/api_op_ListStackInstances.go @@ -4,6 +4,7 @@ package cloudformation import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/cloudformation/types" @@ -136,6 +137,85 @@ func addOperationListStackInstancesMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListStackInstancesPaginator returns a new ListStackInstancesPaginator +func NewListStackInstancesPaginator(client ListStackInstancesAPIClient, params *ListStackInstancesInput, optFns ...func(*ListStackInstancesPaginatorOptions)) *ListStackInstancesPaginator { + options := ListStackInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListStackInstancesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListStackInstances(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudformation/api_op_ListStackResources.go b/service/cloudformation/api_op_ListStackResources.go index 4a7c1f5f554..efe2d9c027b 100644 --- a/service/cloudformation/api_op_ListStackResources.go +++ b/service/cloudformation/api_op_ListStackResources.go @@ -4,6 +4,7 @@ package cloudformation import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/cloudformation/types" @@ -125,6 +126,78 @@ func addOperationListStackResourcesMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListStackResourcesPaginator returns a new ListStackResourcesPaginator +func NewListStackResourcesPaginator(client ListStackResourcesAPIClient, params *ListStackResourcesInput, optFns ...func(*ListStackResourcesPaginatorOptions)) *ListStackResourcesPaginator { + options := ListStackResourcesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListStackResourcesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListStackResources(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudformation/api_op_ListStackSetOperationResults.go b/service/cloudformation/api_op_ListStackSetOperationResults.go index cc0b8a341ee..54c123d98ae 100644 --- a/service/cloudformation/api_op_ListStackSetOperationResults.go +++ b/service/cloudformation/api_op_ListStackSetOperationResults.go @@ -4,6 +4,7 @@ package cloudformation import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/cloudformation/types" @@ -131,6 +132,86 @@ func addOperationListStackSetOperationResultsMiddlewares(stack *middleware.Stack return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListStackSetOperationResultsPaginator returns a new +// ListStackSetOperationResultsPaginator +func NewListStackSetOperationResultsPaginator(client ListStackSetOperationResultsAPIClient, params *ListStackSetOperationResultsInput, optFns ...func(*ListStackSetOperationResultsPaginatorOptions)) *ListStackSetOperationResultsPaginator { + options := ListStackSetOperationResultsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListStackSetOperationResultsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListStackSetOperationResults(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudformation/api_op_ListStackSetOperations.go b/service/cloudformation/api_op_ListStackSetOperations.go index 739c989626e..258b028a8b8 100644 --- a/service/cloudformation/api_op_ListStackSetOperations.go +++ b/service/cloudformation/api_op_ListStackSetOperations.go @@ -4,6 +4,7 @@ package cloudformation import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/cloudformation/types" @@ -125,6 +126,85 @@ func addOperationListStackSetOperationsMiddlewares(stack *middleware.Stack, opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListStackSetOperationsPaginator returns a new ListStackSetOperationsPaginator +func NewListStackSetOperationsPaginator(client ListStackSetOperationsAPIClient, params *ListStackSetOperationsInput, optFns ...func(*ListStackSetOperationsPaginatorOptions)) *ListStackSetOperationsPaginator { + options := ListStackSetOperationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListStackSetOperationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListStackSetOperations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudformation/api_op_ListStackSets.go b/service/cloudformation/api_op_ListStackSets.go index a282ef38d5a..9dea2dbead2 100644 --- a/service/cloudformation/api_op_ListStackSets.go +++ b/service/cloudformation/api_op_ListStackSets.go @@ -4,6 +4,7 @@ package cloudformation import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/cloudformation/types" @@ -119,6 +120,83 @@ func addOperationListStackSetsMiddlewares(stack *middleware.Stack, options Optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListStackSetsPaginator returns a new ListStackSetsPaginator +func NewListStackSetsPaginator(client ListStackSetsAPIClient, params *ListStackSetsInput, optFns ...func(*ListStackSetsPaginatorOptions)) *ListStackSetsPaginator { + options := ListStackSetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListStackSetsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListStackSets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudformation/api_op_ListStacks.go b/service/cloudformation/api_op_ListStacks.go index f8fbd6b2bba..5aefed8007f 100644 --- a/service/cloudformation/api_op_ListStacks.go +++ b/service/cloudformation/api_op_ListStacks.go @@ -4,6 +4,7 @@ package cloudformation import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/cloudformation/types" @@ -115,6 +116,76 @@ func addOperationListStacksMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListStacksPaginator returns a new ListStacksPaginator +func NewListStacksPaginator(client ListStacksAPIClient, params *ListStacksInput, optFns ...func(*ListStacksPaginatorOptions)) *ListStacksPaginator { + options := ListStacksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListStacksInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListStacks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudformation/api_op_ListTypeRegistrations.go b/service/cloudformation/api_op_ListTypeRegistrations.go index 01fb38eb66a..af7f1446b9b 100644 --- a/service/cloudformation/api_op_ListTypeRegistrations.go +++ b/service/cloudformation/api_op_ListTypeRegistrations.go @@ -4,6 +4,7 @@ package cloudformation import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/cloudformation/types" @@ -131,6 +132,85 @@ func addOperationListTypeRegistrationsMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTypeRegistrationsPaginator returns a new ListTypeRegistrationsPaginator +func NewListTypeRegistrationsPaginator(client ListTypeRegistrationsAPIClient, params *ListTypeRegistrationsInput, optFns ...func(*ListTypeRegistrationsPaginatorOptions)) *ListTypeRegistrationsPaginator { + options := ListTypeRegistrationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTypeRegistrationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTypeRegistrations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudformation/api_op_ListTypeVersions.go b/service/cloudformation/api_op_ListTypeVersions.go index 5834e90949b..024995e8c77 100644 --- a/service/cloudformation/api_op_ListTypeVersions.go +++ b/service/cloudformation/api_op_ListTypeVersions.go @@ -4,6 +4,7 @@ package cloudformation import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/cloudformation/types" @@ -142,6 +143,84 @@ func addOperationListTypeVersionsMiddlewares(stack *middleware.Stack, options Op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTypeVersionsPaginator returns a new ListTypeVersionsPaginator +func NewListTypeVersionsPaginator(client ListTypeVersionsAPIClient, params *ListTypeVersionsInput, optFns ...func(*ListTypeVersionsPaginatorOptions)) *ListTypeVersionsPaginator { + options := ListTypeVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTypeVersionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTypeVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudformation/api_op_ListTypes.go b/service/cloudformation/api_op_ListTypes.go index 94890f94bb2..2526877559f 100644 --- a/service/cloudformation/api_op_ListTypes.go +++ b/service/cloudformation/api_op_ListTypes.go @@ -4,6 +4,7 @@ package cloudformation import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/cloudformation/types" @@ -156,6 +157,83 @@ func addOperationListTypesMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTypesPaginator returns a new ListTypesPaginator +func NewListTypesPaginator(client ListTypesAPIClient, params *ListTypesInput, optFns ...func(*ListTypesPaginatorOptions)) *ListTypesPaginator { + options := ListTypesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTypesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTypes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudformation/go.mod b/service/cloudformation/go.mod index fc96c9ac248..49e8447b490 100644 --- a/service/cloudformation/go.mod +++ b/service/cloudformation/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/cloudformation/go.sum b/service/cloudformation/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/cloudformation/go.sum +++ b/service/cloudformation/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 9da90dcfd33..00000000000 --- a/service/cloudformation/paginators.go +++ /dev/null @@ -1,1205 +0,0 @@ -// 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.mod b/service/cloudfront/go.mod index c5807bdba49..ac7a27a6812 100644 --- a/service/cloudfront/go.mod +++ b/service/cloudfront/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/cloudfront/go.sum b/service/cloudfront/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/cloudfront/go.sum +++ b/service/cloudfront/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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.mod b/service/cloudhsm/go.mod index 4b4373130fd..7f6471a6061 100644 --- a/service/cloudhsm/go.mod +++ b/service/cloudhsm/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/cloudhsm/go.sum b/service/cloudhsm/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/cloudhsm/go.sum +++ b/service/cloudhsm/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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/api_op_DescribeBackups.go b/service/cloudhsmv2/api_op_DescribeBackups.go index 4c639a7aa55..bf93d047afc 100644 --- a/service/cloudhsmv2/api_op_DescribeBackups.go +++ b/service/cloudhsmv2/api_op_DescribeBackups.go @@ -4,6 +4,7 @@ package cloudhsmv2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/cloudhsmv2/types" @@ -128,6 +129,82 @@ func addOperationDescribeBackupsMiddlewares(stack *middleware.Stack, options Opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeBackupsPaginator returns a new DescribeBackupsPaginator +func NewDescribeBackupsPaginator(client DescribeBackupsAPIClient, params *DescribeBackupsInput, optFns ...func(*DescribeBackupsPaginatorOptions)) *DescribeBackupsPaginator { + options := DescribeBackupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeBackupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeBackups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudhsmv2/api_op_DescribeClusters.go b/service/cloudhsmv2/api_op_DescribeClusters.go index b5b2d1f636d..59f71363270 100644 --- a/service/cloudhsmv2/api_op_DescribeClusters.go +++ b/service/cloudhsmv2/api_op_DescribeClusters.go @@ -4,6 +4,7 @@ package cloudhsmv2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/cloudhsmv2/types" @@ -122,6 +123,82 @@ func addOperationDescribeClustersMiddlewares(stack *middleware.Stack, options Op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeClustersPaginator returns a new DescribeClustersPaginator +func NewDescribeClustersPaginator(client DescribeClustersAPIClient, params *DescribeClustersInput, optFns ...func(*DescribeClustersPaginatorOptions)) *DescribeClustersPaginator { + options := DescribeClustersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeClustersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeClusters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudhsmv2/api_op_ListTags.go b/service/cloudhsmv2/api_op_ListTags.go index a2a45801394..a73e32723af 100644 --- a/service/cloudhsmv2/api_op_ListTags.go +++ b/service/cloudhsmv2/api_op_ListTags.go @@ -4,6 +4,7 @@ package cloudhsmv2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/cloudhsmv2/types" @@ -124,6 +125,81 @@ func addOperationListTagsMiddlewares(stack *middleware.Stack, options Options) ( return 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 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTagsPaginator returns a new ListTagsPaginator +func NewListTagsPaginator(client ListTagsAPIClient, params *ListTagsInput, optFns ...func(*ListTagsPaginatorOptions)) *ListTagsPaginator { + options := ListTagsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTagsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTags(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudhsmv2/go.mod b/service/cloudhsmv2/go.mod index 750f4143ccb..7df47d6d461 100644 --- a/service/cloudhsmv2/go.mod +++ b/service/cloudhsmv2/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/cloudhsmv2/go.sum b/service/cloudhsmv2/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/cloudhsmv2/go.sum +++ b/service/cloudhsmv2/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index cc72f356dbf..00000000000 --- a/service/cloudhsmv2/paginators.go +++ /dev/null @@ -1,235 +0,0 @@ -// 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.mod b/service/cloudsearch/go.mod index 93bf8d999bc..e09af2e4044 100644 --- a/service/cloudsearch/go.mod +++ b/service/cloudsearch/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/cloudsearch/go.sum b/service/cloudsearch/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/cloudsearch/go.sum +++ b/service/cloudsearch/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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.mod b/service/cloudsearchdomain/go.mod index 6c49a89461f..1e5a5c6e036 100644 --- a/service/cloudsearchdomain/go.mod +++ b/service/cloudsearchdomain/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/cloudsearchdomain/go.sum b/service/cloudsearchdomain/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/cloudsearchdomain/go.sum +++ b/service/cloudsearchdomain/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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/api_op_ListPublicKeys.go b/service/cloudtrail/api_op_ListPublicKeys.go index 869c3d3db2a..f1ddbf3ace2 100644 --- a/service/cloudtrail/api_op_ListPublicKeys.go +++ b/service/cloudtrail/api_op_ListPublicKeys.go @@ -4,6 +4,7 @@ package cloudtrail import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/cloudtrail/types" @@ -122,6 +123,77 @@ func addOperationListPublicKeysMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListPublicKeysPaginator returns a new ListPublicKeysPaginator +func NewListPublicKeysPaginator(client ListPublicKeysAPIClient, params *ListPublicKeysInput, optFns ...func(*ListPublicKeysPaginatorOptions)) *ListPublicKeysPaginator { + options := ListPublicKeysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPublicKeysInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPublicKeys(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudtrail/api_op_ListTags.go b/service/cloudtrail/api_op_ListTags.go index cd97e1ffcc5..ed986dc98f7 100644 --- a/service/cloudtrail/api_op_ListTags.go +++ b/service/cloudtrail/api_op_ListTags.go @@ -4,6 +4,7 @@ package cloudtrail import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/cloudtrail/types" @@ -115,6 +116,76 @@ func addOperationListTagsMiddlewares(stack *middleware.Stack, options Options) ( return 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 { + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTagsPaginator returns a new ListTagsPaginator +func NewListTagsPaginator(client ListTagsAPIClient, params *ListTagsInput, optFns ...func(*ListTagsPaginatorOptions)) *ListTagsPaginator { + options := ListTagsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTagsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTags(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudtrail/api_op_ListTrails.go b/service/cloudtrail/api_op_ListTrails.go index 3ac7cbf274f..d12a0d7908c 100644 --- a/service/cloudtrail/api_op_ListTrails.go +++ b/service/cloudtrail/api_op_ListTrails.go @@ -4,6 +4,7 @@ package cloudtrail import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/cloudtrail/types" @@ -110,6 +111,76 @@ func addOperationListTrailsMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTrailsPaginator returns a new ListTrailsPaginator +func NewListTrailsPaginator(client ListTrailsAPIClient, params *ListTrailsInput, optFns ...func(*ListTrailsPaginatorOptions)) *ListTrailsPaginator { + options := ListTrailsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTrailsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTrails(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudtrail/api_op_LookupEvents.go b/service/cloudtrail/api_op_LookupEvents.go index baf699cee68..f17ce53c283 100644 --- a/service/cloudtrail/api_op_LookupEvents.go +++ b/service/cloudtrail/api_op_LookupEvents.go @@ -4,6 +4,7 @@ package cloudtrail import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/cloudtrail/types" @@ -180,6 +181,81 @@ func addOperationLookupEventsMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewLookupEventsPaginator returns a new LookupEventsPaginator +func NewLookupEventsPaginator(client LookupEventsAPIClient, params *LookupEventsInput, optFns ...func(*LookupEventsPaginatorOptions)) *LookupEventsPaginator { + options := LookupEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &LookupEventsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opLookupEvents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudtrail/go.mod b/service/cloudtrail/go.mod index dcbba302987..f0df865dc42 100644 --- a/service/cloudtrail/go.mod +++ b/service/cloudtrail/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/cloudtrail/go.sum b/service/cloudtrail/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/cloudtrail/go.sum +++ b/service/cloudtrail/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index ffba3825ed4..00000000000 --- a/service/cloudtrail/paginators.go +++ /dev/null @@ -1,294 +0,0 @@ -// 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/api_op_DescribeAlarmHistory.go b/service/cloudwatch/api_op_DescribeAlarmHistory.go index c2174a8405e..623f3ec27c6 100644 --- a/service/cloudwatch/api_op_DescribeAlarmHistory.go +++ b/service/cloudwatch/api_op_DescribeAlarmHistory.go @@ -4,6 +4,7 @@ package cloudwatch import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/cloudwatch/types" @@ -132,6 +133,82 @@ func addOperationDescribeAlarmHistoryMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeAlarmHistoryPaginator returns a new DescribeAlarmHistoryPaginator +func NewDescribeAlarmHistoryPaginator(client DescribeAlarmHistoryAPIClient, params *DescribeAlarmHistoryInput, optFns ...func(*DescribeAlarmHistoryPaginatorOptions)) *DescribeAlarmHistoryPaginator { + options := DescribeAlarmHistoryPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeAlarmHistoryInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeAlarmHistory(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudwatch/api_op_DescribeAlarms.go b/service/cloudwatch/api_op_DescribeAlarms.go index 96b8f8b11ea..f43065ba8d7 100644 --- a/service/cloudwatch/api_op_DescribeAlarms.go +++ b/service/cloudwatch/api_op_DescribeAlarms.go @@ -4,6 +4,7 @@ package cloudwatch import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/cloudwatch/types" @@ -159,6 +160,81 @@ func addOperationDescribeAlarmsMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeAlarmsPaginator returns a new DescribeAlarmsPaginator +func NewDescribeAlarmsPaginator(client DescribeAlarmsAPIClient, params *DescribeAlarmsInput, optFns ...func(*DescribeAlarmsPaginatorOptions)) *DescribeAlarmsPaginator { + options := DescribeAlarmsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeAlarmsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeAlarms(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudwatch/api_op_DescribeInsightRules.go b/service/cloudwatch/api_op_DescribeInsightRules.go index 58dbce90d4a..67e64a7d7f8 100644 --- a/service/cloudwatch/api_op_DescribeInsightRules.go +++ b/service/cloudwatch/api_op_DescribeInsightRules.go @@ -4,6 +4,7 @@ package cloudwatch import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/cloudwatch/types" @@ -110,6 +111,83 @@ func addOperationDescribeInsightRulesMiddlewares(stack *middleware.Stack, option return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeInsightRulesPaginator returns a new DescribeInsightRulesPaginator +func NewDescribeInsightRulesPaginator(client DescribeInsightRulesAPIClient, params *DescribeInsightRulesInput, optFns ...func(*DescribeInsightRulesPaginatorOptions)) *DescribeInsightRulesPaginator { + options := DescribeInsightRulesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeInsightRulesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeInsightRules(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudwatch/api_op_GetMetricData.go b/service/cloudwatch/api_op_GetMetricData.go index b4d75fbbb98..42b63acf497 100644 --- a/service/cloudwatch/api_op_GetMetricData.go +++ b/service/cloudwatch/api_op_GetMetricData.go @@ -4,6 +4,7 @@ package cloudwatch import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/cloudwatch/types" @@ -215,6 +216,81 @@ func addOperationGetMetricDataMiddlewares(stack *middleware.Stack, options Optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetMetricDataPaginator returns a new GetMetricDataPaginator +func NewGetMetricDataPaginator(client GetMetricDataAPIClient, params *GetMetricDataInput, optFns ...func(*GetMetricDataPaginatorOptions)) *GetMetricDataPaginator { + options := GetMetricDataPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetMetricDataInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetMetricData(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudwatch/api_op_ListDashboards.go b/service/cloudwatch/api_op_ListDashboards.go index d0dfac7c805..6eec0f34f75 100644 --- a/service/cloudwatch/api_op_ListDashboards.go +++ b/service/cloudwatch/api_op_ListDashboards.go @@ -4,6 +4,7 @@ package cloudwatch import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/cloudwatch/types" @@ -113,6 +114,77 @@ func addOperationListDashboardsMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDashboardsPaginator returns a new ListDashboardsPaginator +func NewListDashboardsPaginator(client ListDashboardsAPIClient, params *ListDashboardsInput, optFns ...func(*ListDashboardsPaginatorOptions)) *ListDashboardsPaginator { + options := ListDashboardsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDashboardsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDashboards(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudwatch/api_op_ListMetrics.go b/service/cloudwatch/api_op_ListMetrics.go index d58a87c31d0..3fc220ed619 100644 --- a/service/cloudwatch/api_op_ListMetrics.go +++ b/service/cloudwatch/api_op_ListMetrics.go @@ -4,6 +4,7 @@ package cloudwatch import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/cloudwatch/types" @@ -139,6 +140,76 @@ func addOperationListMetricsMiddlewares(stack *middleware.Stack, options Options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListMetricsPaginator returns a new ListMetricsPaginator +func NewListMetricsPaginator(client ListMetricsAPIClient, params *ListMetricsInput, optFns ...func(*ListMetricsPaginatorOptions)) *ListMetricsPaginator { + options := ListMetricsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListMetricsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListMetrics(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudwatch/go.mod b/service/cloudwatch/go.mod index 524ff217096..051a88b1d2a 100644 --- a/service/cloudwatch/go.mod +++ b/service/cloudwatch/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/cloudwatch/go.sum b/service/cloudwatch/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/cloudwatch/go.sum +++ b/service/cloudwatch/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 7333973ca8d..00000000000 --- a/service/cloudwatch/paginators.go +++ /dev/null @@ -1,452 +0,0 @@ -// 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.mod b/service/cloudwatchevents/go.mod index 81ac99f512a..e503a1ced29 100644 --- a/service/cloudwatchevents/go.mod +++ b/service/cloudwatchevents/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/cloudwatchevents/go.sum b/service/cloudwatchevents/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/cloudwatchevents/go.sum +++ b/service/cloudwatchevents/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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/api_op_DescribeDestinations.go b/service/cloudwatchlogs/api_op_DescribeDestinations.go index c6a95f1a007..2b71b156577 100644 --- a/service/cloudwatchlogs/api_op_DescribeDestinations.go +++ b/service/cloudwatchlogs/api_op_DescribeDestinations.go @@ -4,6 +4,7 @@ package cloudwatchlogs import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/types" @@ -110,6 +111,83 @@ func addOperationDescribeDestinationsMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeDestinationsPaginator returns a new DescribeDestinationsPaginator +func NewDescribeDestinationsPaginator(client DescribeDestinationsAPIClient, params *DescribeDestinationsInput, optFns ...func(*DescribeDestinationsPaginatorOptions)) *DescribeDestinationsPaginator { + options := DescribeDestinationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDestinationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDestinations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudwatchlogs/api_op_DescribeLogGroups.go b/service/cloudwatchlogs/api_op_DescribeLogGroups.go index cc3af7e82b9..3328968bbcf 100644 --- a/service/cloudwatchlogs/api_op_DescribeLogGroups.go +++ b/service/cloudwatchlogs/api_op_DescribeLogGroups.go @@ -4,6 +4,7 @@ package cloudwatchlogs import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/types" @@ -112,6 +113,82 @@ func addOperationDescribeLogGroupsMiddlewares(stack *middleware.Stack, options O return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeLogGroupsPaginator returns a new DescribeLogGroupsPaginator +func NewDescribeLogGroupsPaginator(client DescribeLogGroupsAPIClient, params *DescribeLogGroupsInput, optFns ...func(*DescribeLogGroupsPaginatorOptions)) *DescribeLogGroupsPaginator { + options := DescribeLogGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeLogGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeLogGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudwatchlogs/api_op_DescribeLogStreams.go b/service/cloudwatchlogs/api_op_DescribeLogStreams.go index 44c104f5357..3403c044c03 100644 --- a/service/cloudwatchlogs/api_op_DescribeLogStreams.go +++ b/service/cloudwatchlogs/api_op_DescribeLogStreams.go @@ -4,6 +4,7 @@ package cloudwatchlogs import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/types" @@ -137,6 +138,83 @@ func addOperationDescribeLogStreamsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeLogStreamsPaginator returns a new DescribeLogStreamsPaginator +func NewDescribeLogStreamsPaginator(client DescribeLogStreamsAPIClient, params *DescribeLogStreamsInput, optFns ...func(*DescribeLogStreamsPaginatorOptions)) *DescribeLogStreamsPaginator { + options := DescribeLogStreamsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeLogStreamsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeLogStreams(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudwatchlogs/api_op_DescribeMetricFilters.go b/service/cloudwatchlogs/api_op_DescribeMetricFilters.go index 86ab0c4ceaf..b0735a842b9 100644 --- a/service/cloudwatchlogs/api_op_DescribeMetricFilters.go +++ b/service/cloudwatchlogs/api_op_DescribeMetricFilters.go @@ -4,6 +4,7 @@ package cloudwatchlogs import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/types" @@ -125,6 +126,83 @@ func addOperationDescribeMetricFiltersMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeMetricFiltersPaginator returns a new DescribeMetricFiltersPaginator +func NewDescribeMetricFiltersPaginator(client DescribeMetricFiltersAPIClient, params *DescribeMetricFiltersInput, optFns ...func(*DescribeMetricFiltersPaginatorOptions)) *DescribeMetricFiltersPaginator { + options := DescribeMetricFiltersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeMetricFiltersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeMetricFilters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudwatchlogs/api_op_DescribeSubscriptionFilters.go b/service/cloudwatchlogs/api_op_DescribeSubscriptionFilters.go index 6ff8e7a5915..77d94a9ce33 100644 --- a/service/cloudwatchlogs/api_op_DescribeSubscriptionFilters.go +++ b/service/cloudwatchlogs/api_op_DescribeSubscriptionFilters.go @@ -4,6 +4,7 @@ package cloudwatchlogs import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/types" @@ -120,6 +121,84 @@ func addOperationDescribeSubscriptionFiltersMiddlewares(stack *middleware.Stack, return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeSubscriptionFiltersPaginator returns a new +// DescribeSubscriptionFiltersPaginator +func NewDescribeSubscriptionFiltersPaginator(client DescribeSubscriptionFiltersAPIClient, params *DescribeSubscriptionFiltersInput, optFns ...func(*DescribeSubscriptionFiltersPaginatorOptions)) *DescribeSubscriptionFiltersPaginator { + options := DescribeSubscriptionFiltersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeSubscriptionFiltersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeSubscriptionFilters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudwatchlogs/api_op_FilterLogEvents.go b/service/cloudwatchlogs/api_op_FilterLogEvents.go index ae418a1b80e..3166bc4ae89 100644 --- a/service/cloudwatchlogs/api_op_FilterLogEvents.go +++ b/service/cloudwatchlogs/api_op_FilterLogEvents.go @@ -4,6 +4,7 @@ package cloudwatchlogs import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/types" @@ -166,6 +167,81 @@ func addOperationFilterLogEventsMiddlewares(stack *middleware.Stack, options Opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewFilterLogEventsPaginator returns a new FilterLogEventsPaginator +func NewFilterLogEventsPaginator(client FilterLogEventsAPIClient, params *FilterLogEventsInput, optFns ...func(*FilterLogEventsPaginatorOptions)) *FilterLogEventsPaginator { + options := FilterLogEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &FilterLogEventsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opFilterLogEvents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudwatchlogs/api_op_GetLogEvents.go b/service/cloudwatchlogs/api_op_GetLogEvents.go index c71aa387344..aefb8d7519c 100644 --- a/service/cloudwatchlogs/api_op_GetLogEvents.go +++ b/service/cloudwatchlogs/api_op_GetLogEvents.go @@ -4,6 +4,7 @@ package cloudwatchlogs import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/types" @@ -151,6 +152,82 @@ func addOperationGetLogEventsMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetLogEventsPaginator returns a new GetLogEventsPaginator +func NewGetLogEventsPaginator(client GetLogEventsAPIClient, params *GetLogEventsInput, optFns ...func(*GetLogEventsPaginatorOptions)) *GetLogEventsPaginator { + options := GetLogEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetLogEventsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextForwardToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetLogEvents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudwatchlogs/go.mod b/service/cloudwatchlogs/go.mod index 674d567013e..3e742b90ce3 100644 --- a/service/cloudwatchlogs/go.mod +++ b/service/cloudwatchlogs/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/cloudwatchlogs/go.sum b/service/cloudwatchlogs/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/cloudwatchlogs/go.sum +++ b/service/cloudwatchlogs/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 3dd2f1b1cd3..00000000000 --- a/service/cloudwatchlogs/paginators.go +++ /dev/null @@ -1,544 +0,0 @@ -// 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/api_op_ListDomains.go b/service/codeartifact/api_op_ListDomains.go index f44339c9da9..0a106be6558 100644 --- a/service/codeartifact/api_op_ListDomains.go +++ b/service/codeartifact/api_op_ListDomains.go @@ -4,6 +4,7 @@ package codeartifact import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/codeartifact/types" @@ -112,6 +113,80 @@ func addOperationListDomainsMiddlewares(stack *middleware.Stack, options Options return 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 return per page. + Limit *int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDomainsPaginator returns a new ListDomainsPaginator +func NewListDomainsPaginator(client ListDomainsAPIClient, params *ListDomainsInput, optFns ...func(*ListDomainsPaginatorOptions)) *ListDomainsPaginator { + options := ListDomainsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDomainsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDomains(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codeartifact/api_op_ListPackageVersionAssets.go b/service/codeartifact/api_op_ListPackageVersionAssets.go index 6876d62486a..757e3f96239 100644 --- a/service/codeartifact/api_op_ListPackageVersionAssets.go +++ b/service/codeartifact/api_op_ListPackageVersionAssets.go @@ -4,6 +4,7 @@ package codeartifact import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/codeartifact/types" @@ -191,6 +192,83 @@ func addOperationListPackageVersionAssetsMiddlewares(stack *middleware.Stack, op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListPackageVersionAssetsPaginator returns a new +// ListPackageVersionAssetsPaginator +func NewListPackageVersionAssetsPaginator(client ListPackageVersionAssetsAPIClient, params *ListPackageVersionAssetsInput, optFns ...func(*ListPackageVersionAssetsPaginatorOptions)) *ListPackageVersionAssetsPaginator { + options := ListPackageVersionAssetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPackageVersionAssetsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPackageVersionAssets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codeartifact/api_op_ListPackageVersions.go b/service/codeartifact/api_op_ListPackageVersions.go index 3ef32085749..7bf3043eb55 100644 --- a/service/codeartifact/api_op_ListPackageVersions.go +++ b/service/codeartifact/api_op_ListPackageVersions.go @@ -4,6 +4,7 @@ package codeartifact import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/codeartifact/types" @@ -214,6 +215,82 @@ func addOperationListPackageVersionsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListPackageVersionsPaginator returns a new ListPackageVersionsPaginator +func NewListPackageVersionsPaginator(client ListPackageVersionsAPIClient, params *ListPackageVersionsInput, optFns ...func(*ListPackageVersionsPaginatorOptions)) *ListPackageVersionsPaginator { + options := ListPackageVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPackageVersionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPackageVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codeartifact/api_op_ListPackages.go b/service/codeartifact/api_op_ListPackages.go index 518f71c2acf..80fcdf081a1 100644 --- a/service/codeartifact/api_op_ListPackages.go +++ b/service/codeartifact/api_op_ListPackages.go @@ -4,6 +4,7 @@ package codeartifact import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/codeartifact/types" @@ -157,6 +158,80 @@ func addOperationListPackagesMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListPackagesPaginator returns a new ListPackagesPaginator +func NewListPackagesPaginator(client ListPackagesAPIClient, params *ListPackagesInput, optFns ...func(*ListPackagesPaginatorOptions)) *ListPackagesPaginator { + options := ListPackagesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPackagesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPackages(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codeartifact/api_op_ListRepositories.go b/service/codeartifact/api_op_ListRepositories.go index 45c836438aa..205474fb999 100644 --- a/service/codeartifact/api_op_ListRepositories.go +++ b/service/codeartifact/api_op_ListRepositories.go @@ -4,6 +4,7 @@ package codeartifact import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/codeartifact/types" @@ -115,6 +116,81 @@ func addOperationListRepositoriesMiddlewares(stack *middleware.Stack, options Op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListRepositoriesPaginator returns a new ListRepositoriesPaginator +func NewListRepositoriesPaginator(client ListRepositoriesAPIClient, params *ListRepositoriesInput, optFns ...func(*ListRepositoriesPaginatorOptions)) *ListRepositoriesPaginator { + options := ListRepositoriesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRepositoriesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRepositories(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codeartifact/api_op_ListRepositoriesInDomain.go b/service/codeartifact/api_op_ListRepositoriesInDomain.go index bdb8e91342b..8808f927231 100644 --- a/service/codeartifact/api_op_ListRepositoriesInDomain.go +++ b/service/codeartifact/api_op_ListRepositoriesInDomain.go @@ -4,6 +4,7 @@ package codeartifact import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/codeartifact/types" @@ -129,6 +130,83 @@ func addOperationListRepositoriesInDomainMiddlewares(stack *middleware.Stack, op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListRepositoriesInDomainPaginator returns a new +// ListRepositoriesInDomainPaginator +func NewListRepositoriesInDomainPaginator(client ListRepositoriesInDomainAPIClient, params *ListRepositoriesInDomainInput, optFns ...func(*ListRepositoriesInDomainPaginatorOptions)) *ListRepositoriesInDomainPaginator { + options := ListRepositoriesInDomainPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRepositoriesInDomainInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRepositoriesInDomain(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codeartifact/go.mod b/service/codeartifact/go.mod index e5c43b189c8..ba9c54dbb42 100644 --- a/service/codeartifact/go.mod +++ b/service/codeartifact/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/codeartifact/go.sum b/service/codeartifact/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/codeartifact/go.sum +++ b/service/codeartifact/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 5c50662f4e2..00000000000 --- a/service/codeartifact/paginators.go +++ /dev/null @@ -1,461 +0,0 @@ -// 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/api_op_DescribeCodeCoverages.go b/service/codebuild/api_op_DescribeCodeCoverages.go index 623c49801bd..6e56b4b0b50 100644 --- a/service/codebuild/api_op_DescribeCodeCoverages.go +++ b/service/codebuild/api_op_DescribeCodeCoverages.go @@ -4,6 +4,7 @@ package codebuild import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/codebuild/types" @@ -130,6 +131,82 @@ func addOperationDescribeCodeCoveragesMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeCodeCoveragesPaginator returns a new DescribeCodeCoveragesPaginator +func NewDescribeCodeCoveragesPaginator(client DescribeCodeCoveragesAPIClient, params *DescribeCodeCoveragesInput, optFns ...func(*DescribeCodeCoveragesPaginatorOptions)) *DescribeCodeCoveragesPaginator { + options := DescribeCodeCoveragesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeCodeCoveragesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeCodeCoverages(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codebuild/api_op_DescribeTestCases.go b/service/codebuild/api_op_DescribeTestCases.go index f10f7208927..0b0af788a49 100644 --- a/service/codebuild/api_op_DescribeTestCases.go +++ b/service/codebuild/api_op_DescribeTestCases.go @@ -4,6 +4,7 @@ package codebuild import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/codebuild/types" @@ -128,6 +129,83 @@ func addOperationDescribeTestCasesMiddlewares(stack *middleware.Stack, options O return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeTestCasesPaginator returns a new DescribeTestCasesPaginator +func NewDescribeTestCasesPaginator(client DescribeTestCasesAPIClient, params *DescribeTestCasesInput, optFns ...func(*DescribeTestCasesPaginatorOptions)) *DescribeTestCasesPaginator { + options := DescribeTestCasesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeTestCasesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeTestCases(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codebuild/api_op_ListBuildBatches.go b/service/codebuild/api_op_ListBuildBatches.go index bc6bb11211d..7f014dfd59a 100644 --- a/service/codebuild/api_op_ListBuildBatches.go +++ b/service/codebuild/api_op_ListBuildBatches.go @@ -4,6 +4,7 @@ package codebuild import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/codebuild/types" @@ -120,6 +121,81 @@ func addOperationListBuildBatchesMiddlewares(stack *middleware.Stack, options Op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListBuildBatchesPaginator returns a new ListBuildBatchesPaginator +func NewListBuildBatchesPaginator(client ListBuildBatchesAPIClient, params *ListBuildBatchesInput, optFns ...func(*ListBuildBatchesPaginatorOptions)) *ListBuildBatchesPaginator { + options := ListBuildBatchesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListBuildBatchesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListBuildBatches(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codebuild/api_op_ListBuildBatchesForProject.go b/service/codebuild/api_op_ListBuildBatchesForProject.go index 596ceb1f6c4..48790abac9b 100644 --- a/service/codebuild/api_op_ListBuildBatchesForProject.go +++ b/service/codebuild/api_op_ListBuildBatchesForProject.go @@ -4,6 +4,7 @@ package codebuild import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/codebuild/types" @@ -123,6 +124,83 @@ func addOperationListBuildBatchesForProjectMiddlewares(stack *middleware.Stack, return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListBuildBatchesForProjectPaginator returns a new +// ListBuildBatchesForProjectPaginator +func NewListBuildBatchesForProjectPaginator(client ListBuildBatchesForProjectAPIClient, params *ListBuildBatchesForProjectInput, optFns ...func(*ListBuildBatchesForProjectPaginatorOptions)) *ListBuildBatchesForProjectPaginator { + options := ListBuildBatchesForProjectPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListBuildBatchesForProjectInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListBuildBatchesForProject(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codebuild/api_op_ListBuilds.go b/service/codebuild/api_op_ListBuilds.go index 445b988c6bd..b35cd162b13 100644 --- a/service/codebuild/api_op_ListBuilds.go +++ b/service/codebuild/api_op_ListBuilds.go @@ -4,6 +4,7 @@ package codebuild import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/codebuild/types" @@ -119,6 +120,76 @@ func addOperationListBuildsMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListBuildsPaginator returns a new ListBuildsPaginator +func NewListBuildsPaginator(client ListBuildsAPIClient, params *ListBuildsInput, optFns ...func(*ListBuildsPaginatorOptions)) *ListBuildsPaginator { + options := ListBuildsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListBuildsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListBuilds(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codebuild/api_op_ListBuildsForProject.go b/service/codebuild/api_op_ListBuildsForProject.go index 9d53415f380..bb5fd2f1302 100644 --- a/service/codebuild/api_op_ListBuildsForProject.go +++ b/service/codebuild/api_op_ListBuildsForProject.go @@ -4,6 +4,7 @@ package codebuild import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/codebuild/types" @@ -129,6 +130,78 @@ func addOperationListBuildsForProjectMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListBuildsForProjectPaginator returns a new ListBuildsForProjectPaginator +func NewListBuildsForProjectPaginator(client ListBuildsForProjectAPIClient, params *ListBuildsForProjectInput, optFns ...func(*ListBuildsForProjectPaginatorOptions)) *ListBuildsForProjectPaginator { + options := ListBuildsForProjectPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListBuildsForProjectInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListBuildsForProject(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codebuild/api_op_ListProjects.go b/service/codebuild/api_op_ListProjects.go index 48e6fa9b2d7..e22283fccfa 100644 --- a/service/codebuild/api_op_ListProjects.go +++ b/service/codebuild/api_op_ListProjects.go @@ -4,6 +4,7 @@ package codebuild import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/codebuild/types" @@ -139,6 +140,76 @@ func addOperationListProjectsMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListProjectsPaginator returns a new ListProjectsPaginator +func NewListProjectsPaginator(client ListProjectsAPIClient, params *ListProjectsInput, optFns ...func(*ListProjectsPaginatorOptions)) *ListProjectsPaginator { + options := ListProjectsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListProjectsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListProjects(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codebuild/api_op_ListReportGroups.go b/service/codebuild/api_op_ListReportGroups.go index b270af92180..fcbc837a4d8 100644 --- a/service/codebuild/api_op_ListReportGroups.go +++ b/service/codebuild/api_op_ListReportGroups.go @@ -4,6 +4,7 @@ package codebuild import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/codebuild/types" @@ -133,6 +134,83 @@ func addOperationListReportGroupsMiddlewares(stack *middleware.Stack, options Op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListReportGroupsPaginator returns a new ListReportGroupsPaginator +func NewListReportGroupsPaginator(client ListReportGroupsAPIClient, params *ListReportGroupsInput, optFns ...func(*ListReportGroupsPaginatorOptions)) *ListReportGroupsPaginator { + options := ListReportGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListReportGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListReportGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codebuild/api_op_ListReports.go b/service/codebuild/api_op_ListReports.go index 0a526e7ca4a..c8615fb5f94 100644 --- a/service/codebuild/api_op_ListReports.go +++ b/service/codebuild/api_op_ListReports.go @@ -4,6 +4,7 @@ package codebuild import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/codebuild/types" @@ -129,6 +130,81 @@ func addOperationListReportsMiddlewares(stack *middleware.Stack, options Options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListReportsPaginator returns a new ListReportsPaginator +func NewListReportsPaginator(client ListReportsAPIClient, params *ListReportsInput, optFns ...func(*ListReportsPaginatorOptions)) *ListReportsPaginator { + options := ListReportsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListReportsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListReports(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codebuild/api_op_ListReportsForReportGroup.go b/service/codebuild/api_op_ListReportsForReportGroup.go index d8622dc2819..7d131d44ca0 100644 --- a/service/codebuild/api_op_ListReportsForReportGroup.go +++ b/service/codebuild/api_op_ListReportsForReportGroup.go @@ -4,6 +4,7 @@ package codebuild import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/codebuild/types" @@ -132,6 +133,85 @@ func addOperationListReportsForReportGroupMiddlewares(stack *middleware.Stack, o return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListReportsForReportGroupPaginator returns a new +// ListReportsForReportGroupPaginator +func NewListReportsForReportGroupPaginator(client ListReportsForReportGroupAPIClient, params *ListReportsForReportGroupInput, optFns ...func(*ListReportsForReportGroupPaginatorOptions)) *ListReportsForReportGroupPaginator { + options := ListReportsForReportGroupPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListReportsForReportGroupInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListReportsForReportGroup(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codebuild/api_op_ListSharedProjects.go b/service/codebuild/api_op_ListSharedProjects.go index a2750884314..5b8d5764410 100644 --- a/service/codebuild/api_op_ListSharedProjects.go +++ b/service/codebuild/api_op_ListSharedProjects.go @@ -4,6 +4,7 @@ package codebuild import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/codebuild/types" @@ -136,6 +137,84 @@ func addOperationListSharedProjectsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListSharedProjectsPaginator returns a new ListSharedProjectsPaginator +func NewListSharedProjectsPaginator(client ListSharedProjectsAPIClient, params *ListSharedProjectsInput, optFns ...func(*ListSharedProjectsPaginatorOptions)) *ListSharedProjectsPaginator { + options := ListSharedProjectsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSharedProjectsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSharedProjects(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codebuild/api_op_ListSharedReportGroups.go b/service/codebuild/api_op_ListSharedReportGroups.go index 7f2dbf4c50c..75e1cd7092f 100644 --- a/service/codebuild/api_op_ListSharedReportGroups.go +++ b/service/codebuild/api_op_ListSharedReportGroups.go @@ -4,6 +4,7 @@ package codebuild import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/codebuild/types" @@ -136,6 +137,84 @@ func addOperationListSharedReportGroupsMiddlewares(stack *middleware.Stack, opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListSharedReportGroupsPaginator returns a new ListSharedReportGroupsPaginator +func NewListSharedReportGroupsPaginator(client ListSharedReportGroupsAPIClient, params *ListSharedReportGroupsInput, optFns ...func(*ListSharedReportGroupsPaginatorOptions)) *ListSharedReportGroupsPaginator { + options := ListSharedReportGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSharedReportGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSharedReportGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codebuild/go.mod b/service/codebuild/go.mod index fdef3a83018..e020bb3f5df 100644 --- a/service/codebuild/go.mod +++ b/service/codebuild/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/codebuild/go.sum b/service/codebuild/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/codebuild/go.sum +++ b/service/codebuild/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 96e531d5400..00000000000 --- a/service/codebuild/paginators.go +++ /dev/null @@ -1,912 +0,0 @@ -// 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/api_op_DescribeMergeConflicts.go b/service/codecommit/api_op_DescribeMergeConflicts.go index ebdb1bb2218..19b694a0b73 100644 --- a/service/codecommit/api_op_DescribeMergeConflicts.go +++ b/service/codecommit/api_op_DescribeMergeConflicts.go @@ -4,6 +4,7 @@ package codecommit import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/codecommit/types" @@ -175,6 +176,82 @@ func addOperationDescribeMergeConflictsMiddlewares(stack *middleware.Stack, opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeMergeConflictsPaginator returns a new DescribeMergeConflictsPaginator +func NewDescribeMergeConflictsPaginator(client DescribeMergeConflictsAPIClient, params *DescribeMergeConflictsInput, optFns ...func(*DescribeMergeConflictsPaginatorOptions)) *DescribeMergeConflictsPaginator { + options := DescribeMergeConflictsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeMergeConflictsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeMergeConflicts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codecommit/api_op_DescribePullRequestEvents.go b/service/codecommit/api_op_DescribePullRequestEvents.go index 75435d3db81..37d93fe9d18 100644 --- a/service/codecommit/api_op_DescribePullRequestEvents.go +++ b/service/codecommit/api_op_DescribePullRequestEvents.go @@ -4,6 +4,7 @@ package codecommit import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/codecommit/types" @@ -129,6 +130,85 @@ func addOperationDescribePullRequestEventsMiddlewares(stack *middleware.Stack, o return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribePullRequestEventsPaginator returns a new +// DescribePullRequestEventsPaginator +func NewDescribePullRequestEventsPaginator(client DescribePullRequestEventsAPIClient, params *DescribePullRequestEventsInput, optFns ...func(*DescribePullRequestEventsPaginatorOptions)) *DescribePullRequestEventsPaginator { + options := DescribePullRequestEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribePullRequestEventsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribePullRequestEvents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codecommit/api_op_GetCommentReactions.go b/service/codecommit/api_op_GetCommentReactions.go index 8ae1141f275..b30afed1251 100644 --- a/service/codecommit/api_op_GetCommentReactions.go +++ b/service/codecommit/api_op_GetCommentReactions.go @@ -4,6 +4,7 @@ package codecommit import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/codecommit/types" @@ -123,6 +124,83 @@ func addOperationGetCommentReactionsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetCommentReactionsPaginator returns a new GetCommentReactionsPaginator +func NewGetCommentReactionsPaginator(client GetCommentReactionsAPIClient, params *GetCommentReactionsInput, optFns ...func(*GetCommentReactionsPaginatorOptions)) *GetCommentReactionsPaginator { + options := GetCommentReactionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetCommentReactionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetCommentReactions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codecommit/api_op_GetCommentsForComparedCommit.go b/service/codecommit/api_op_GetCommentsForComparedCommit.go index 61b2547ce3e..66c9c002d5a 100644 --- a/service/codecommit/api_op_GetCommentsForComparedCommit.go +++ b/service/codecommit/api_op_GetCommentsForComparedCommit.go @@ -4,6 +4,7 @@ package codecommit import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/codecommit/types" @@ -129,6 +130,84 @@ func addOperationGetCommentsForComparedCommitMiddlewares(stack *middleware.Stack return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetCommentsForComparedCommitPaginator returns a new +// GetCommentsForComparedCommitPaginator +func NewGetCommentsForComparedCommitPaginator(client GetCommentsForComparedCommitAPIClient, params *GetCommentsForComparedCommitInput, optFns ...func(*GetCommentsForComparedCommitPaginatorOptions)) *GetCommentsForComparedCommitPaginator { + options := GetCommentsForComparedCommitPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetCommentsForComparedCommitInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetCommentsForComparedCommit(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codecommit/api_op_GetCommentsForPullRequest.go b/service/codecommit/api_op_GetCommentsForPullRequest.go index 8abba7b1e39..1cafc15826b 100644 --- a/service/codecommit/api_op_GetCommentsForPullRequest.go +++ b/service/codecommit/api_op_GetCommentsForPullRequest.go @@ -4,6 +4,7 @@ package codecommit import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/codecommit/types" @@ -131,6 +132,85 @@ func addOperationGetCommentsForPullRequestMiddlewares(stack *middleware.Stack, o return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetCommentsForPullRequestPaginator returns a new +// GetCommentsForPullRequestPaginator +func NewGetCommentsForPullRequestPaginator(client GetCommentsForPullRequestAPIClient, params *GetCommentsForPullRequestInput, optFns ...func(*GetCommentsForPullRequestPaginatorOptions)) *GetCommentsForPullRequestPaginator { + options := GetCommentsForPullRequestPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetCommentsForPullRequestInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetCommentsForPullRequest(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codecommit/api_op_GetDifferences.go b/service/codecommit/api_op_GetDifferences.go index ba107230e91..96b07762436 100644 --- a/service/codecommit/api_op_GetDifferences.go +++ b/service/codecommit/api_op_GetDifferences.go @@ -4,6 +4,7 @@ package codecommit import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/codecommit/types" @@ -141,6 +142,81 @@ func addOperationGetDifferencesMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetDifferencesPaginator returns a new GetDifferencesPaginator +func NewGetDifferencesPaginator(client GetDifferencesAPIClient, params *GetDifferencesInput, optFns ...func(*GetDifferencesPaginatorOptions)) *GetDifferencesPaginator { + options := GetDifferencesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetDifferencesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetDifferences(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codecommit/api_op_GetMergeConflicts.go b/service/codecommit/api_op_GetMergeConflicts.go index 89578e9153e..7c64f042b59 100644 --- a/service/codecommit/api_op_GetMergeConflicts.go +++ b/service/codecommit/api_op_GetMergeConflicts.go @@ -4,6 +4,7 @@ package codecommit import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/codecommit/types" @@ -169,6 +170,81 @@ func addOperationGetMergeConflictsMiddlewares(stack *middleware.Stack, options O return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetMergeConflictsPaginator returns a new GetMergeConflictsPaginator +func NewGetMergeConflictsPaginator(client GetMergeConflictsAPIClient, params *GetMergeConflictsInput, optFns ...func(*GetMergeConflictsPaginatorOptions)) *GetMergeConflictsPaginator { + options := GetMergeConflictsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetMergeConflictsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetMergeConflicts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codecommit/api_op_ListApprovalRuleTemplates.go b/service/codecommit/api_op_ListApprovalRuleTemplates.go index 59db6a5e929..60ed3222c16 100644 --- a/service/codecommit/api_op_ListApprovalRuleTemplates.go +++ b/service/codecommit/api_op_ListApprovalRuleTemplates.go @@ -4,6 +4,7 @@ package codecommit import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -109,6 +110,83 @@ func addOperationListApprovalRuleTemplatesMiddlewares(stack *middleware.Stack, o return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListApprovalRuleTemplatesPaginator returns a new +// ListApprovalRuleTemplatesPaginator +func NewListApprovalRuleTemplatesPaginator(client ListApprovalRuleTemplatesAPIClient, params *ListApprovalRuleTemplatesInput, optFns ...func(*ListApprovalRuleTemplatesPaginatorOptions)) *ListApprovalRuleTemplatesPaginator { + options := ListApprovalRuleTemplatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListApprovalRuleTemplatesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListApprovalRuleTemplates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codecommit/api_op_ListAssociatedApprovalRuleTemplatesForRepository.go b/service/codecommit/api_op_ListAssociatedApprovalRuleTemplatesForRepository.go index b5bb2da7024..4695943a195 100644 --- a/service/codecommit/api_op_ListAssociatedApprovalRuleTemplatesForRepository.go +++ b/service/codecommit/api_op_ListAssociatedApprovalRuleTemplatesForRepository.go @@ -4,6 +4,7 @@ package codecommit import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -116,6 +117,84 @@ func addOperationListAssociatedApprovalRuleTemplatesForRepositoryMiddlewares(sta return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAssociatedApprovalRuleTemplatesForRepositoryPaginator returns a new +// ListAssociatedApprovalRuleTemplatesForRepositoryPaginator +func NewListAssociatedApprovalRuleTemplatesForRepositoryPaginator(client ListAssociatedApprovalRuleTemplatesForRepositoryAPIClient, params *ListAssociatedApprovalRuleTemplatesForRepositoryInput, optFns ...func(*ListAssociatedApprovalRuleTemplatesForRepositoryPaginatorOptions)) *ListAssociatedApprovalRuleTemplatesForRepositoryPaginator { + options := ListAssociatedApprovalRuleTemplatesForRepositoryPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAssociatedApprovalRuleTemplatesForRepositoryInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAssociatedApprovalRuleTemplatesForRepository(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codecommit/api_op_ListBranches.go b/service/codecommit/api_op_ListBranches.go index c4fd7253ecf..2dd3a38393e 100644 --- a/service/codecommit/api_op_ListBranches.go +++ b/service/codecommit/api_op_ListBranches.go @@ -4,6 +4,7 @@ package codecommit import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -111,6 +112,76 @@ func addOperationListBranchesMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListBranchesPaginator returns a new ListBranchesPaginator +func NewListBranchesPaginator(client ListBranchesAPIClient, params *ListBranchesInput, optFns ...func(*ListBranchesPaginatorOptions)) *ListBranchesPaginator { + options := ListBranchesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListBranchesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListBranches(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codecommit/api_op_ListPullRequests.go b/service/codecommit/api_op_ListPullRequests.go index b598f142027..5856473a009 100644 --- a/service/codecommit/api_op_ListPullRequests.go +++ b/service/codecommit/api_op_ListPullRequests.go @@ -4,6 +4,7 @@ package codecommit import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/codecommit/types" @@ -127,6 +128,81 @@ func addOperationListPullRequestsMiddlewares(stack *middleware.Stack, options Op return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListPullRequestsPaginator returns a new ListPullRequestsPaginator +func NewListPullRequestsPaginator(client ListPullRequestsAPIClient, params *ListPullRequestsInput, optFns ...func(*ListPullRequestsPaginatorOptions)) *ListPullRequestsPaginator { + options := ListPullRequestsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPullRequestsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPullRequests(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codecommit/api_op_ListRepositories.go b/service/codecommit/api_op_ListRepositories.go index a6d9f2a0508..53efa375055 100644 --- a/service/codecommit/api_op_ListRepositories.go +++ b/service/codecommit/api_op_ListRepositories.go @@ -4,6 +4,7 @@ package codecommit import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/codecommit/types" @@ -116,6 +117,77 @@ func addOperationListRepositoriesMiddlewares(stack *middleware.Stack, options Op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListRepositoriesPaginator returns a new ListRepositoriesPaginator +func NewListRepositoriesPaginator(client ListRepositoriesAPIClient, params *ListRepositoriesInput, optFns ...func(*ListRepositoriesPaginatorOptions)) *ListRepositoriesPaginator { + options := ListRepositoriesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRepositoriesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRepositories(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codecommit/api_op_ListRepositoriesForApprovalRuleTemplate.go b/service/codecommit/api_op_ListRepositoriesForApprovalRuleTemplate.go index ca126fea7e5..6d3219a3724 100644 --- a/service/codecommit/api_op_ListRepositoriesForApprovalRuleTemplate.go +++ b/service/codecommit/api_op_ListRepositoriesForApprovalRuleTemplate.go @@ -4,6 +4,7 @@ package codecommit import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -116,6 +117,83 @@ func addOperationListRepositoriesForApprovalRuleTemplateMiddlewares(stack *middl return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListRepositoriesForApprovalRuleTemplatePaginator returns a new +// ListRepositoriesForApprovalRuleTemplatePaginator +func NewListRepositoriesForApprovalRuleTemplatePaginator(client ListRepositoriesForApprovalRuleTemplateAPIClient, params *ListRepositoriesForApprovalRuleTemplateInput, optFns ...func(*ListRepositoriesForApprovalRuleTemplatePaginatorOptions)) *ListRepositoriesForApprovalRuleTemplatePaginator { + options := ListRepositoriesForApprovalRuleTemplatePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRepositoriesForApprovalRuleTemplateInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRepositoriesForApprovalRuleTemplate(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codecommit/go.mod b/service/codecommit/go.mod index c1644cc356c..134771dd906 100644 --- a/service/codecommit/go.mod +++ b/service/codecommit/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/codecommit/go.sum b/service/codecommit/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/codecommit/go.sum +++ b/service/codecommit/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 2f8a8058c54..00000000000 --- a/service/codecommit/paginators.go +++ /dev/null @@ -1,995 +0,0 @@ -// 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/api_op_ListApplicationRevisions.go b/service/codedeploy/api_op_ListApplicationRevisions.go index acc2a8f4b11..21e18e979d8 100644 --- a/service/codedeploy/api_op_ListApplicationRevisions.go +++ b/service/codedeploy/api_op_ListApplicationRevisions.go @@ -4,6 +4,7 @@ package codedeploy import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/codedeploy/types" @@ -161,6 +162,79 @@ func addOperationListApplicationRevisionsMiddlewares(stack *middleware.Stack, op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListApplicationRevisionsPaginator returns a new +// ListApplicationRevisionsPaginator +func NewListApplicationRevisionsPaginator(client ListApplicationRevisionsAPIClient, params *ListApplicationRevisionsInput, optFns ...func(*ListApplicationRevisionsPaginatorOptions)) *ListApplicationRevisionsPaginator { + options := ListApplicationRevisionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListApplicationRevisionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListApplicationRevisions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codedeploy/api_op_ListApplications.go b/service/codedeploy/api_op_ListApplications.go index b6ff1df25ee..2620098ecf4 100644 --- a/service/codedeploy/api_op_ListApplications.go +++ b/service/codedeploy/api_op_ListApplications.go @@ -4,6 +4,7 @@ package codedeploy import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -106,6 +107,77 @@ func addOperationListApplicationsMiddlewares(stack *middleware.Stack, options Op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListApplicationsPaginator returns a new ListApplicationsPaginator +func NewListApplicationsPaginator(client ListApplicationsAPIClient, params *ListApplicationsInput, optFns ...func(*ListApplicationsPaginatorOptions)) *ListApplicationsPaginator { + options := ListApplicationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListApplicationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListApplications(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codedeploy/api_op_ListDeploymentConfigs.go b/service/codedeploy/api_op_ListDeploymentConfigs.go index d202a1942f1..814e358d168 100644 --- a/service/codedeploy/api_op_ListDeploymentConfigs.go +++ b/service/codedeploy/api_op_ListDeploymentConfigs.go @@ -4,6 +4,7 @@ package codedeploy import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -107,6 +108,78 @@ func addOperationListDeploymentConfigsMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDeploymentConfigsPaginator returns a new ListDeploymentConfigsPaginator +func NewListDeploymentConfigsPaginator(client ListDeploymentConfigsAPIClient, params *ListDeploymentConfigsInput, optFns ...func(*ListDeploymentConfigsPaginatorOptions)) *ListDeploymentConfigsPaginator { + options := ListDeploymentConfigsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDeploymentConfigsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDeploymentConfigs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codedeploy/api_op_ListDeploymentGroups.go b/service/codedeploy/api_op_ListDeploymentGroups.go index b960bdca6a7..103443012c6 100644 --- a/service/codedeploy/api_op_ListDeploymentGroups.go +++ b/service/codedeploy/api_op_ListDeploymentGroups.go @@ -4,6 +4,7 @@ package codedeploy import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -119,6 +120,78 @@ func addOperationListDeploymentGroupsMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDeploymentGroupsPaginator returns a new ListDeploymentGroupsPaginator +func NewListDeploymentGroupsPaginator(client ListDeploymentGroupsAPIClient, params *ListDeploymentGroupsInput, optFns ...func(*ListDeploymentGroupsPaginatorOptions)) *ListDeploymentGroupsPaginator { + options := ListDeploymentGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDeploymentGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDeploymentGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codedeploy/api_op_ListDeploymentInstances.go b/service/codedeploy/api_op_ListDeploymentInstances.go index da9b9b7eac6..a653369f4ae 100644 --- a/service/codedeploy/api_op_ListDeploymentInstances.go +++ b/service/codedeploy/api_op_ListDeploymentInstances.go @@ -4,6 +4,7 @@ package codedeploy import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/codedeploy/types" @@ -143,6 +144,79 @@ func addOperationListDeploymentInstancesMiddlewares(stack *middleware.Stack, opt return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDeploymentInstancesPaginator returns a new +// ListDeploymentInstancesPaginator +func NewListDeploymentInstancesPaginator(client ListDeploymentInstancesAPIClient, params *ListDeploymentInstancesInput, optFns ...func(*ListDeploymentInstancesPaginatorOptions)) *ListDeploymentInstancesPaginator { + options := ListDeploymentInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDeploymentInstancesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDeploymentInstances(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codedeploy/api_op_ListDeployments.go b/service/codedeploy/api_op_ListDeployments.go index 72d0bfb3ae2..77f96ad1c2f 100644 --- a/service/codedeploy/api_op_ListDeployments.go +++ b/service/codedeploy/api_op_ListDeployments.go @@ -4,6 +4,7 @@ package codedeploy import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/codedeploy/types" @@ -146,6 +147,77 @@ func addOperationListDeploymentsMiddlewares(stack *middleware.Stack, options Opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDeploymentsPaginator returns a new ListDeploymentsPaginator +func NewListDeploymentsPaginator(client ListDeploymentsAPIClient, params *ListDeploymentsInput, optFns ...func(*ListDeploymentsPaginatorOptions)) *ListDeploymentsPaginator { + options := ListDeploymentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDeploymentsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDeployments(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codedeploy/go.mod b/service/codedeploy/go.mod index 922cae4b782..d71a6953301 100644 --- a/service/codedeploy/go.mod +++ b/service/codedeploy/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/codedeploy/go.sum b/service/codedeploy/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/codedeploy/go.sum +++ b/service/codedeploy/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index de3370e3fb1..00000000000 --- a/service/codedeploy/paginators.go +++ /dev/null @@ -1,440 +0,0 @@ -// 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/api_op_ListProfileTimes.go b/service/codeguruprofiler/api_op_ListProfileTimes.go index af7950312b6..31a4778efe7 100644 --- a/service/codeguruprofiler/api_op_ListProfileTimes.go +++ b/service/codeguruprofiler/api_op_ListProfileTimes.go @@ -4,6 +4,7 @@ package codeguruprofiler import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/codeguruprofiler/types" @@ -147,3 +148,82 @@ func addOperationListProfileTimesMiddlewares(stack *middleware.Stack, options Op } return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListProfileTimesPaginator returns a new ListProfileTimesPaginator +func NewListProfileTimesPaginator(client ListProfileTimesAPIClient, params *ListProfileTimesInput, optFns ...func(*ListProfileTimesPaginatorOptions)) *ListProfileTimesPaginator { + options := ListProfileTimesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListProfileTimesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} diff --git a/service/codeguruprofiler/api_op_ListProfilingGroups.go b/service/codeguruprofiler/api_op_ListProfilingGroups.go index da621633e70..19a6015d888 100644 --- a/service/codeguruprofiler/api_op_ListProfilingGroups.go +++ b/service/codeguruprofiler/api_op_ListProfilingGroups.go @@ -4,6 +4,7 @@ package codeguruprofiler import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/codeguruprofiler/types" @@ -123,3 +124,83 @@ func addOperationListProfilingGroupsMiddlewares(stack *middleware.Stack, options } return nil } + +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListProfilingGroupsPaginator returns a new ListProfilingGroupsPaginator +func NewListProfilingGroupsPaginator(client ListProfilingGroupsAPIClient, params *ListProfilingGroupsInput, optFns ...func(*ListProfilingGroupsPaginatorOptions)) *ListProfilingGroupsPaginator { + options := ListProfilingGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListProfilingGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} diff --git a/service/codeguruprofiler/go.mod b/service/codeguruprofiler/go.mod index d9a283f0f15..9777973a2a3 100644 --- a/service/codeguruprofiler/go.mod +++ b/service/codeguruprofiler/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/codeguruprofiler/go.sum b/service/codeguruprofiler/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/codeguruprofiler/go.sum +++ b/service/codeguruprofiler/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index f7828ce7f94..00000000000 --- a/service/codeguruprofiler/paginators.go +++ /dev/null @@ -1,167 +0,0 @@ -// 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/api_op_ListCodeReviews.go b/service/codegurureviewer/api_op_ListCodeReviews.go index b52f9779374..f727708d7a0 100644 --- a/service/codegurureviewer/api_op_ListCodeReviews.go +++ b/service/codegurureviewer/api_op_ListCodeReviews.go @@ -4,6 +4,7 @@ package codegurureviewer import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/codegurureviewer/types" @@ -139,6 +140,81 @@ func addOperationListCodeReviewsMiddlewares(stack *middleware.Stack, options Opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListCodeReviewsPaginator returns a new ListCodeReviewsPaginator +func NewListCodeReviewsPaginator(client ListCodeReviewsAPIClient, params *ListCodeReviewsInput, optFns ...func(*ListCodeReviewsPaginatorOptions)) *ListCodeReviewsPaginator { + options := ListCodeReviewsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListCodeReviewsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListCodeReviews(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codegurureviewer/api_op_ListRecommendationFeedback.go b/service/codegurureviewer/api_op_ListRecommendationFeedback.go index 3114d95f18b..032e07da3fb 100644 --- a/service/codegurureviewer/api_op_ListRecommendationFeedback.go +++ b/service/codegurureviewer/api_op_ListRecommendationFeedback.go @@ -4,6 +4,7 @@ package codegurureviewer import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/codegurureviewer/types" @@ -135,6 +136,83 @@ func addOperationListRecommendationFeedbackMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListRecommendationFeedbackPaginator returns a new +// ListRecommendationFeedbackPaginator +func NewListRecommendationFeedbackPaginator(client ListRecommendationFeedbackAPIClient, params *ListRecommendationFeedbackInput, optFns ...func(*ListRecommendationFeedbackPaginatorOptions)) *ListRecommendationFeedbackPaginator { + options := ListRecommendationFeedbackPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRecommendationFeedbackInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRecommendationFeedback(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codegurureviewer/api_op_ListRecommendations.go b/service/codegurureviewer/api_op_ListRecommendations.go index 432c29eb9f2..50179a4ac5a 100644 --- a/service/codegurureviewer/api_op_ListRecommendations.go +++ b/service/codegurureviewer/api_op_ListRecommendations.go @@ -4,6 +4,7 @@ package codegurureviewer import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/codegurureviewer/types" @@ -115,6 +116,82 @@ func addOperationListRecommendationsMiddlewares(stack *middleware.Stack, options return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListRecommendationsPaginator returns a new ListRecommendationsPaginator +func NewListRecommendationsPaginator(client ListRecommendationsAPIClient, params *ListRecommendationsInput, optFns ...func(*ListRecommendationsPaginatorOptions)) *ListRecommendationsPaginator { + options := ListRecommendationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRecommendationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRecommendations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codegurureviewer/api_op_ListRepositoryAssociations.go b/service/codegurureviewer/api_op_ListRepositoryAssociations.go index 06ab2a0ca45..995da26418f 100644 --- a/service/codegurureviewer/api_op_ListRepositoryAssociations.go +++ b/service/codegurureviewer/api_op_ListRepositoryAssociations.go @@ -4,6 +4,7 @@ package codegurureviewer import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/codegurureviewer/types" @@ -168,6 +169,90 @@ func addOperationListRepositoryAssociationsMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListRepositoryAssociationsPaginator returns a new +// ListRepositoryAssociationsPaginator +func NewListRepositoryAssociationsPaginator(client ListRepositoryAssociationsAPIClient, params *ListRepositoryAssociationsInput, optFns ...func(*ListRepositoryAssociationsPaginatorOptions)) *ListRepositoryAssociationsPaginator { + options := ListRepositoryAssociationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRepositoryAssociationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRepositoryAssociations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codegurureviewer/go.mod b/service/codegurureviewer/go.mod index f77ecd9f575..0eb30eb824a 100644 --- a/service/codegurureviewer/go.mod +++ b/service/codegurureviewer/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/codegurureviewer/go.sum b/service/codegurureviewer/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/codegurureviewer/go.sum +++ b/service/codegurureviewer/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 8ad281aa162..00000000000 --- a/service/codegurureviewer/paginators.go +++ /dev/null @@ -1,320 +0,0 @@ -// 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/api_op_ListActionExecutions.go b/service/codepipeline/api_op_ListActionExecutions.go index abf19a39075..5b3d1484708 100644 --- a/service/codepipeline/api_op_ListActionExecutions.go +++ b/service/codepipeline/api_op_ListActionExecutions.go @@ -4,6 +4,7 @@ package codepipeline import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/codepipeline/types" @@ -123,6 +124,86 @@ func addOperationListActionExecutionsMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListActionExecutionsPaginator returns a new ListActionExecutionsPaginator +func NewListActionExecutionsPaginator(client ListActionExecutionsAPIClient, params *ListActionExecutionsInput, optFns ...func(*ListActionExecutionsPaginatorOptions)) *ListActionExecutionsPaginator { + options := ListActionExecutionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListActionExecutionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListActionExecutions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codepipeline/api_op_ListActionTypes.go b/service/codepipeline/api_op_ListActionTypes.go index 9005512f304..5fcf7cb7f22 100644 --- a/service/codepipeline/api_op_ListActionTypes.go +++ b/service/codepipeline/api_op_ListActionTypes.go @@ -4,6 +4,7 @@ package codepipeline import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/codepipeline/types" @@ -113,6 +114,77 @@ func addOperationListActionTypesMiddlewares(stack *middleware.Stack, options Opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListActionTypesPaginator returns a new ListActionTypesPaginator +func NewListActionTypesPaginator(client ListActionTypesAPIClient, params *ListActionTypesInput, optFns ...func(*ListActionTypesPaginatorOptions)) *ListActionTypesPaginator { + options := ListActionTypesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListActionTypesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListActionTypes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codepipeline/api_op_ListPipelineExecutions.go b/service/codepipeline/api_op_ListPipelineExecutions.go index 3925ea8225c..84d690f79d9 100644 --- a/service/codepipeline/api_op_ListPipelineExecutions.go +++ b/service/codepipeline/api_op_ListPipelineExecutions.go @@ -4,6 +4,7 @@ package codepipeline import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/codepipeline/types" @@ -122,6 +123,85 @@ func addOperationListPipelineExecutionsMiddlewares(stack *middleware.Stack, opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListPipelineExecutionsPaginator returns a new ListPipelineExecutionsPaginator +func NewListPipelineExecutionsPaginator(client ListPipelineExecutionsAPIClient, params *ListPipelineExecutionsInput, optFns ...func(*ListPipelineExecutionsPaginatorOptions)) *ListPipelineExecutionsPaginator { + options := ListPipelineExecutionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPipelineExecutionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPipelineExecutions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codepipeline/api_op_ListPipelines.go b/service/codepipeline/api_op_ListPipelines.go index 43c6a1aa380..0e11468a924 100644 --- a/service/codepipeline/api_op_ListPipelines.go +++ b/service/codepipeline/api_op_ListPipelines.go @@ -4,6 +4,7 @@ package codepipeline import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/codepipeline/types" @@ -107,6 +108,76 @@ func addOperationListPipelinesMiddlewares(stack *middleware.Stack, options Optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListPipelinesPaginator returns a new ListPipelinesPaginator +func NewListPipelinesPaginator(client ListPipelinesAPIClient, params *ListPipelinesInput, optFns ...func(*ListPipelinesPaginatorOptions)) *ListPipelinesPaginator { + options := ListPipelinesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPipelinesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPipelines(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codepipeline/api_op_ListTagsForResource.go b/service/codepipeline/api_op_ListTagsForResource.go index e5bbb4c4efc..173088698ee 100644 --- a/service/codepipeline/api_op_ListTagsForResource.go +++ b/service/codepipeline/api_op_ListTagsForResource.go @@ -4,6 +4,7 @@ package codepipeline import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/codepipeline/types" @@ -118,6 +119,82 @@ func addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator +func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator { + options := ListTagsForResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTagsForResourceInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codepipeline/api_op_ListWebhooks.go b/service/codepipeline/api_op_ListWebhooks.go index bbd317df840..0f58e57ac66 100644 --- a/service/codepipeline/api_op_ListWebhooks.go +++ b/service/codepipeline/api_op_ListWebhooks.go @@ -4,6 +4,7 @@ package codepipeline import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/codepipeline/types" @@ -112,6 +113,81 @@ func addOperationListWebhooksMiddlewares(stack *middleware.Stack, options Option return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListWebhooksPaginator returns a new ListWebhooksPaginator +func NewListWebhooksPaginator(client ListWebhooksAPIClient, params *ListWebhooksInput, optFns ...func(*ListWebhooksPaginatorOptions)) *ListWebhooksPaginator { + options := ListWebhooksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListWebhooksInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListWebhooks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codepipeline/go.mod b/service/codepipeline/go.mod index 56d7124792d..291ae1a2d2d 100644 --- a/service/codepipeline/go.mod +++ b/service/codepipeline/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/codepipeline/go.sum b/service/codepipeline/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/codepipeline/go.sum +++ b/service/codepipeline/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index dda72931a26..00000000000 --- a/service/codepipeline/paginators.go +++ /dev/null @@ -1,459 +0,0 @@ -// 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.mod b/service/codestar/go.mod index a7909a77d14..abd02e84c72 100644 --- a/service/codestar/go.mod +++ b/service/codestar/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/codestar/go.sum b/service/codestar/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/codestar/go.sum +++ b/service/codestar/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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/api_op_ListConnections.go b/service/codestarconnections/api_op_ListConnections.go index 6d04415ce62..69e56583ca2 100644 --- a/service/codestarconnections/api_op_ListConnections.go +++ b/service/codestarconnections/api_op_ListConnections.go @@ -4,6 +4,7 @@ package codestarconnections import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/codestarconnections/types" @@ -117,6 +118,82 @@ func addOperationListConnectionsMiddlewares(stack *middleware.Stack, options Opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListConnectionsPaginator returns a new ListConnectionsPaginator +func NewListConnectionsPaginator(client ListConnectionsAPIClient, params *ListConnectionsInput, optFns ...func(*ListConnectionsPaginatorOptions)) *ListConnectionsPaginator { + options := ListConnectionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListConnectionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListConnections(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codestarconnections/api_op_ListHosts.go b/service/codestarconnections/api_op_ListHosts.go index 6081046ff74..5e0754b31a8 100644 --- a/service/codestarconnections/api_op_ListHosts.go +++ b/service/codestarconnections/api_op_ListHosts.go @@ -4,6 +4,7 @@ package codestarconnections import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/codestarconnections/types" @@ -110,6 +111,81 @@ func addOperationListHostsMiddlewares(stack *middleware.Stack, options Options) return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListHostsPaginator returns a new ListHostsPaginator +func NewListHostsPaginator(client ListHostsAPIClient, params *ListHostsInput, optFns ...func(*ListHostsPaginatorOptions)) *ListHostsPaginator { + options := ListHostsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListHostsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListHosts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codestarconnections/go.mod b/service/codestarconnections/go.mod index 728b94172ce..5d0adbf4a57 100644 --- a/service/codestarconnections/go.mod +++ b/service/codestarconnections/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/codestarconnections/go.sum b/service/codestarconnections/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/codestarconnections/go.sum +++ b/service/codestarconnections/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index a8f6d7c8205..00000000000 --- a/service/codestarconnections/paginators.go +++ /dev/null @@ -1,159 +0,0 @@ -// 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/api_op_ListEventTypes.go b/service/codestarnotifications/api_op_ListEventTypes.go index d294add48fc..77fcec8f1ff 100644 --- a/service/codestarnotifications/api_op_ListEventTypes.go +++ b/service/codestarnotifications/api_op_ListEventTypes.go @@ -4,6 +4,7 @@ package codestarnotifications import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/codestarnotifications/types" @@ -116,6 +117,82 @@ func addOperationListEventTypesMiddlewares(stack *middleware.Stack, options Opti return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListEventTypesPaginator returns a new ListEventTypesPaginator +func NewListEventTypesPaginator(client ListEventTypesAPIClient, params *ListEventTypesInput, optFns ...func(*ListEventTypesPaginatorOptions)) *ListEventTypesPaginator { + options := ListEventTypesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListEventTypesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListEventTypes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codestarnotifications/api_op_ListNotificationRules.go b/service/codestarnotifications/api_op_ListNotificationRules.go index c1f933ba11d..095253d9ad1 100644 --- a/service/codestarnotifications/api_op_ListNotificationRules.go +++ b/service/codestarnotifications/api_op_ListNotificationRules.go @@ -4,6 +4,7 @@ package codestarnotifications import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/codestarnotifications/types" @@ -118,6 +119,83 @@ func addOperationListNotificationRulesMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListNotificationRulesPaginator returns a new ListNotificationRulesPaginator +func NewListNotificationRulesPaginator(client ListNotificationRulesAPIClient, params *ListNotificationRulesInput, optFns ...func(*ListNotificationRulesPaginatorOptions)) *ListNotificationRulesPaginator { + options := ListNotificationRulesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListNotificationRulesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListNotificationRules(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codestarnotifications/api_op_ListTargets.go b/service/codestarnotifications/api_op_ListTargets.go index 465e24e50c5..311eef94157 100644 --- a/service/codestarnotifications/api_op_ListTargets.go +++ b/service/codestarnotifications/api_op_ListTargets.go @@ -4,6 +4,7 @@ package codestarnotifications import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/codestarnotifications/types" @@ -117,6 +118,81 @@ func addOperationListTargetsMiddlewares(stack *middleware.Stack, options Options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTargetsPaginator returns a new ListTargetsPaginator +func NewListTargetsPaginator(client ListTargetsAPIClient, params *ListTargetsInput, optFns ...func(*ListTargetsPaginatorOptions)) *ListTargetsPaginator { + options := ListTargetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTargetsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTargets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codestarnotifications/go.mod b/service/codestarnotifications/go.mod index 8cde858aaad..d214b6f3ed2 100644 --- a/service/codestarnotifications/go.mod +++ b/service/codestarnotifications/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/codestarnotifications/go.sum b/service/codestarnotifications/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/codestarnotifications/go.sum +++ b/service/codestarnotifications/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index d9c27b59085..00000000000 --- a/service/codestarnotifications/paginators.go +++ /dev/null @@ -1,236 +0,0 @@ -// 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.mod b/service/cognitoidentity/go.mod index 8219d652b93..189518d0970 100644 --- a/service/cognitoidentity/go.mod +++ b/service/cognitoidentity/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/cognitoidentity/go.sum b/service/cognitoidentity/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/cognitoidentity/go.sum +++ b/service/cognitoidentity/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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/api_op_AdminListGroupsForUser.go b/service/cognitoidentityprovider/api_op_AdminListGroupsForUser.go index a4f81554e8c..dd2af14efab 100644 --- a/service/cognitoidentityprovider/api_op_AdminListGroupsForUser.go +++ b/service/cognitoidentityprovider/api_op_AdminListGroupsForUser.go @@ -4,6 +4,7 @@ package cognitoidentityprovider import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider/types" @@ -121,6 +122,82 @@ func addOperationAdminListGroupsForUserMiddlewares(stack *middleware.Stack, opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewAdminListGroupsForUserPaginator returns a new AdminListGroupsForUserPaginator +func NewAdminListGroupsForUserPaginator(client AdminListGroupsForUserAPIClient, params *AdminListGroupsForUserInput, optFns ...func(*AdminListGroupsForUserPaginatorOptions)) *AdminListGroupsForUserPaginator { + options := AdminListGroupsForUserPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &AdminListGroupsForUserInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opAdminListGroupsForUser(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cognitoidentityprovider/api_op_AdminListUserAuthEvents.go b/service/cognitoidentityprovider/api_op_AdminListUserAuthEvents.go index 7b66bb46bd8..89c91086412 100644 --- a/service/cognitoidentityprovider/api_op_AdminListUserAuthEvents.go +++ b/service/cognitoidentityprovider/api_op_AdminListUserAuthEvents.go @@ -4,6 +4,7 @@ package cognitoidentityprovider import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider/types" @@ -120,6 +121,83 @@ func addOperationAdminListUserAuthEventsMiddlewares(stack *middleware.Stack, opt return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewAdminListUserAuthEventsPaginator returns a new +// AdminListUserAuthEventsPaginator +func NewAdminListUserAuthEventsPaginator(client AdminListUserAuthEventsAPIClient, params *AdminListUserAuthEventsInput, optFns ...func(*AdminListUserAuthEventsPaginatorOptions)) *AdminListUserAuthEventsPaginator { + options := AdminListUserAuthEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &AdminListUserAuthEventsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opAdminListUserAuthEvents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cognitoidentityprovider/api_op_ListGroups.go b/service/cognitoidentityprovider/api_op_ListGroups.go index 900516d7593..e4ee380b829 100644 --- a/service/cognitoidentityprovider/api_op_ListGroups.go +++ b/service/cognitoidentityprovider/api_op_ListGroups.go @@ -4,6 +4,7 @@ package cognitoidentityprovider import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider/types" @@ -116,6 +117,80 @@ func addOperationListGroupsMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListGroupsPaginator returns a new ListGroupsPaginator +func NewListGroupsPaginator(client ListGroupsAPIClient, params *ListGroupsInput, optFns ...func(*ListGroupsPaginatorOptions)) *ListGroupsPaginator { + options := ListGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cognitoidentityprovider/api_op_ListIdentityProviders.go b/service/cognitoidentityprovider/api_op_ListIdentityProviders.go index 5e3af0435cb..d6760d67fe3 100644 --- a/service/cognitoidentityprovider/api_op_ListIdentityProviders.go +++ b/service/cognitoidentityprovider/api_op_ListIdentityProviders.go @@ -4,6 +4,7 @@ package cognitoidentityprovider import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider/types" @@ -115,6 +116,82 @@ func addOperationListIdentityProvidersMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListIdentityProvidersPaginator returns a new ListIdentityProvidersPaginator +func NewListIdentityProvidersPaginator(client ListIdentityProvidersAPIClient, params *ListIdentityProvidersInput, optFns ...func(*ListIdentityProvidersPaginatorOptions)) *ListIdentityProvidersPaginator { + options := ListIdentityProvidersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListIdentityProvidersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListIdentityProviders(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cognitoidentityprovider/api_op_ListResourceServers.go b/service/cognitoidentityprovider/api_op_ListResourceServers.go index 15efc75aad3..ed70c6f3b43 100644 --- a/service/cognitoidentityprovider/api_op_ListResourceServers.go +++ b/service/cognitoidentityprovider/api_op_ListResourceServers.go @@ -4,6 +4,7 @@ package cognitoidentityprovider import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider/types" @@ -115,6 +116,82 @@ func addOperationListResourceServersMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListResourceServersPaginator returns a new ListResourceServersPaginator +func NewListResourceServersPaginator(client ListResourceServersAPIClient, params *ListResourceServersInput, optFns ...func(*ListResourceServersPaginatorOptions)) *ListResourceServersPaginator { + options := ListResourceServersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListResourceServersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListResourceServers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cognitoidentityprovider/api_op_ListUserPoolClients.go b/service/cognitoidentityprovider/api_op_ListUserPoolClients.go index 2fe0277f70d..2a26838fed7 100644 --- a/service/cognitoidentityprovider/api_op_ListUserPoolClients.go +++ b/service/cognitoidentityprovider/api_op_ListUserPoolClients.go @@ -4,6 +4,7 @@ package cognitoidentityprovider import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider/types" @@ -118,6 +119,83 @@ func addOperationListUserPoolClientsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListUserPoolClientsPaginator returns a new ListUserPoolClientsPaginator +func NewListUserPoolClientsPaginator(client ListUserPoolClientsAPIClient, params *ListUserPoolClientsInput, optFns ...func(*ListUserPoolClientsPaginatorOptions)) *ListUserPoolClientsPaginator { + options := ListUserPoolClientsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListUserPoolClientsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListUserPoolClients(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cognitoidentityprovider/api_op_ListUsers.go b/service/cognitoidentityprovider/api_op_ListUsers.go index 261d709c970..1d5fbbbec7a 100644 --- a/service/cognitoidentityprovider/api_op_ListUsers.go +++ b/service/cognitoidentityprovider/api_op_ListUsers.go @@ -4,6 +4,7 @@ package cognitoidentityprovider import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider/types" @@ -172,6 +173,80 @@ func addOperationListUsersMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListUsersPaginator returns a new ListUsersPaginator +func NewListUsersPaginator(client ListUsersAPIClient, params *ListUsersInput, optFns ...func(*ListUsersPaginatorOptions)) *ListUsersPaginator { + options := ListUsersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListUsersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.PaginationToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListUsers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cognitoidentityprovider/api_op_ListUsersInGroup.go b/service/cognitoidentityprovider/api_op_ListUsersInGroup.go index 148ad313a2e..9f744454a8f 100644 --- a/service/cognitoidentityprovider/api_op_ListUsersInGroup.go +++ b/service/cognitoidentityprovider/api_op_ListUsersInGroup.go @@ -4,6 +4,7 @@ package cognitoidentityprovider import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider/types" @@ -121,6 +122,81 @@ func addOperationListUsersInGroupMiddlewares(stack *middleware.Stack, options Op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListUsersInGroupPaginator returns a new ListUsersInGroupPaginator +func NewListUsersInGroupPaginator(client ListUsersInGroupAPIClient, params *ListUsersInGroupInput, optFns ...func(*ListUsersInGroupPaginatorOptions)) *ListUsersInGroupPaginator { + options := ListUsersInGroupPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListUsersInGroupInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListUsersInGroup(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cognitoidentityprovider/go.mod b/service/cognitoidentityprovider/go.mod index a6535ab5e8a..091700d8ff2 100644 --- a/service/cognitoidentityprovider/go.mod +++ b/service/cognitoidentityprovider/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/cognitoidentityprovider/go.sum b/service/cognitoidentityprovider/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/cognitoidentityprovider/go.sum +++ b/service/cognitoidentityprovider/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 223a228eb26..00000000000 --- a/service/cognitoidentityprovider/paginators.go +++ /dev/null @@ -1,613 +0,0 @@ -// 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.mod b/service/cognitosync/go.mod index 9a49b733739..2f6d682e1b4 100644 --- a/service/cognitosync/go.mod +++ b/service/cognitosync/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/cognitosync/go.sum b/service/cognitosync/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/cognitosync/go.sum +++ b/service/cognitosync/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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/api_op_ListDocumentClassificationJobs.go b/service/comprehend/api_op_ListDocumentClassificationJobs.go index 0590b2fa305..f5912341596 100644 --- a/service/comprehend/api_op_ListDocumentClassificationJobs.go +++ b/service/comprehend/api_op_ListDocumentClassificationJobs.go @@ -4,6 +4,7 @@ package comprehend import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/comprehend/types" @@ -110,6 +111,83 @@ func addOperationListDocumentClassificationJobsMiddlewares(stack *middleware.Sta return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDocumentClassificationJobsPaginator returns a new +// ListDocumentClassificationJobsPaginator +func NewListDocumentClassificationJobsPaginator(client ListDocumentClassificationJobsAPIClient, params *ListDocumentClassificationJobsInput, optFns ...func(*ListDocumentClassificationJobsPaginatorOptions)) *ListDocumentClassificationJobsPaginator { + options := ListDocumentClassificationJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDocumentClassificationJobsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDocumentClassificationJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/comprehend/api_op_ListDocumentClassifiers.go b/service/comprehend/api_op_ListDocumentClassifiers.go index 70a369459a7..8e5fed1cb09 100644 --- a/service/comprehend/api_op_ListDocumentClassifiers.go +++ b/service/comprehend/api_op_ListDocumentClassifiers.go @@ -4,6 +4,7 @@ package comprehend import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/comprehend/types" @@ -110,6 +111,83 @@ func addOperationListDocumentClassifiersMiddlewares(stack *middleware.Stack, opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDocumentClassifiersPaginator returns a new +// ListDocumentClassifiersPaginator +func NewListDocumentClassifiersPaginator(client ListDocumentClassifiersAPIClient, params *ListDocumentClassifiersInput, optFns ...func(*ListDocumentClassifiersPaginatorOptions)) *ListDocumentClassifiersPaginator { + options := ListDocumentClassifiersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDocumentClassifiersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDocumentClassifiers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/comprehend/api_op_ListDominantLanguageDetectionJobs.go b/service/comprehend/api_op_ListDominantLanguageDetectionJobs.go index 63684317452..ab5769041dd 100644 --- a/service/comprehend/api_op_ListDominantLanguageDetectionJobs.go +++ b/service/comprehend/api_op_ListDominantLanguageDetectionJobs.go @@ -4,6 +4,7 @@ package comprehend import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/comprehend/types" @@ -110,6 +111,83 @@ func addOperationListDominantLanguageDetectionJobsMiddlewares(stack *middleware. return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDominantLanguageDetectionJobsPaginator returns a new +// ListDominantLanguageDetectionJobsPaginator +func NewListDominantLanguageDetectionJobsPaginator(client ListDominantLanguageDetectionJobsAPIClient, params *ListDominantLanguageDetectionJobsInput, optFns ...func(*ListDominantLanguageDetectionJobsPaginatorOptions)) *ListDominantLanguageDetectionJobsPaginator { + options := ListDominantLanguageDetectionJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDominantLanguageDetectionJobsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDominantLanguageDetectionJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/comprehend/api_op_ListEntitiesDetectionJobs.go b/service/comprehend/api_op_ListEntitiesDetectionJobs.go index 86d9e7ed877..0904140a728 100644 --- a/service/comprehend/api_op_ListEntitiesDetectionJobs.go +++ b/service/comprehend/api_op_ListEntitiesDetectionJobs.go @@ -4,6 +4,7 @@ package comprehend import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/comprehend/types" @@ -110,6 +111,83 @@ func addOperationListEntitiesDetectionJobsMiddlewares(stack *middleware.Stack, o return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListEntitiesDetectionJobsPaginator returns a new +// ListEntitiesDetectionJobsPaginator +func NewListEntitiesDetectionJobsPaginator(client ListEntitiesDetectionJobsAPIClient, params *ListEntitiesDetectionJobsInput, optFns ...func(*ListEntitiesDetectionJobsPaginatorOptions)) *ListEntitiesDetectionJobsPaginator { + options := ListEntitiesDetectionJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListEntitiesDetectionJobsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListEntitiesDetectionJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/comprehend/api_op_ListEntityRecognizers.go b/service/comprehend/api_op_ListEntityRecognizers.go index 237063ff1a1..74960e0c610 100644 --- a/service/comprehend/api_op_ListEntityRecognizers.go +++ b/service/comprehend/api_op_ListEntityRecognizers.go @@ -4,6 +4,7 @@ package comprehend import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/comprehend/types" @@ -114,6 +115,82 @@ func addOperationListEntityRecognizersMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListEntityRecognizersPaginator returns a new ListEntityRecognizersPaginator +func NewListEntityRecognizersPaginator(client ListEntityRecognizersAPIClient, params *ListEntityRecognizersInput, optFns ...func(*ListEntityRecognizersPaginatorOptions)) *ListEntityRecognizersPaginator { + options := ListEntityRecognizersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListEntityRecognizersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListEntityRecognizers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/comprehend/api_op_ListKeyPhrasesDetectionJobs.go b/service/comprehend/api_op_ListKeyPhrasesDetectionJobs.go index ad0ccaad612..b0a8441efcf 100644 --- a/service/comprehend/api_op_ListKeyPhrasesDetectionJobs.go +++ b/service/comprehend/api_op_ListKeyPhrasesDetectionJobs.go @@ -4,6 +4,7 @@ package comprehend import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/comprehend/types" @@ -110,6 +111,83 @@ func addOperationListKeyPhrasesDetectionJobsMiddlewares(stack *middleware.Stack, return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListKeyPhrasesDetectionJobsPaginator returns a new +// ListKeyPhrasesDetectionJobsPaginator +func NewListKeyPhrasesDetectionJobsPaginator(client ListKeyPhrasesDetectionJobsAPIClient, params *ListKeyPhrasesDetectionJobsInput, optFns ...func(*ListKeyPhrasesDetectionJobsPaginatorOptions)) *ListKeyPhrasesDetectionJobsPaginator { + options := ListKeyPhrasesDetectionJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListKeyPhrasesDetectionJobsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListKeyPhrasesDetectionJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/comprehend/api_op_ListSentimentDetectionJobs.go b/service/comprehend/api_op_ListSentimentDetectionJobs.go index d7a47965c58..8fd664a47fb 100644 --- a/service/comprehend/api_op_ListSentimentDetectionJobs.go +++ b/service/comprehend/api_op_ListSentimentDetectionJobs.go @@ -4,6 +4,7 @@ package comprehend import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/comprehend/types" @@ -110,6 +111,83 @@ func addOperationListSentimentDetectionJobsMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListSentimentDetectionJobsPaginator returns a new +// ListSentimentDetectionJobsPaginator +func NewListSentimentDetectionJobsPaginator(client ListSentimentDetectionJobsAPIClient, params *ListSentimentDetectionJobsInput, optFns ...func(*ListSentimentDetectionJobsPaginatorOptions)) *ListSentimentDetectionJobsPaginator { + options := ListSentimentDetectionJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSentimentDetectionJobsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSentimentDetectionJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/comprehend/api_op_ListTopicsDetectionJobs.go b/service/comprehend/api_op_ListTopicsDetectionJobs.go index 17dc6f825e3..25db16b1941 100644 --- a/service/comprehend/api_op_ListTopicsDetectionJobs.go +++ b/service/comprehend/api_op_ListTopicsDetectionJobs.go @@ -4,6 +4,7 @@ package comprehend import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/comprehend/types" @@ -110,6 +111,83 @@ func addOperationListTopicsDetectionJobsMiddlewares(stack *middleware.Stack, opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTopicsDetectionJobsPaginator returns a new +// ListTopicsDetectionJobsPaginator +func NewListTopicsDetectionJobsPaginator(client ListTopicsDetectionJobsAPIClient, params *ListTopicsDetectionJobsInput, optFns ...func(*ListTopicsDetectionJobsPaginatorOptions)) *ListTopicsDetectionJobsPaginator { + options := ListTopicsDetectionJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTopicsDetectionJobsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTopicsDetectionJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/comprehend/go.mod b/service/comprehend/go.mod index 011e4273e62..594fe24f2dc 100644 --- a/service/comprehend/go.mod +++ b/service/comprehend/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/comprehend/go.sum b/service/comprehend/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/comprehend/go.sum +++ b/service/comprehend/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 4b8a5095a05..00000000000 --- a/service/comprehend/paginators.go +++ /dev/null @@ -1,623 +0,0 @@ -// 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.mod b/service/comprehendmedical/go.mod index 92297e22b5f..847a6665f01 100644 --- a/service/comprehendmedical/go.mod +++ b/service/comprehendmedical/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/comprehendmedical/go.sum b/service/comprehendmedical/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/comprehendmedical/go.sum +++ b/service/comprehendmedical/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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.mod b/service/computeoptimizer/go.mod index bdd6c7606d0..47731fd333a 100644 --- a/service/computeoptimizer/go.mod +++ b/service/computeoptimizer/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/computeoptimizer/go.sum b/service/computeoptimizer/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/computeoptimizer/go.sum +++ b/service/computeoptimizer/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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/api_op_DescribeRemediationExceptions.go b/service/configservice/api_op_DescribeRemediationExceptions.go index fb62b9abbe0..5636aae0bb6 100644 --- a/service/configservice/api_op_DescribeRemediationExceptions.go +++ b/service/configservice/api_op_DescribeRemediationExceptions.go @@ -4,6 +4,7 @@ package configservice import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/configservice/types" @@ -129,6 +130,84 @@ func addOperationDescribeRemediationExceptionsMiddlewares(stack *middleware.Stac return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeRemediationExceptionsPaginator returns a new +// DescribeRemediationExceptionsPaginator +func NewDescribeRemediationExceptionsPaginator(client DescribeRemediationExceptionsAPIClient, params *DescribeRemediationExceptionsInput, optFns ...func(*DescribeRemediationExceptionsPaginatorOptions)) *DescribeRemediationExceptionsPaginator { + options := DescribeRemediationExceptionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeRemediationExceptionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeRemediationExceptions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/configservice/api_op_DescribeRemediationExecutionStatus.go b/service/configservice/api_op_DescribeRemediationExecutionStatus.go index d4da63411d2..c125ec5f11f 100644 --- a/service/configservice/api_op_DescribeRemediationExecutionStatus.go +++ b/service/configservice/api_op_DescribeRemediationExecutionStatus.go @@ -4,6 +4,7 @@ package configservice import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/configservice/types" @@ -123,6 +124,84 @@ func addOperationDescribeRemediationExecutionStatusMiddlewares(stack *middleware return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeRemediationExecutionStatusPaginator returns a new +// DescribeRemediationExecutionStatusPaginator +func NewDescribeRemediationExecutionStatusPaginator(client DescribeRemediationExecutionStatusAPIClient, params *DescribeRemediationExecutionStatusInput, optFns ...func(*DescribeRemediationExecutionStatusPaginatorOptions)) *DescribeRemediationExecutionStatusPaginator { + options := DescribeRemediationExecutionStatusPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeRemediationExecutionStatusInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeRemediationExecutionStatus(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/configservice/api_op_GetResourceConfigHistory.go b/service/configservice/api_op_GetResourceConfigHistory.go index 58e5712a7e3..68eff8871a6 100644 --- a/service/configservice/api_op_GetResourceConfigHistory.go +++ b/service/configservice/api_op_GetResourceConfigHistory.go @@ -4,6 +4,7 @@ package configservice import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/configservice/types" @@ -149,6 +150,85 @@ func addOperationGetResourceConfigHistoryMiddlewares(stack *middleware.Stack, op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetResourceConfigHistoryPaginator returns a new +// GetResourceConfigHistoryPaginator +func NewGetResourceConfigHistoryPaginator(client GetResourceConfigHistoryAPIClient, params *GetResourceConfigHistoryInput, optFns ...func(*GetResourceConfigHistoryPaginatorOptions)) *GetResourceConfigHistoryPaginator { + options := GetResourceConfigHistoryPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetResourceConfigHistoryInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetResourceConfigHistory(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/configservice/api_op_SelectAggregateResourceConfig.go b/service/configservice/api_op_SelectAggregateResourceConfig.go index 9b47230b9b0..b452739800c 100644 --- a/service/configservice/api_op_SelectAggregateResourceConfig.go +++ b/service/configservice/api_op_SelectAggregateResourceConfig.go @@ -4,6 +4,7 @@ package configservice import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/configservice/types" @@ -133,6 +134,84 @@ func addOperationSelectAggregateResourceConfigMiddlewares(stack *middleware.Stac return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewSelectAggregateResourceConfigPaginator returns a new +// SelectAggregateResourceConfigPaginator +func NewSelectAggregateResourceConfigPaginator(client SelectAggregateResourceConfigAPIClient, params *SelectAggregateResourceConfigInput, optFns ...func(*SelectAggregateResourceConfigPaginatorOptions)) *SelectAggregateResourceConfigPaginator { + options := SelectAggregateResourceConfigPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SelectAggregateResourceConfigInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSelectAggregateResourceConfig(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/configservice/go.mod b/service/configservice/go.mod index b761ca74978..65e47a003cf 100644 --- a/service/configservice/go.mod +++ b/service/configservice/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/configservice/go.sum b/service/configservice/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/configservice/go.sum +++ b/service/configservice/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index ae2e154c639..00000000000 --- a/service/configservice/paginators.go +++ /dev/null @@ -1,321 +0,0 @@ -// 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/api_op_GetCurrentMetricData.go b/service/connect/api_op_GetCurrentMetricData.go index 8b7b0f85cfc..ecec236e8c0 100644 --- a/service/connect/api_op_GetCurrentMetricData.go +++ b/service/connect/api_op_GetCurrentMetricData.go @@ -4,6 +4,7 @@ package connect import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/connect/types" @@ -182,6 +183,82 @@ func addOperationGetCurrentMetricDataMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetCurrentMetricDataPaginator returns a new GetCurrentMetricDataPaginator +func NewGetCurrentMetricDataPaginator(client GetCurrentMetricDataAPIClient, params *GetCurrentMetricDataInput, optFns ...func(*GetCurrentMetricDataPaginatorOptions)) *GetCurrentMetricDataPaginator { + options := GetCurrentMetricDataPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetCurrentMetricDataInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetCurrentMetricData(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/connect/api_op_GetMetricData.go b/service/connect/api_op_GetMetricData.go index 808d87d5166..6f801f25d8e 100644 --- a/service/connect/api_op_GetMetricData.go +++ b/service/connect/api_op_GetMetricData.go @@ -4,6 +4,7 @@ package connect import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/connect/types" @@ -183,6 +184,80 @@ func addOperationGetMetricDataMiddlewares(stack *middleware.Stack, options Optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetMetricDataPaginator returns a new GetMetricDataPaginator +func NewGetMetricDataPaginator(client GetMetricDataAPIClient, params *GetMetricDataInput, optFns ...func(*GetMetricDataPaginatorOptions)) *GetMetricDataPaginator { + options := GetMetricDataPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetMetricDataInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetMetricData(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/connect/api_op_ListContactFlows.go b/service/connect/api_op_ListContactFlows.go index 212047301e0..46d64595461 100644 --- a/service/connect/api_op_ListContactFlows.go +++ b/service/connect/api_op_ListContactFlows.go @@ -4,6 +4,7 @@ package connect import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/connect/types" @@ -123,6 +124,81 @@ func addOperationListContactFlowsMiddlewares(stack *middleware.Stack, options Op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListContactFlowsPaginator returns a new ListContactFlowsPaginator +func NewListContactFlowsPaginator(client ListContactFlowsAPIClient, params *ListContactFlowsInput, optFns ...func(*ListContactFlowsPaginatorOptions)) *ListContactFlowsPaginator { + options := ListContactFlowsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListContactFlowsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListContactFlows(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/connect/api_op_ListHoursOfOperations.go b/service/connect/api_op_ListHoursOfOperations.go index a91ce8e2226..e4c9f85804b 100644 --- a/service/connect/api_op_ListHoursOfOperations.go +++ b/service/connect/api_op_ListHoursOfOperations.go @@ -4,6 +4,7 @@ package connect import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/connect/types" @@ -118,6 +119,82 @@ func addOperationListHoursOfOperationsMiddlewares(stack *middleware.Stack, optio return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListHoursOfOperationsPaginator returns a new ListHoursOfOperationsPaginator +func NewListHoursOfOperationsPaginator(client ListHoursOfOperationsAPIClient, params *ListHoursOfOperationsInput, optFns ...func(*ListHoursOfOperationsPaginatorOptions)) *ListHoursOfOperationsPaginator { + options := ListHoursOfOperationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListHoursOfOperationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListHoursOfOperations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/connect/api_op_ListPhoneNumbers.go b/service/connect/api_op_ListPhoneNumbers.go index 11f6b7a7258..091576a8613 100644 --- a/service/connect/api_op_ListPhoneNumbers.go +++ b/service/connect/api_op_ListPhoneNumbers.go @@ -4,6 +4,7 @@ package connect import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/connect/types" @@ -124,6 +125,81 @@ func addOperationListPhoneNumbersMiddlewares(stack *middleware.Stack, options Op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListPhoneNumbersPaginator returns a new ListPhoneNumbersPaginator +func NewListPhoneNumbersPaginator(client ListPhoneNumbersAPIClient, params *ListPhoneNumbersInput, optFns ...func(*ListPhoneNumbersPaginatorOptions)) *ListPhoneNumbersPaginator { + options := ListPhoneNumbersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPhoneNumbersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPhoneNumbers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/connect/api_op_ListPrompts.go b/service/connect/api_op_ListPrompts.go index 9b5402a71e8..9f9ce60c9cc 100644 --- a/service/connect/api_op_ListPrompts.go +++ b/service/connect/api_op_ListPrompts.go @@ -4,6 +4,7 @@ package connect import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/connect/types" @@ -115,6 +116,80 @@ func addOperationListPromptsMiddlewares(stack *middleware.Stack, options Options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListPromptsPaginator returns a new ListPromptsPaginator +func NewListPromptsPaginator(client ListPromptsAPIClient, params *ListPromptsInput, optFns ...func(*ListPromptsPaginatorOptions)) *ListPromptsPaginator { + options := ListPromptsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPromptsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPrompts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/connect/api_op_ListQueues.go b/service/connect/api_op_ListQueues.go index 41158193eb6..1e48dc822aa 100644 --- a/service/connect/api_op_ListQueues.go +++ b/service/connect/api_op_ListQueues.go @@ -4,6 +4,7 @@ package connect import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/connect/types" @@ -120,6 +121,80 @@ func addOperationListQueuesMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListQueuesPaginator returns a new ListQueuesPaginator +func NewListQueuesPaginator(client ListQueuesAPIClient, params *ListQueuesInput, optFns ...func(*ListQueuesPaginatorOptions)) *ListQueuesPaginator { + options := ListQueuesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListQueuesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListQueues(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/connect/api_op_ListRoutingProfileQueues.go b/service/connect/api_op_ListRoutingProfileQueues.go index 8d31a432f4c..c1cf090e484 100644 --- a/service/connect/api_op_ListRoutingProfileQueues.go +++ b/service/connect/api_op_ListRoutingProfileQueues.go @@ -4,6 +4,7 @@ package connect import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/connect/types" @@ -119,6 +120,83 @@ func addOperationListRoutingProfileQueuesMiddlewares(stack *middleware.Stack, op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListRoutingProfileQueuesPaginator returns a new +// ListRoutingProfileQueuesPaginator +func NewListRoutingProfileQueuesPaginator(client ListRoutingProfileQueuesAPIClient, params *ListRoutingProfileQueuesInput, optFns ...func(*ListRoutingProfileQueuesPaginatorOptions)) *ListRoutingProfileQueuesPaginator { + options := ListRoutingProfileQueuesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRoutingProfileQueuesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRoutingProfileQueues(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/connect/api_op_ListRoutingProfiles.go b/service/connect/api_op_ListRoutingProfiles.go index 48b73a469eb..b45c0b7f909 100644 --- a/service/connect/api_op_ListRoutingProfiles.go +++ b/service/connect/api_op_ListRoutingProfiles.go @@ -4,6 +4,7 @@ package connect import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/connect/types" @@ -120,6 +121,82 @@ func addOperationListRoutingProfilesMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListRoutingProfilesPaginator returns a new ListRoutingProfilesPaginator +func NewListRoutingProfilesPaginator(client ListRoutingProfilesAPIClient, params *ListRoutingProfilesInput, optFns ...func(*ListRoutingProfilesPaginatorOptions)) *ListRoutingProfilesPaginator { + options := ListRoutingProfilesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRoutingProfilesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRoutingProfiles(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/connect/api_op_ListSecurityProfiles.go b/service/connect/api_op_ListSecurityProfiles.go index 457708692da..527fc669914 100644 --- a/service/connect/api_op_ListSecurityProfiles.go +++ b/service/connect/api_op_ListSecurityProfiles.go @@ -4,6 +4,7 @@ package connect import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/connect/types" @@ -118,6 +119,82 @@ func addOperationListSecurityProfilesMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListSecurityProfilesPaginator returns a new ListSecurityProfilesPaginator +func NewListSecurityProfilesPaginator(client ListSecurityProfilesAPIClient, params *ListSecurityProfilesInput, optFns ...func(*ListSecurityProfilesPaginatorOptions)) *ListSecurityProfilesPaginator { + options := ListSecurityProfilesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSecurityProfilesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSecurityProfiles(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/connect/api_op_ListUserHierarchyGroups.go b/service/connect/api_op_ListUserHierarchyGroups.go index aaa3582b515..675c22e02c2 100644 --- a/service/connect/api_op_ListUserHierarchyGroups.go +++ b/service/connect/api_op_ListUserHierarchyGroups.go @@ -4,6 +4,7 @@ package connect import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/connect/types" @@ -118,6 +119,83 @@ func addOperationListUserHierarchyGroupsMiddlewares(stack *middleware.Stack, opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListUserHierarchyGroupsPaginator returns a new +// ListUserHierarchyGroupsPaginator +func NewListUserHierarchyGroupsPaginator(client ListUserHierarchyGroupsAPIClient, params *ListUserHierarchyGroupsInput, optFns ...func(*ListUserHierarchyGroupsPaginatorOptions)) *ListUserHierarchyGroupsPaginator { + options := ListUserHierarchyGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListUserHierarchyGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListUserHierarchyGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/connect/api_op_ListUsers.go b/service/connect/api_op_ListUsers.go index e594b5e1f6b..1fb9423ac27 100644 --- a/service/connect/api_op_ListUsers.go +++ b/service/connect/api_op_ListUsers.go @@ -4,6 +4,7 @@ package connect import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/connect/types" @@ -115,6 +116,80 @@ func addOperationListUsersMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListUsersPaginator returns a new ListUsersPaginator +func NewListUsersPaginator(client ListUsersAPIClient, params *ListUsersInput, optFns ...func(*ListUsersPaginatorOptions)) *ListUsersPaginator { + options := ListUsersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListUsersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListUsers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/connect/go.mod b/service/connect/go.mod index bb40b0eb3dd..97019ded412 100644 --- a/service/connect/go.mod +++ b/service/connect/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/connect/go.sum b/service/connect/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/connect/go.sum +++ b/service/connect/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 71ea0a69e57..00000000000 --- a/service/connect/paginators.go +++ /dev/null @@ -1,912 +0,0 @@ -// 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/api_op_GetTranscript.go b/service/connectparticipant/api_op_GetTranscript.go index df6c392f708..958317c48bc 100644 --- a/service/connectparticipant/api_op_GetTranscript.go +++ b/service/connectparticipant/api_op_GetTranscript.go @@ -4,6 +4,7 @@ package connectparticipant import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/connectparticipant/types" @@ -132,6 +133,80 @@ func addOperationGetTranscriptMiddlewares(stack *middleware.Stack, options Optio return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetTranscriptPaginator returns a new GetTranscriptPaginator +func NewGetTranscriptPaginator(client GetTranscriptAPIClient, params *GetTranscriptInput, optFns ...func(*GetTranscriptPaginatorOptions)) *GetTranscriptPaginator { + options := GetTranscriptPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetTranscriptInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetTranscript(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/connectparticipant/go.mod b/service/connectparticipant/go.mod index a7957943dfc..8a4115de337 100644 --- a/service/connectparticipant/go.mod +++ b/service/connectparticipant/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/connectparticipant/go.sum b/service/connectparticipant/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/connectparticipant/go.sum +++ b/service/connectparticipant/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 3d36b984f10..00000000000 --- a/service/connectparticipant/paginators.go +++ /dev/null @@ -1,82 +0,0 @@ -// 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/api_op_DescribeReportDefinitions.go b/service/costandusagereportservice/api_op_DescribeReportDefinitions.go index 8fce67ce14d..203d1bada08 100644 --- a/service/costandusagereportservice/api_op_DescribeReportDefinitions.go +++ b/service/costandusagereportservice/api_op_DescribeReportDefinitions.go @@ -4,6 +4,7 @@ package costandusagereportservice import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/costandusagereportservice/types" @@ -107,6 +108,83 @@ func addOperationDescribeReportDefinitionsMiddlewares(stack *middleware.Stack, o return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeReportDefinitionsPaginator returns a new +// DescribeReportDefinitionsPaginator +func NewDescribeReportDefinitionsPaginator(client DescribeReportDefinitionsAPIClient, params *DescribeReportDefinitionsInput, optFns ...func(*DescribeReportDefinitionsPaginatorOptions)) *DescribeReportDefinitionsPaginator { + options := DescribeReportDefinitionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeReportDefinitionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeReportDefinitions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/costandusagereportservice/go.mod b/service/costandusagereportservice/go.mod index 630f29cad91..5a88d813df4 100644 --- a/service/costandusagereportservice/go.mod +++ b/service/costandusagereportservice/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/costandusagereportservice/go.sum b/service/costandusagereportservice/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/costandusagereportservice/go.sum +++ b/service/costandusagereportservice/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 8cd9abb66b4..00000000000 --- a/service/costandusagereportservice/paginators.go +++ /dev/null @@ -1,85 +0,0 @@ -// 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/api_op_GetSavingsPlansCoverage.go b/service/costexplorer/api_op_GetSavingsPlansCoverage.go index 55a815e1ddb..debd8890746 100644 --- a/service/costexplorer/api_op_GetSavingsPlansCoverage.go +++ b/service/costexplorer/api_op_GetSavingsPlansCoverage.go @@ -4,6 +4,7 @@ package costexplorer import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" @@ -170,6 +171,84 @@ func addOperationGetSavingsPlansCoverageMiddlewares(stack *middleware.Stack, opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetSavingsPlansCoveragePaginator returns a new +// GetSavingsPlansCoveragePaginator +func NewGetSavingsPlansCoveragePaginator(client GetSavingsPlansCoverageAPIClient, params *GetSavingsPlansCoverageInput, optFns ...func(*GetSavingsPlansCoveragePaginatorOptions)) *GetSavingsPlansCoveragePaginator { + options := GetSavingsPlansCoveragePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetSavingsPlansCoverageInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetSavingsPlansCoverage(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/costexplorer/api_op_GetSavingsPlansUtilizationDetails.go b/service/costexplorer/api_op_GetSavingsPlansUtilizationDetails.go index d09935dc11d..0f9b6030d54 100644 --- a/service/costexplorer/api_op_GetSavingsPlansUtilizationDetails.go +++ b/service/costexplorer/api_op_GetSavingsPlansUtilizationDetails.go @@ -4,6 +4,7 @@ package costexplorer import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" @@ -157,6 +158,84 @@ func addOperationGetSavingsPlansUtilizationDetailsMiddlewares(stack *middleware. return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetSavingsPlansUtilizationDetailsPaginator returns a new +// GetSavingsPlansUtilizationDetailsPaginator +func NewGetSavingsPlansUtilizationDetailsPaginator(client GetSavingsPlansUtilizationDetailsAPIClient, params *GetSavingsPlansUtilizationDetailsInput, optFns ...func(*GetSavingsPlansUtilizationDetailsPaginatorOptions)) *GetSavingsPlansUtilizationDetailsPaginator { + options := GetSavingsPlansUtilizationDetailsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetSavingsPlansUtilizationDetailsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetSavingsPlansUtilizationDetails(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/costexplorer/api_op_ListCostCategoryDefinitions.go b/service/costexplorer/api_op_ListCostCategoryDefinitions.go index ac0ec234980..6490d6151fc 100644 --- a/service/costexplorer/api_op_ListCostCategoryDefinitions.go +++ b/service/costexplorer/api_op_ListCostCategoryDefinitions.go @@ -4,6 +4,7 @@ package costexplorer import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" @@ -119,6 +120,83 @@ func addOperationListCostCategoryDefinitionsMiddlewares(stack *middleware.Stack, return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListCostCategoryDefinitionsPaginator returns a new +// ListCostCategoryDefinitionsPaginator +func NewListCostCategoryDefinitionsPaginator(client ListCostCategoryDefinitionsAPIClient, params *ListCostCategoryDefinitionsInput, optFns ...func(*ListCostCategoryDefinitionsPaginatorOptions)) *ListCostCategoryDefinitionsPaginator { + options := ListCostCategoryDefinitionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListCostCategoryDefinitionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListCostCategoryDefinitions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/costexplorer/go.mod b/service/costexplorer/go.mod index 7047431160c..d80b27e2142 100644 --- a/service/costexplorer/go.mod +++ b/service/costexplorer/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/costexplorer/go.sum b/service/costexplorer/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/costexplorer/go.sum +++ b/service/costexplorer/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 4ed068c054a..00000000000 --- a/service/costexplorer/paginators.go +++ /dev/null @@ -1,241 +0,0 @@ -// 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/api_op_DescribeApplicableIndividualAssessments.go b/service/databasemigrationservice/api_op_DescribeApplicableIndividualAssessments.go index 689a9a15746..acf1b7d94df 100644 --- a/service/databasemigrationservice/api_op_DescribeApplicableIndividualAssessments.go +++ b/service/databasemigrationservice/api_op_DescribeApplicableIndividualAssessments.go @@ -4,6 +4,7 @@ package databasemigrationservice import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/databasemigrationservice/types" @@ -156,6 +157,85 @@ func addOperationDescribeApplicableIndividualAssessmentsMiddlewares(stack *middl return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeApplicableIndividualAssessmentsPaginator returns a new +// DescribeApplicableIndividualAssessmentsPaginator +func NewDescribeApplicableIndividualAssessmentsPaginator(client DescribeApplicableIndividualAssessmentsAPIClient, params *DescribeApplicableIndividualAssessmentsInput, optFns ...func(*DescribeApplicableIndividualAssessmentsPaginatorOptions)) *DescribeApplicableIndividualAssessmentsPaginator { + options := DescribeApplicableIndividualAssessmentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeApplicableIndividualAssessmentsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeApplicableIndividualAssessments(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/databasemigrationservice/api_op_DescribeCertificates.go b/service/databasemigrationservice/api_op_DescribeCertificates.go index ca866023ff0..1ba54c4daca 100644 --- a/service/databasemigrationservice/api_op_DescribeCertificates.go +++ b/service/databasemigrationservice/api_op_DescribeCertificates.go @@ -4,6 +4,7 @@ package databasemigrationservice import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/databasemigrationservice/types" @@ -117,6 +118,85 @@ func addOperationDescribeCertificatesMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeCertificatesPaginator returns a new DescribeCertificatesPaginator +func NewDescribeCertificatesPaginator(client DescribeCertificatesAPIClient, params *DescribeCertificatesInput, optFns ...func(*DescribeCertificatesPaginatorOptions)) *DescribeCertificatesPaginator { + options := DescribeCertificatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeCertificatesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeCertificates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/databasemigrationservice/api_op_DescribeConnections.go b/service/databasemigrationservice/api_op_DescribeConnections.go index b6a416ba8aa..f30cd4564a8 100644 --- a/service/databasemigrationservice/api_op_DescribeConnections.go +++ b/service/databasemigrationservice/api_op_DescribeConnections.go @@ -4,6 +4,7 @@ package databasemigrationservice import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/databasemigrationservice/types" @@ -123,6 +124,85 @@ func addOperationDescribeConnectionsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeConnectionsPaginator returns a new DescribeConnectionsPaginator +func NewDescribeConnectionsPaginator(client DescribeConnectionsAPIClient, params *DescribeConnectionsInput, optFns ...func(*DescribeConnectionsPaginatorOptions)) *DescribeConnectionsPaginator { + options := DescribeConnectionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeConnectionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeConnections(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/databasemigrationservice/api_op_DescribeEndpointTypes.go b/service/databasemigrationservice/api_op_DescribeEndpointTypes.go index 79fa0008969..f2e1641d807 100644 --- a/service/databasemigrationservice/api_op_DescribeEndpointTypes.go +++ b/service/databasemigrationservice/api_op_DescribeEndpointTypes.go @@ -4,6 +4,7 @@ package databasemigrationservice import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/databasemigrationservice/types" @@ -121,6 +122,85 @@ func addOperationDescribeEndpointTypesMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeEndpointTypesPaginator returns a new DescribeEndpointTypesPaginator +func NewDescribeEndpointTypesPaginator(client DescribeEndpointTypesAPIClient, params *DescribeEndpointTypesInput, optFns ...func(*DescribeEndpointTypesPaginatorOptions)) *DescribeEndpointTypesPaginator { + options := DescribeEndpointTypesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEndpointTypesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEndpointTypes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/databasemigrationservice/api_op_DescribeEndpoints.go b/service/databasemigrationservice/api_op_DescribeEndpoints.go index 9cfcc8811e5..e901db651bf 100644 --- a/service/databasemigrationservice/api_op_DescribeEndpoints.go +++ b/service/databasemigrationservice/api_op_DescribeEndpoints.go @@ -4,6 +4,7 @@ package databasemigrationservice import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/databasemigrationservice/types" @@ -121,6 +122,84 @@ func addOperationDescribeEndpointsMiddlewares(stack *middleware.Stack, options O return 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 { + // 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeEndpointsPaginator returns a new DescribeEndpointsPaginator +func NewDescribeEndpointsPaginator(client DescribeEndpointsAPIClient, params *DescribeEndpointsInput, optFns ...func(*DescribeEndpointsPaginatorOptions)) *DescribeEndpointsPaginator { + options := DescribeEndpointsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEndpointsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEndpoints(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/databasemigrationservice/api_op_DescribeEventSubscriptions.go b/service/databasemigrationservice/api_op_DescribeEventSubscriptions.go index b5b3585e974..4f2a1cea4aa 100644 --- a/service/databasemigrationservice/api_op_DescribeEventSubscriptions.go +++ b/service/databasemigrationservice/api_op_DescribeEventSubscriptions.go @@ -4,6 +4,7 @@ package databasemigrationservice import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/databasemigrationservice/types" @@ -126,6 +127,86 @@ func addOperationDescribeEventSubscriptionsMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeEventSubscriptionsPaginator returns a new +// DescribeEventSubscriptionsPaginator +func NewDescribeEventSubscriptionsPaginator(client DescribeEventSubscriptionsAPIClient, params *DescribeEventSubscriptionsInput, optFns ...func(*DescribeEventSubscriptionsPaginatorOptions)) *DescribeEventSubscriptionsPaginator { + options := DescribeEventSubscriptionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEventSubscriptionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEventSubscriptions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/databasemigrationservice/api_op_DescribeEvents.go b/service/databasemigrationservice/api_op_DescribeEvents.go index ebc76f085cb..1b64927bcbf 100644 --- a/service/databasemigrationservice/api_op_DescribeEvents.go +++ b/service/databasemigrationservice/api_op_DescribeEvents.go @@ -4,6 +4,7 @@ package databasemigrationservice import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/databasemigrationservice/types" @@ -144,6 +145,84 @@ func addOperationDescribeEventsMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeEventsPaginator returns a new DescribeEventsPaginator +func NewDescribeEventsPaginator(client DescribeEventsAPIClient, params *DescribeEventsInput, optFns ...func(*DescribeEventsPaginatorOptions)) *DescribeEventsPaginator { + options := DescribeEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEventsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEvents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/databasemigrationservice/api_op_DescribeOrderableReplicationInstances.go b/service/databasemigrationservice/api_op_DescribeOrderableReplicationInstances.go index b1da06c3f0b..41f9b1125e6 100644 --- a/service/databasemigrationservice/api_op_DescribeOrderableReplicationInstances.go +++ b/service/databasemigrationservice/api_op_DescribeOrderableReplicationInstances.go @@ -4,6 +4,7 @@ package databasemigrationservice import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/databasemigrationservice/types" @@ -115,6 +116,86 @@ func addOperationDescribeOrderableReplicationInstancesMiddlewares(stack *middlew return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeOrderableReplicationInstancesPaginator returns a new +// DescribeOrderableReplicationInstancesPaginator +func NewDescribeOrderableReplicationInstancesPaginator(client DescribeOrderableReplicationInstancesAPIClient, params *DescribeOrderableReplicationInstancesInput, optFns ...func(*DescribeOrderableReplicationInstancesPaginatorOptions)) *DescribeOrderableReplicationInstancesPaginator { + options := DescribeOrderableReplicationInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeOrderableReplicationInstancesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeOrderableReplicationInstances(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/databasemigrationservice/api_op_DescribePendingMaintenanceActions.go b/service/databasemigrationservice/api_op_DescribePendingMaintenanceActions.go index 05f9e991f5d..ead973a7e50 100644 --- a/service/databasemigrationservice/api_op_DescribePendingMaintenanceActions.go +++ b/service/databasemigrationservice/api_op_DescribePendingMaintenanceActions.go @@ -4,6 +4,7 @@ package databasemigrationservice import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/databasemigrationservice/types" @@ -123,6 +124,86 @@ func addOperationDescribePendingMaintenanceActionsMiddlewares(stack *middleware. return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribePendingMaintenanceActionsPaginator returns a new +// DescribePendingMaintenanceActionsPaginator +func NewDescribePendingMaintenanceActionsPaginator(client DescribePendingMaintenanceActionsAPIClient, params *DescribePendingMaintenanceActionsInput, optFns ...func(*DescribePendingMaintenanceActionsPaginatorOptions)) *DescribePendingMaintenanceActionsPaginator { + options := DescribePendingMaintenanceActionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribePendingMaintenanceActionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribePendingMaintenanceActions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/databasemigrationservice/api_op_DescribeReplicationInstanceTaskLogs.go b/service/databasemigrationservice/api_op_DescribeReplicationInstanceTaskLogs.go index 63668ef389e..8a081faedcc 100644 --- a/service/databasemigrationservice/api_op_DescribeReplicationInstanceTaskLogs.go +++ b/service/databasemigrationservice/api_op_DescribeReplicationInstanceTaskLogs.go @@ -4,6 +4,7 @@ package databasemigrationservice import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/databasemigrationservice/types" @@ -124,6 +125,86 @@ func addOperationDescribeReplicationInstanceTaskLogsMiddlewares(stack *middlewar return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeReplicationInstanceTaskLogsPaginator returns a new +// DescribeReplicationInstanceTaskLogsPaginator +func NewDescribeReplicationInstanceTaskLogsPaginator(client DescribeReplicationInstanceTaskLogsAPIClient, params *DescribeReplicationInstanceTaskLogsInput, optFns ...func(*DescribeReplicationInstanceTaskLogsPaginatorOptions)) *DescribeReplicationInstanceTaskLogsPaginator { + options := DescribeReplicationInstanceTaskLogsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeReplicationInstanceTaskLogsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeReplicationInstanceTaskLogs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/databasemigrationservice/api_op_DescribeReplicationInstances.go b/service/databasemigrationservice/api_op_DescribeReplicationInstances.go index bc31472e6b2..294379defb4 100644 --- a/service/databasemigrationservice/api_op_DescribeReplicationInstances.go +++ b/service/databasemigrationservice/api_op_DescribeReplicationInstances.go @@ -4,6 +4,7 @@ package databasemigrationservice import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/databasemigrationservice/types" @@ -123,6 +124,86 @@ func addOperationDescribeReplicationInstancesMiddlewares(stack *middleware.Stack return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeReplicationInstancesPaginator returns a new +// DescribeReplicationInstancesPaginator +func NewDescribeReplicationInstancesPaginator(client DescribeReplicationInstancesAPIClient, params *DescribeReplicationInstancesInput, optFns ...func(*DescribeReplicationInstancesPaginatorOptions)) *DescribeReplicationInstancesPaginator { + options := DescribeReplicationInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeReplicationInstancesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeReplicationInstances(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/databasemigrationservice/api_op_DescribeReplicationSubnetGroups.go b/service/databasemigrationservice/api_op_DescribeReplicationSubnetGroups.go index 3997b4ac3bd..2abd4f023ac 100644 --- a/service/databasemigrationservice/api_op_DescribeReplicationSubnetGroups.go +++ b/service/databasemigrationservice/api_op_DescribeReplicationSubnetGroups.go @@ -4,6 +4,7 @@ package databasemigrationservice import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/databasemigrationservice/types" @@ -121,6 +122,86 @@ func addOperationDescribeReplicationSubnetGroupsMiddlewares(stack *middleware.St return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeReplicationSubnetGroupsPaginator returns a new +// DescribeReplicationSubnetGroupsPaginator +func NewDescribeReplicationSubnetGroupsPaginator(client DescribeReplicationSubnetGroupsAPIClient, params *DescribeReplicationSubnetGroupsInput, optFns ...func(*DescribeReplicationSubnetGroupsPaginatorOptions)) *DescribeReplicationSubnetGroupsPaginator { + options := DescribeReplicationSubnetGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeReplicationSubnetGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeReplicationSubnetGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/databasemigrationservice/api_op_DescribeReplicationTaskAssessmentResults.go b/service/databasemigrationservice/api_op_DescribeReplicationTaskAssessmentResults.go index 5cbf01049fc..8ca2e0c1eb3 100644 --- a/service/databasemigrationservice/api_op_DescribeReplicationTaskAssessmentResults.go +++ b/service/databasemigrationservice/api_op_DescribeReplicationTaskAssessmentResults.go @@ -4,6 +4,7 @@ package databasemigrationservice import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/databasemigrationservice/types" @@ -123,6 +124,86 @@ func addOperationDescribeReplicationTaskAssessmentResultsMiddlewares(stack *midd return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeReplicationTaskAssessmentResultsPaginator returns a new +// DescribeReplicationTaskAssessmentResultsPaginator +func NewDescribeReplicationTaskAssessmentResultsPaginator(client DescribeReplicationTaskAssessmentResultsAPIClient, params *DescribeReplicationTaskAssessmentResultsInput, optFns ...func(*DescribeReplicationTaskAssessmentResultsPaginatorOptions)) *DescribeReplicationTaskAssessmentResultsPaginator { + options := DescribeReplicationTaskAssessmentResultsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeReplicationTaskAssessmentResultsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeReplicationTaskAssessmentResults(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/databasemigrationservice/api_op_DescribeReplicationTaskAssessmentRuns.go b/service/databasemigrationservice/api_op_DescribeReplicationTaskAssessmentRuns.go index 21364726021..4cc73dba903 100644 --- a/service/databasemigrationservice/api_op_DescribeReplicationTaskAssessmentRuns.go +++ b/service/databasemigrationservice/api_op_DescribeReplicationTaskAssessmentRuns.go @@ -4,6 +4,7 @@ package databasemigrationservice import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/databasemigrationservice/types" @@ -127,6 +128,85 @@ func addOperationDescribeReplicationTaskAssessmentRunsMiddlewares(stack *middlew return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeReplicationTaskAssessmentRunsPaginator returns a new +// DescribeReplicationTaskAssessmentRunsPaginator +func NewDescribeReplicationTaskAssessmentRunsPaginator(client DescribeReplicationTaskAssessmentRunsAPIClient, params *DescribeReplicationTaskAssessmentRunsInput, optFns ...func(*DescribeReplicationTaskAssessmentRunsPaginatorOptions)) *DescribeReplicationTaskAssessmentRunsPaginator { + options := DescribeReplicationTaskAssessmentRunsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeReplicationTaskAssessmentRunsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeReplicationTaskAssessmentRuns(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/databasemigrationservice/api_op_DescribeReplicationTaskIndividualAssessments.go b/service/databasemigrationservice/api_op_DescribeReplicationTaskIndividualAssessments.go index 55d9c5aee50..8d394a8669d 100644 --- a/service/databasemigrationservice/api_op_DescribeReplicationTaskIndividualAssessments.go +++ b/service/databasemigrationservice/api_op_DescribeReplicationTaskIndividualAssessments.go @@ -4,6 +4,7 @@ package databasemigrationservice import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/databasemigrationservice/types" @@ -124,6 +125,85 @@ func addOperationDescribeReplicationTaskIndividualAssessmentsMiddlewares(stack * return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeReplicationTaskIndividualAssessmentsPaginator returns a new +// DescribeReplicationTaskIndividualAssessmentsPaginator +func NewDescribeReplicationTaskIndividualAssessmentsPaginator(client DescribeReplicationTaskIndividualAssessmentsAPIClient, params *DescribeReplicationTaskIndividualAssessmentsInput, optFns ...func(*DescribeReplicationTaskIndividualAssessmentsPaginatorOptions)) *DescribeReplicationTaskIndividualAssessmentsPaginator { + options := DescribeReplicationTaskIndividualAssessmentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeReplicationTaskIndividualAssessmentsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeReplicationTaskIndividualAssessments(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/databasemigrationservice/api_op_DescribeReplicationTasks.go b/service/databasemigrationservice/api_op_DescribeReplicationTasks.go index 051d8da3e1d..da8b3d34d19 100644 --- a/service/databasemigrationservice/api_op_DescribeReplicationTasks.go +++ b/service/databasemigrationservice/api_op_DescribeReplicationTasks.go @@ -4,6 +4,7 @@ package databasemigrationservice import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/databasemigrationservice/types" @@ -127,6 +128,86 @@ func addOperationDescribeReplicationTasksMiddlewares(stack *middleware.Stack, op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeReplicationTasksPaginator returns a new +// DescribeReplicationTasksPaginator +func NewDescribeReplicationTasksPaginator(client DescribeReplicationTasksAPIClient, params *DescribeReplicationTasksInput, optFns ...func(*DescribeReplicationTasksPaginatorOptions)) *DescribeReplicationTasksPaginator { + options := DescribeReplicationTasksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeReplicationTasksInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeReplicationTasks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/databasemigrationservice/api_op_DescribeSchemas.go b/service/databasemigrationservice/api_op_DescribeSchemas.go index 6723b6a571d..ba493df11a4 100644 --- a/service/databasemigrationservice/api_op_DescribeSchemas.go +++ b/service/databasemigrationservice/api_op_DescribeSchemas.go @@ -4,6 +4,7 @@ package databasemigrationservice import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -121,6 +122,84 @@ func addOperationDescribeSchemasMiddlewares(stack *middleware.Stack, options Opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeSchemasPaginator returns a new DescribeSchemasPaginator +func NewDescribeSchemasPaginator(client DescribeSchemasAPIClient, params *DescribeSchemasInput, optFns ...func(*DescribeSchemasPaginatorOptions)) *DescribeSchemasPaginator { + options := DescribeSchemasPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeSchemasInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeSchemas(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/databasemigrationservice/api_op_DescribeTableStatistics.go b/service/databasemigrationservice/api_op_DescribeTableStatistics.go index b1620f1318c..5ffb409a565 100644 --- a/service/databasemigrationservice/api_op_DescribeTableStatistics.go +++ b/service/databasemigrationservice/api_op_DescribeTableStatistics.go @@ -4,6 +4,7 @@ package databasemigrationservice import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/databasemigrationservice/types" @@ -134,6 +135,86 @@ func addOperationDescribeTableStatisticsMiddlewares(stack *middleware.Stack, opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeTableStatisticsPaginator returns a new +// DescribeTableStatisticsPaginator +func NewDescribeTableStatisticsPaginator(client DescribeTableStatisticsAPIClient, params *DescribeTableStatisticsInput, optFns ...func(*DescribeTableStatisticsPaginatorOptions)) *DescribeTableStatisticsPaginator { + options := DescribeTableStatisticsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeTableStatisticsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeTableStatistics(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/databasemigrationservice/go.mod b/service/databasemigrationservice/go.mod index 13ede71f3d4..da5577b21c2 100644 --- a/service/databasemigrationservice/go.mod +++ b/service/databasemigrationservice/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/databasemigrationservice/go.sum b/service/databasemigrationservice/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/databasemigrationservice/go.sum +++ b/service/databasemigrationservice/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index a50738e0eb1..00000000000 --- a/service/databasemigrationservice/paginators.go +++ /dev/null @@ -1,1436 +0,0 @@ -// 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/api_op_ListDataSetRevisions.go b/service/dataexchange/api_op_ListDataSetRevisions.go index df5deb9955f..fda11b5ac8c 100644 --- a/service/dataexchange/api_op_ListDataSetRevisions.go +++ b/service/dataexchange/api_op_ListDataSetRevisions.go @@ -4,6 +4,7 @@ package dataexchange import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/dataexchange/types" @@ -116,6 +117,82 @@ func addOperationListDataSetRevisionsMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDataSetRevisionsPaginator returns a new ListDataSetRevisionsPaginator +func NewListDataSetRevisionsPaginator(client ListDataSetRevisionsAPIClient, params *ListDataSetRevisionsInput, optFns ...func(*ListDataSetRevisionsPaginatorOptions)) *ListDataSetRevisionsPaginator { + options := ListDataSetRevisionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDataSetRevisionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDataSetRevisions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/dataexchange/api_op_ListDataSets.go b/service/dataexchange/api_op_ListDataSets.go index a4bfa18ea36..fc50c3f2c88 100644 --- a/service/dataexchange/api_op_ListDataSets.go +++ b/service/dataexchange/api_op_ListDataSets.go @@ -4,6 +4,7 @@ package dataexchange import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/dataexchange/types" @@ -113,6 +114,80 @@ func addOperationListDataSetsMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDataSetsPaginator returns a new ListDataSetsPaginator +func NewListDataSetsPaginator(client ListDataSetsAPIClient, params *ListDataSetsInput, optFns ...func(*ListDataSetsPaginatorOptions)) *ListDataSetsPaginator { + options := ListDataSetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDataSetsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDataSets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/dataexchange/api_op_ListJobs.go b/service/dataexchange/api_op_ListJobs.go index ed477c4f529..c974fa50d4c 100644 --- a/service/dataexchange/api_op_ListJobs.go +++ b/service/dataexchange/api_op_ListJobs.go @@ -4,6 +4,7 @@ package dataexchange import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/dataexchange/types" @@ -113,6 +114,80 @@ func addOperationListJobsMiddlewares(stack *middleware.Stack, options Options) ( return 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 a single call. + Limit *int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListJobsPaginator returns a new ListJobsPaginator +func NewListJobsPaginator(client ListJobsAPIClient, params *ListJobsInput, optFns ...func(*ListJobsPaginatorOptions)) *ListJobsPaginator { + options := ListJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListJobsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/dataexchange/api_op_ListRevisionAssets.go b/service/dataexchange/api_op_ListRevisionAssets.go index b115be83eb5..eb0d332a0c5 100644 --- a/service/dataexchange/api_op_ListRevisionAssets.go +++ b/service/dataexchange/api_op_ListRevisionAssets.go @@ -4,6 +4,7 @@ package dataexchange import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/dataexchange/types" @@ -121,6 +122,82 @@ func addOperationListRevisionAssetsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListRevisionAssetsPaginator returns a new ListRevisionAssetsPaginator +func NewListRevisionAssetsPaginator(client ListRevisionAssetsAPIClient, params *ListRevisionAssetsInput, optFns ...func(*ListRevisionAssetsPaginatorOptions)) *ListRevisionAssetsPaginator { + options := ListRevisionAssetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRevisionAssetsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRevisionAssets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/dataexchange/go.mod b/service/dataexchange/go.mod index ede3b890782..155e0a8d7c9 100644 --- a/service/dataexchange/go.mod +++ b/service/dataexchange/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/dataexchange/go.sum b/service/dataexchange/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/dataexchange/go.sum +++ b/service/dataexchange/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index b649d90827f..00000000000 --- a/service/dataexchange/paginators.go +++ /dev/null @@ -1,308 +0,0 @@ -// 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/api_op_DescribeObjects.go b/service/datapipeline/api_op_DescribeObjects.go index 66f30862b2c..3bfeb6c5a0c 100644 --- a/service/datapipeline/api_op_DescribeObjects.go +++ b/service/datapipeline/api_op_DescribeObjects.go @@ -4,6 +4,7 @@ package datapipeline import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/datapipeline/types" @@ -134,6 +135,77 @@ func addOperationDescribeObjectsMiddlewares(stack *middleware.Stack, options Opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeObjectsPaginator returns a new DescribeObjectsPaginator +func NewDescribeObjectsPaginator(client DescribeObjectsAPIClient, params *DescribeObjectsInput, optFns ...func(*DescribeObjectsPaginatorOptions)) *DescribeObjectsPaginator { + options := DescribeObjectsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeObjectsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeObjects(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/datapipeline/api_op_ListPipelines.go b/service/datapipeline/api_op_ListPipelines.go index 48d1f720137..ec5d5941f03 100644 --- a/service/datapipeline/api_op_ListPipelines.go +++ b/service/datapipeline/api_op_ListPipelines.go @@ -4,6 +4,7 @@ package datapipeline import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/datapipeline/types" @@ -118,6 +119,76 @@ func addOperationListPipelinesMiddlewares(stack *middleware.Stack, options Optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListPipelinesPaginator returns a new ListPipelinesPaginator +func NewListPipelinesPaginator(client ListPipelinesAPIClient, params *ListPipelinesInput, optFns ...func(*ListPipelinesPaginatorOptions)) *ListPipelinesPaginator { + options := ListPipelinesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPipelinesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPipelines(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/datapipeline/api_op_QueryObjects.go b/service/datapipeline/api_op_QueryObjects.go index 5d90d772ca9..380a2c8f81a 100644 --- a/service/datapipeline/api_op_QueryObjects.go +++ b/service/datapipeline/api_op_QueryObjects.go @@ -4,6 +4,7 @@ package datapipeline import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/datapipeline/types" @@ -138,6 +139,81 @@ func addOperationQueryObjectsMiddlewares(stack *middleware.Stack, options Option return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewQueryObjectsPaginator returns a new QueryObjectsPaginator +func NewQueryObjectsPaginator(client QueryObjectsAPIClient, params *QueryObjectsInput, optFns ...func(*QueryObjectsPaginatorOptions)) *QueryObjectsPaginator { + options := QueryObjectsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &QueryObjectsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opQueryObjects(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/datapipeline/go.mod b/service/datapipeline/go.mod index 1fe228314ca..ea39f068255 100644 --- a/service/datapipeline/go.mod +++ b/service/datapipeline/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/datapipeline/go.sum b/service/datapipeline/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/datapipeline/go.sum +++ b/service/datapipeline/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index a7f6bb135f3..00000000000 --- a/service/datapipeline/paginators.go +++ /dev/null @@ -1,224 +0,0 @@ -// 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/api_op_ListAgents.go b/service/datasync/api_op_ListAgents.go index 767bba3a6f3..1eb0c03e9ee 100644 --- a/service/datasync/api_op_ListAgents.go +++ b/service/datasync/api_op_ListAgents.go @@ -4,6 +4,7 @@ package datasync import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/datasync/types" @@ -116,6 +117,80 @@ func addOperationListAgentsMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAgentsPaginator returns a new ListAgentsPaginator +func NewListAgentsPaginator(client ListAgentsAPIClient, params *ListAgentsInput, optFns ...func(*ListAgentsPaginatorOptions)) *ListAgentsPaginator { + options := ListAgentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAgentsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAgents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/datasync/api_op_ListLocations.go b/service/datasync/api_op_ListLocations.go index 8458c32b944..55863bf2831 100644 --- a/service/datasync/api_op_ListLocations.go +++ b/service/datasync/api_op_ListLocations.go @@ -4,6 +4,7 @@ package datasync import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/datasync/types" @@ -120,6 +121,80 @@ func addOperationListLocationsMiddlewares(stack *middleware.Stack, options Optio return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListLocationsPaginator returns a new ListLocationsPaginator +func NewListLocationsPaginator(client ListLocationsAPIClient, params *ListLocationsInput, optFns ...func(*ListLocationsPaginatorOptions)) *ListLocationsPaginator { + options := ListLocationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListLocationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListLocations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/datasync/api_op_ListTagsForResource.go b/service/datasync/api_op_ListTagsForResource.go index 60cf8493523..1c747c10fd6 100644 --- a/service/datasync/api_op_ListTagsForResource.go +++ b/service/datasync/api_op_ListTagsForResource.go @@ -4,6 +4,7 @@ package datasync import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/datasync/types" @@ -117,6 +118,82 @@ func addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator +func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator { + options := ListTagsForResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTagsForResourceInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/datasync/api_op_ListTaskExecutions.go b/service/datasync/api_op_ListTaskExecutions.go index aa40802a741..04c101d2333 100644 --- a/service/datasync/api_op_ListTaskExecutions.go +++ b/service/datasync/api_op_ListTaskExecutions.go @@ -4,6 +4,7 @@ package datasync import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/datasync/types" @@ -112,6 +113,82 @@ func addOperationListTaskExecutionsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTaskExecutionsPaginator returns a new ListTaskExecutionsPaginator +func NewListTaskExecutionsPaginator(client ListTaskExecutionsAPIClient, params *ListTaskExecutionsInput, optFns ...func(*ListTaskExecutionsPaginatorOptions)) *ListTaskExecutionsPaginator { + options := ListTaskExecutionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTaskExecutionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTaskExecutions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/datasync/api_op_ListTasks.go b/service/datasync/api_op_ListTasks.go index acb6a880b7b..699b59bd627 100644 --- a/service/datasync/api_op_ListTasks.go +++ b/service/datasync/api_op_ListTasks.go @@ -4,6 +4,7 @@ package datasync import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/datasync/types" @@ -118,6 +119,80 @@ func addOperationListTasksMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTasksPaginator returns a new ListTasksPaginator +func NewListTasksPaginator(client ListTasksAPIClient, params *ListTasksInput, optFns ...func(*ListTasksPaginatorOptions)) *ListTasksPaginator { + options := ListTasksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTasksInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTasks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/datasync/go.mod b/service/datasync/go.mod index a1ba71e25b6..b77ee27231a 100644 --- a/service/datasync/go.mod +++ b/service/datasync/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/datasync/go.sum b/service/datasync/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/datasync/go.sum +++ b/service/datasync/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 0d4bb29a600..00000000000 --- a/service/datasync/paginators.go +++ /dev/null @@ -1,382 +0,0 @@ -// 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.mod b/service/dax/go.mod index 7f975f2e1eb..b8f99cd8941 100644 --- a/service/dax/go.mod +++ b/service/dax/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/dax/go.sum b/service/dax/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/dax/go.sum +++ b/service/dax/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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/api_op_ListGraphs.go b/service/detective/api_op_ListGraphs.go index 210f03d013c..e0046480af5 100644 --- a/service/detective/api_op_ListGraphs.go +++ b/service/detective/api_op_ListGraphs.go @@ -4,6 +4,7 @@ package detective import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/detective/types" @@ -112,6 +113,81 @@ func addOperationListGraphsMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListGraphsPaginator returns a new ListGraphsPaginator +func NewListGraphsPaginator(client ListGraphsAPIClient, params *ListGraphsInput, optFns ...func(*ListGraphsPaginatorOptions)) *ListGraphsPaginator { + options := ListGraphsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListGraphsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListGraphs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/detective/api_op_ListInvitations.go b/service/detective/api_op_ListInvitations.go index 9b3a66bbcc3..789fdfd61c2 100644 --- a/service/detective/api_op_ListInvitations.go +++ b/service/detective/api_op_ListInvitations.go @@ -4,6 +4,7 @@ package detective import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/detective/types" @@ -116,6 +117,83 @@ func addOperationListInvitationsMiddlewares(stack *middleware.Stack, options Opt return 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 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListInvitationsPaginator returns a new ListInvitationsPaginator +func NewListInvitationsPaginator(client ListInvitationsAPIClient, params *ListInvitationsInput, optFns ...func(*ListInvitationsPaginatorOptions)) *ListInvitationsPaginator { + options := ListInvitationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListInvitationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListInvitations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/detective/api_op_ListMembers.go b/service/detective/api_op_ListMembers.go index b0d7732c27f..5f8478cccfe 100644 --- a/service/detective/api_op_ListMembers.go +++ b/service/detective/api_op_ListMembers.go @@ -4,6 +4,7 @@ package detective import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/detective/types" @@ -122,6 +123,82 @@ func addOperationListMembersMiddlewares(stack *middleware.Stack, options Options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListMembersPaginator returns a new ListMembersPaginator +func NewListMembersPaginator(client ListMembersAPIClient, params *ListMembersInput, optFns ...func(*ListMembersPaginatorOptions)) *ListMembersPaginator { + options := ListMembersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListMembersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListMembers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/detective/go.mod b/service/detective/go.mod index 6e9b1aaa437..ab25016f041 100644 --- a/service/detective/go.mod +++ b/service/detective/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/detective/go.sum b/service/detective/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/detective/go.sum +++ b/service/detective/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 5a3f10b5808..00000000000 --- a/service/detective/paginators.go +++ /dev/null @@ -1,236 +0,0 @@ -// 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/api_op_GetOfferingStatus.go b/service/devicefarm/api_op_GetOfferingStatus.go index 256c8977e66..c4207a5f760 100644 --- a/service/devicefarm/api_op_GetOfferingStatus.go +++ b/service/devicefarm/api_op_GetOfferingStatus.go @@ -4,6 +4,7 @@ package devicefarm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/devicefarm/types" @@ -115,6 +116,77 @@ func addOperationGetOfferingStatusMiddlewares(stack *middleware.Stack, options O return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetOfferingStatusPaginator returns a new GetOfferingStatusPaginator +func NewGetOfferingStatusPaginator(client GetOfferingStatusAPIClient, params *GetOfferingStatusInput, optFns ...func(*GetOfferingStatusPaginatorOptions)) *GetOfferingStatusPaginator { + options := GetOfferingStatusPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetOfferingStatusInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetOfferingStatus(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/devicefarm/api_op_ListArtifacts.go b/service/devicefarm/api_op_ListArtifacts.go index 1f5b28a8fbb..2cda85c106f 100644 --- a/service/devicefarm/api_op_ListArtifacts.go +++ b/service/devicefarm/api_op_ListArtifacts.go @@ -4,6 +4,7 @@ package devicefarm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/devicefarm/types" @@ -126,6 +127,76 @@ func addOperationListArtifactsMiddlewares(stack *middleware.Stack, options Optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListArtifactsPaginator returns a new ListArtifactsPaginator +func NewListArtifactsPaginator(client ListArtifactsAPIClient, params *ListArtifactsInput, optFns ...func(*ListArtifactsPaginatorOptions)) *ListArtifactsPaginator { + options := ListArtifactsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListArtifactsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListArtifacts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/devicefarm/api_op_ListDevicePools.go b/service/devicefarm/api_op_ListDevicePools.go index d1bd383da55..7e7ff7403c7 100644 --- a/service/devicefarm/api_op_ListDevicePools.go +++ b/service/devicefarm/api_op_ListDevicePools.go @@ -4,6 +4,7 @@ package devicefarm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/devicefarm/types" @@ -124,6 +125,77 @@ func addOperationListDevicePoolsMiddlewares(stack *middleware.Stack, options Opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDevicePoolsPaginator returns a new ListDevicePoolsPaginator +func NewListDevicePoolsPaginator(client ListDevicePoolsAPIClient, params *ListDevicePoolsInput, optFns ...func(*ListDevicePoolsPaginatorOptions)) *ListDevicePoolsPaginator { + options := ListDevicePoolsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDevicePoolsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDevicePools(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/devicefarm/api_op_ListDevices.go b/service/devicefarm/api_op_ListDevices.go index b75fb042b63..d1c62933a14 100644 --- a/service/devicefarm/api_op_ListDevices.go +++ b/service/devicefarm/api_op_ListDevices.go @@ -4,6 +4,7 @@ package devicefarm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/devicefarm/types" @@ -185,6 +186,76 @@ func addOperationListDevicesMiddlewares(stack *middleware.Stack, options Options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDevicesPaginator returns a new ListDevicesPaginator +func NewListDevicesPaginator(client ListDevicesAPIClient, params *ListDevicesInput, optFns ...func(*ListDevicesPaginatorOptions)) *ListDevicesPaginator { + options := ListDevicesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDevicesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDevices(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/devicefarm/api_op_ListJobs.go b/service/devicefarm/api_op_ListJobs.go index 679af4174e5..4a4bcf205da 100644 --- a/service/devicefarm/api_op_ListJobs.go +++ b/service/devicefarm/api_op_ListJobs.go @@ -4,6 +4,7 @@ package devicefarm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/devicefarm/types" @@ -115,6 +116,76 @@ func addOperationListJobsMiddlewares(stack *middleware.Stack, options Options) ( return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListJobsPaginator returns a new ListJobsPaginator +func NewListJobsPaginator(client ListJobsAPIClient, params *ListJobsInput, optFns ...func(*ListJobsPaginatorOptions)) *ListJobsPaginator { + options := ListJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListJobsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/devicefarm/api_op_ListOfferingTransactions.go b/service/devicefarm/api_op_ListOfferingTransactions.go index 2090f6a1dba..63cccf07f9a 100644 --- a/service/devicefarm/api_op_ListOfferingTransactions.go +++ b/service/devicefarm/api_op_ListOfferingTransactions.go @@ -4,6 +4,7 @@ package devicefarm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/devicefarm/types" @@ -112,6 +113,79 @@ func addOperationListOfferingTransactionsMiddlewares(stack *middleware.Stack, op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListOfferingTransactionsPaginator returns a new +// ListOfferingTransactionsPaginator +func NewListOfferingTransactionsPaginator(client ListOfferingTransactionsAPIClient, params *ListOfferingTransactionsInput, optFns ...func(*ListOfferingTransactionsPaginatorOptions)) *ListOfferingTransactionsPaginator { + options := ListOfferingTransactionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListOfferingTransactionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListOfferingTransactions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/devicefarm/api_op_ListOfferings.go b/service/devicefarm/api_op_ListOfferings.go index 403abc8ee1a..5e235bc15db 100644 --- a/service/devicefarm/api_op_ListOfferings.go +++ b/service/devicefarm/api_op_ListOfferings.go @@ -4,6 +4,7 @@ package devicefarm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/devicefarm/types" @@ -111,6 +112,76 @@ func addOperationListOfferingsMiddlewares(stack *middleware.Stack, options Optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListOfferingsPaginator returns a new ListOfferingsPaginator +func NewListOfferingsPaginator(client ListOfferingsAPIClient, params *ListOfferingsInput, optFns ...func(*ListOfferingsPaginatorOptions)) *ListOfferingsPaginator { + options := ListOfferingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListOfferingsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListOfferings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/devicefarm/api_op_ListProjects.go b/service/devicefarm/api_op_ListProjects.go index c040d4e52d4..21f472915f8 100644 --- a/service/devicefarm/api_op_ListProjects.go +++ b/service/devicefarm/api_op_ListProjects.go @@ -4,6 +4,7 @@ package devicefarm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/devicefarm/types" @@ -112,6 +113,76 @@ func addOperationListProjectsMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListProjectsPaginator returns a new ListProjectsPaginator +func NewListProjectsPaginator(client ListProjectsAPIClient, params *ListProjectsInput, optFns ...func(*ListProjectsPaginatorOptions)) *ListProjectsPaginator { + options := ListProjectsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListProjectsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListProjects(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/devicefarm/api_op_ListRuns.go b/service/devicefarm/api_op_ListRuns.go index 616efa43e32..5d7e26cb551 100644 --- a/service/devicefarm/api_op_ListRuns.go +++ b/service/devicefarm/api_op_ListRuns.go @@ -4,6 +4,7 @@ package devicefarm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/devicefarm/types" @@ -115,6 +116,76 @@ func addOperationListRunsMiddlewares(stack *middleware.Stack, options Options) ( return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListRunsPaginator returns a new ListRunsPaginator +func NewListRunsPaginator(client ListRunsAPIClient, params *ListRunsInput, optFns ...func(*ListRunsPaginatorOptions)) *ListRunsPaginator { + options := ListRunsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRunsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRuns(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/devicefarm/api_op_ListSamples.go b/service/devicefarm/api_op_ListSamples.go index fee958b06fd..b53d9d00417 100644 --- a/service/devicefarm/api_op_ListSamples.go +++ b/service/devicefarm/api_op_ListSamples.go @@ -4,6 +4,7 @@ package devicefarm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/devicefarm/types" @@ -115,6 +116,76 @@ func addOperationListSamplesMiddlewares(stack *middleware.Stack, options Options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListSamplesPaginator returns a new ListSamplesPaginator +func NewListSamplesPaginator(client ListSamplesAPIClient, params *ListSamplesInput, optFns ...func(*ListSamplesPaginatorOptions)) *ListSamplesPaginator { + options := ListSamplesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSamplesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSamples(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/devicefarm/api_op_ListSuites.go b/service/devicefarm/api_op_ListSuites.go index 408736e9713..f680661d6ac 100644 --- a/service/devicefarm/api_op_ListSuites.go +++ b/service/devicefarm/api_op_ListSuites.go @@ -4,6 +4,7 @@ package devicefarm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/devicefarm/types" @@ -115,6 +116,76 @@ func addOperationListSuitesMiddlewares(stack *middleware.Stack, options Options) return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListSuitesPaginator returns a new ListSuitesPaginator +func NewListSuitesPaginator(client ListSuitesAPIClient, params *ListSuitesInput, optFns ...func(*ListSuitesPaginatorOptions)) *ListSuitesPaginator { + options := ListSuitesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSuitesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSuites(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/devicefarm/api_op_ListTestGridProjects.go b/service/devicefarm/api_op_ListTestGridProjects.go index 406a0368276..66db4a77398 100644 --- a/service/devicefarm/api_op_ListTestGridProjects.go +++ b/service/devicefarm/api_op_ListTestGridProjects.go @@ -4,6 +4,7 @@ package devicefarm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/devicefarm/types" @@ -106,6 +107,82 @@ func addOperationListTestGridProjectsMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTestGridProjectsPaginator returns a new ListTestGridProjectsPaginator +func NewListTestGridProjectsPaginator(client ListTestGridProjectsAPIClient, params *ListTestGridProjectsInput, optFns ...func(*ListTestGridProjectsPaginatorOptions)) *ListTestGridProjectsPaginator { + options := ListTestGridProjectsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTestGridProjectsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTestGridProjects(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/devicefarm/api_op_ListTestGridSessionActions.go b/service/devicefarm/api_op_ListTestGridSessionActions.go index 00a560c99c1..c98d6e61712 100644 --- a/service/devicefarm/api_op_ListTestGridSessionActions.go +++ b/service/devicefarm/api_op_ListTestGridSessionActions.go @@ -4,6 +4,7 @@ package devicefarm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/devicefarm/types" @@ -113,6 +114,83 @@ func addOperationListTestGridSessionActionsMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTestGridSessionActionsPaginator returns a new +// ListTestGridSessionActionsPaginator +func NewListTestGridSessionActionsPaginator(client ListTestGridSessionActionsAPIClient, params *ListTestGridSessionActionsInput, optFns ...func(*ListTestGridSessionActionsPaginatorOptions)) *ListTestGridSessionActionsPaginator { + options := ListTestGridSessionActionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTestGridSessionActionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTestGridSessionActions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/devicefarm/api_op_ListTestGridSessionArtifacts.go b/service/devicefarm/api_op_ListTestGridSessionArtifacts.go index 28612964178..466c19d2295 100644 --- a/service/devicefarm/api_op_ListTestGridSessionArtifacts.go +++ b/service/devicefarm/api_op_ListTestGridSessionArtifacts.go @@ -4,6 +4,7 @@ package devicefarm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/devicefarm/types" @@ -116,6 +117,83 @@ func addOperationListTestGridSessionArtifactsMiddlewares(stack *middleware.Stack return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTestGridSessionArtifactsPaginator returns a new +// ListTestGridSessionArtifactsPaginator +func NewListTestGridSessionArtifactsPaginator(client ListTestGridSessionArtifactsAPIClient, params *ListTestGridSessionArtifactsInput, optFns ...func(*ListTestGridSessionArtifactsPaginatorOptions)) *ListTestGridSessionArtifactsPaginator { + options := ListTestGridSessionArtifactsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTestGridSessionArtifactsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTestGridSessionArtifacts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/devicefarm/api_op_ListTestGridSessions.go b/service/devicefarm/api_op_ListTestGridSessions.go index 320b5d2632e..1bf94a156c7 100644 --- a/service/devicefarm/api_op_ListTestGridSessions.go +++ b/service/devicefarm/api_op_ListTestGridSessions.go @@ -4,6 +4,7 @@ package devicefarm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/devicefarm/types" @@ -129,6 +130,82 @@ func addOperationListTestGridSessionsMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTestGridSessionsPaginator returns a new ListTestGridSessionsPaginator +func NewListTestGridSessionsPaginator(client ListTestGridSessionsAPIClient, params *ListTestGridSessionsInput, optFns ...func(*ListTestGridSessionsPaginatorOptions)) *ListTestGridSessionsPaginator { + options := ListTestGridSessionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTestGridSessionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTestGridSessions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/devicefarm/api_op_ListTests.go b/service/devicefarm/api_op_ListTests.go index 05d9f70d007..50c6b16db64 100644 --- a/service/devicefarm/api_op_ListTests.go +++ b/service/devicefarm/api_op_ListTests.go @@ -4,6 +4,7 @@ package devicefarm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/devicefarm/types" @@ -115,6 +116,76 @@ func addOperationListTestsMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTestsPaginator returns a new ListTestsPaginator +func NewListTestsPaginator(client ListTestsAPIClient, params *ListTestsInput, optFns ...func(*ListTestsPaginatorOptions)) *ListTestsPaginator { + options := ListTestsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTestsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTests(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/devicefarm/api_op_ListUniqueProblems.go b/service/devicefarm/api_op_ListUniqueProblems.go index 0d8e2253000..5a89306cea1 100644 --- a/service/devicefarm/api_op_ListUniqueProblems.go +++ b/service/devicefarm/api_op_ListUniqueProblems.go @@ -4,6 +4,7 @@ package devicefarm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/devicefarm/types" @@ -134,6 +135,78 @@ func addOperationListUniqueProblemsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListUniqueProblemsPaginator returns a new ListUniqueProblemsPaginator +func NewListUniqueProblemsPaginator(client ListUniqueProblemsAPIClient, params *ListUniqueProblemsInput, optFns ...func(*ListUniqueProblemsPaginatorOptions)) *ListUniqueProblemsPaginator { + options := ListUniqueProblemsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListUniqueProblemsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListUniqueProblems(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/devicefarm/api_op_ListUploads.go b/service/devicefarm/api_op_ListUploads.go index 7dc52b87a6a..3bc64c1ccbd 100644 --- a/service/devicefarm/api_op_ListUploads.go +++ b/service/devicefarm/api_op_ListUploads.go @@ -4,6 +4,7 @@ package devicefarm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/devicefarm/types" @@ -196,6 +197,76 @@ func addOperationListUploadsMiddlewares(stack *middleware.Stack, options Options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListUploadsPaginator returns a new ListUploadsPaginator +func NewListUploadsPaginator(client ListUploadsAPIClient, params *ListUploadsInput, optFns ...func(*ListUploadsPaginatorOptions)) *ListUploadsPaginator { + options := ListUploadsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListUploadsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListUploads(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/devicefarm/go.mod b/service/devicefarm/go.mod index 05f6f758e26..6b542a400b2 100644 --- a/service/devicefarm/go.mod +++ b/service/devicefarm/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/devicefarm/go.sum b/service/devicefarm/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/devicefarm/go.sum +++ b/service/devicefarm/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 986ea05255e..00000000000 --- a/service/devicefarm/paginators.go +++ /dev/null @@ -1,1301 +0,0 @@ -// 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.mod b/service/directconnect/go.mod index c510b82e7d6..cf381a34dd9 100644 --- a/service/directconnect/go.mod +++ b/service/directconnect/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/directconnect/go.sum b/service/directconnect/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/directconnect/go.sum +++ b/service/directconnect/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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/api_op_DescribeDomainControllers.go b/service/directoryservice/api_op_DescribeDomainControllers.go index b1ab3306adf..bc2bee1ff64 100644 --- a/service/directoryservice/api_op_DescribeDomainControllers.go +++ b/service/directoryservice/api_op_DescribeDomainControllers.go @@ -4,6 +4,7 @@ package directoryservice import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/directoryservice/types" @@ -121,6 +122,83 @@ func addOperationDescribeDomainControllersMiddlewares(stack *middleware.Stack, o return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeDomainControllersPaginator returns a new +// DescribeDomainControllersPaginator +func NewDescribeDomainControllersPaginator(client DescribeDomainControllersAPIClient, params *DescribeDomainControllersInput, optFns ...func(*DescribeDomainControllersPaginatorOptions)) *DescribeDomainControllersPaginator { + options := DescribeDomainControllersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDomainControllersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDomainControllers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/directoryservice/go.mod b/service/directoryservice/go.mod index 6898ba344eb..7b883bad927 100644 --- a/service/directoryservice/go.mod +++ b/service/directoryservice/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/directoryservice/go.sum b/service/directoryservice/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/directoryservice/go.sum +++ b/service/directoryservice/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index a666685fde5..00000000000 --- a/service/directoryservice/paginators.go +++ /dev/null @@ -1,85 +0,0 @@ -// 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.mod b/service/dlm/go.mod index 910d4da6ba2..1e7867f4f22 100644 --- a/service/dlm/go.mod +++ b/service/dlm/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/dlm/go.sum b/service/dlm/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/dlm/go.sum +++ b/service/dlm/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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/api_op_DescribeCertificates.go b/service/docdb/api_op_DescribeCertificates.go index 94a04221490..5bdc956247e 100644 --- a/service/docdb/api_op_DescribeCertificates.go +++ b/service/docdb/api_op_DescribeCertificates.go @@ -4,6 +4,7 @@ package docdb import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/docdb/types" @@ -132,6 +133,89 @@ func addOperationDescribeCertificatesMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeCertificatesPaginator returns a new DescribeCertificatesPaginator +func NewDescribeCertificatesPaginator(client DescribeCertificatesAPIClient, params *DescribeCertificatesInput, optFns ...func(*DescribeCertificatesPaginatorOptions)) *DescribeCertificatesPaginator { + options := DescribeCertificatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeCertificatesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeCertificates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/docdb/api_op_DescribeDBClusterParameterGroups.go b/service/docdb/api_op_DescribeDBClusterParameterGroups.go index 05ff66e8245..502c65f383c 100644 --- a/service/docdb/api_op_DescribeDBClusterParameterGroups.go +++ b/service/docdb/api_op_DescribeDBClusterParameterGroups.go @@ -4,6 +4,7 @@ package docdb import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/docdb/types" @@ -129,6 +130,86 @@ func addOperationDescribeDBClusterParameterGroupsMiddlewares(stack *middleware.S return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeDBClusterParameterGroupsPaginator returns a new +// DescribeDBClusterParameterGroupsPaginator +func NewDescribeDBClusterParameterGroupsPaginator(client DescribeDBClusterParameterGroupsAPIClient, params *DescribeDBClusterParameterGroupsInput, optFns ...func(*DescribeDBClusterParameterGroupsPaginatorOptions)) *DescribeDBClusterParameterGroupsPaginator { + options := DescribeDBClusterParameterGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBClusterParameterGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBClusterParameterGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/docdb/api_op_DescribeDBClusterParameters.go b/service/docdb/api_op_DescribeDBClusterParameters.go index 378e41c3dad..53e5ed66b60 100644 --- a/service/docdb/api_op_DescribeDBClusterParameters.go +++ b/service/docdb/api_op_DescribeDBClusterParameters.go @@ -4,6 +4,7 @@ package docdb import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/docdb/types" @@ -133,6 +134,86 @@ func addOperationDescribeDBClusterParametersMiddlewares(stack *middleware.Stack, return 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 (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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeDBClusterParametersPaginator returns a new +// DescribeDBClusterParametersPaginator +func NewDescribeDBClusterParametersPaginator(client DescribeDBClusterParametersAPIClient, params *DescribeDBClusterParametersInput, optFns ...func(*DescribeDBClusterParametersPaginatorOptions)) *DescribeDBClusterParametersPaginator { + options := DescribeDBClusterParametersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBClusterParametersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBClusterParameters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/docdb/api_op_DescribeDBClusterSnapshots.go b/service/docdb/api_op_DescribeDBClusterSnapshots.go index d1e312166dd..0ccb65e55c2 100644 --- a/service/docdb/api_op_DescribeDBClusterSnapshots.go +++ b/service/docdb/api_op_DescribeDBClusterSnapshots.go @@ -4,6 +4,7 @@ package docdb import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/docdb/types" @@ -176,6 +177,86 @@ func addOperationDescribeDBClusterSnapshotsMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeDBClusterSnapshotsPaginator returns a new +// DescribeDBClusterSnapshotsPaginator +func NewDescribeDBClusterSnapshotsPaginator(client DescribeDBClusterSnapshotsAPIClient, params *DescribeDBClusterSnapshotsInput, optFns ...func(*DescribeDBClusterSnapshotsPaginatorOptions)) *DescribeDBClusterSnapshotsPaginator { + options := DescribeDBClusterSnapshotsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBClusterSnapshotsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBClusterSnapshots(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/docdb/api_op_DescribeDBClusters.go b/service/docdb/api_op_DescribeDBClusters.go index 8a96aa38a17..72ed397d69b 100644 --- a/service/docdb/api_op_DescribeDBClusters.go +++ b/service/docdb/api_op_DescribeDBClusters.go @@ -4,6 +4,7 @@ package docdb import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/docdb/types" @@ -138,6 +139,85 @@ func addOperationDescribeDBClustersMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeDBClustersPaginator returns a new DescribeDBClustersPaginator +func NewDescribeDBClustersPaginator(client DescribeDBClustersAPIClient, params *DescribeDBClustersInput, optFns ...func(*DescribeDBClustersPaginatorOptions)) *DescribeDBClustersPaginator { + options := DescribeDBClustersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBClustersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBClusters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/docdb/api_op_DescribeDBEngineVersions.go b/service/docdb/api_op_DescribeDBEngineVersions.go index 64afea738f4..6b128d06c38 100644 --- a/service/docdb/api_op_DescribeDBEngineVersions.go +++ b/service/docdb/api_op_DescribeDBEngineVersions.go @@ -4,6 +4,7 @@ package docdb import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/docdb/types" @@ -146,6 +147,86 @@ func addOperationDescribeDBEngineVersionsMiddlewares(stack *middleware.Stack, op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeDBEngineVersionsPaginator returns a new +// DescribeDBEngineVersionsPaginator +func NewDescribeDBEngineVersionsPaginator(client DescribeDBEngineVersionsAPIClient, params *DescribeDBEngineVersionsInput, optFns ...func(*DescribeDBEngineVersionsPaginatorOptions)) *DescribeDBEngineVersionsPaginator { + options := DescribeDBEngineVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBEngineVersionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBEngineVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/docdb/api_op_DescribeDBInstances.go b/service/docdb/api_op_DescribeDBInstances.go index 7a19972f6c5..04726f57478 100644 --- a/service/docdb/api_op_DescribeDBInstances.go +++ b/service/docdb/api_op_DescribeDBInstances.go @@ -4,6 +4,7 @@ package docdb import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/docdb/types" @@ -139,6 +140,85 @@ func addOperationDescribeDBInstancesMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeDBInstancesPaginator returns a new DescribeDBInstancesPaginator +func NewDescribeDBInstancesPaginator(client DescribeDBInstancesAPIClient, params *DescribeDBInstancesInput, optFns ...func(*DescribeDBInstancesPaginatorOptions)) *DescribeDBInstancesPaginator { + options := DescribeDBInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBInstancesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBInstances(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/docdb/api_op_DescribeDBSubnetGroups.go b/service/docdb/api_op_DescribeDBSubnetGroups.go index 97a18cfcc75..6cbc565dd16 100644 --- a/service/docdb/api_op_DescribeDBSubnetGroups.go +++ b/service/docdb/api_op_DescribeDBSubnetGroups.go @@ -4,6 +4,7 @@ package docdb import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/docdb/types" @@ -125,6 +126,85 @@ func addOperationDescribeDBSubnetGroupsMiddlewares(stack *middleware.Stack, opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeDBSubnetGroupsPaginator returns a new DescribeDBSubnetGroupsPaginator +func NewDescribeDBSubnetGroupsPaginator(client DescribeDBSubnetGroupsAPIClient, params *DescribeDBSubnetGroupsInput, optFns ...func(*DescribeDBSubnetGroupsPaginatorOptions)) *DescribeDBSubnetGroupsPaginator { + options := DescribeDBSubnetGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBSubnetGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBSubnetGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/docdb/api_op_DescribeEvents.go b/service/docdb/api_op_DescribeEvents.go index e3bac6dba83..363d1aaef11 100644 --- a/service/docdb/api_op_DescribeEvents.go +++ b/service/docdb/api_op_DescribeEvents.go @@ -4,6 +4,7 @@ package docdb import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/docdb/types" @@ -166,6 +167,84 @@ func addOperationDescribeEventsMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeEventsPaginator returns a new DescribeEventsPaginator +func NewDescribeEventsPaginator(client DescribeEventsAPIClient, params *DescribeEventsInput, optFns ...func(*DescribeEventsPaginatorOptions)) *DescribeEventsPaginator { + options := DescribeEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEventsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEvents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/docdb/api_op_DescribeOrderableDBInstanceOptions.go b/service/docdb/api_op_DescribeOrderableDBInstanceOptions.go index 316acdfe0b6..7cdcf5b3f84 100644 --- a/service/docdb/api_op_DescribeOrderableDBInstanceOptions.go +++ b/service/docdb/api_op_DescribeOrderableDBInstanceOptions.go @@ -4,6 +4,7 @@ package docdb import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/docdb/types" @@ -141,6 +142,86 @@ func addOperationDescribeOrderableDBInstanceOptionsMiddlewares(stack *middleware return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeOrderableDBInstanceOptionsPaginator returns a new +// DescribeOrderableDBInstanceOptionsPaginator +func NewDescribeOrderableDBInstanceOptionsPaginator(client DescribeOrderableDBInstanceOptionsAPIClient, params *DescribeOrderableDBInstanceOptionsInput, optFns ...func(*DescribeOrderableDBInstanceOptionsPaginatorOptions)) *DescribeOrderableDBInstanceOptionsPaginator { + options := DescribeOrderableDBInstanceOptionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeOrderableDBInstanceOptionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeOrderableDBInstanceOptions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/docdb/api_op_DescribePendingMaintenanceActions.go b/service/docdb/api_op_DescribePendingMaintenanceActions.go index 60e35951a4b..c19e4bc2d1e 100644 --- a/service/docdb/api_op_DescribePendingMaintenanceActions.go +++ b/service/docdb/api_op_DescribePendingMaintenanceActions.go @@ -4,6 +4,7 @@ package docdb import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/docdb/types" @@ -133,6 +134,86 @@ func addOperationDescribePendingMaintenanceActionsMiddlewares(stack *middleware. return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribePendingMaintenanceActionsPaginator returns a new +// DescribePendingMaintenanceActionsPaginator +func NewDescribePendingMaintenanceActionsPaginator(client DescribePendingMaintenanceActionsAPIClient, params *DescribePendingMaintenanceActionsInput, optFns ...func(*DescribePendingMaintenanceActionsPaginatorOptions)) *DescribePendingMaintenanceActionsPaginator { + options := DescribePendingMaintenanceActionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribePendingMaintenanceActionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribePendingMaintenanceActions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/docdb/go.mod b/service/docdb/go.mod index 0c1c4fb37b8..cecc5d01f03 100644 --- a/service/docdb/go.mod +++ b/service/docdb/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/docdb/go.sum b/service/docdb/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/docdb/go.sum +++ b/service/docdb/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 824374ca5bf..00000000000 --- a/service/docdb/paginators.go +++ /dev/null @@ -1,886 +0,0 @@ -// 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/api_op_ListContributorInsights.go b/service/dynamodb/api_op_ListContributorInsights.go index 636c0d0395a..46bbecc6b7e 100644 --- a/service/dynamodb/api_op_ListContributorInsights.go +++ b/service/dynamodb/api_op_ListContributorInsights.go @@ -4,6 +4,7 @@ package dynamodb import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" @@ -115,6 +116,83 @@ func addOperationListContributorInsightsMiddlewares(stack *middleware.Stack, opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListContributorInsightsPaginator returns a new +// ListContributorInsightsPaginator +func NewListContributorInsightsPaginator(client ListContributorInsightsAPIClient, params *ListContributorInsightsInput, optFns ...func(*ListContributorInsightsPaginatorOptions)) *ListContributorInsightsPaginator { + options := ListContributorInsightsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListContributorInsightsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListContributorInsights(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/dynamodb/api_op_ListTables.go b/service/dynamodb/api_op_ListTables.go index de0519c4985..5ef6f7d3347 100644 --- a/service/dynamodb/api_op_ListTables.go +++ b/service/dynamodb/api_op_ListTables.go @@ -4,6 +4,7 @@ package dynamodb import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -125,6 +126,81 @@ func addOperationListTablesMiddlewares(stack *middleware.Stack, options Options) return 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 { + // 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTablesPaginator returns a new ListTablesPaginator +func NewListTablesPaginator(client ListTablesAPIClient, params *ListTablesInput, optFns ...func(*ListTablesPaginatorOptions)) *ListTablesPaginator { + options := ListTablesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTablesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.LastEvaluatedTableName + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTables(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/dynamodb/go.mod b/service/dynamodb/go.mod index 4a1dcd7b9af..712fa920018 100644 --- a/service/dynamodb/go.mod +++ b/service/dynamodb/go.mod @@ -5,7 +5,7 @@ go 1.15 require ( github.com/aws/aws-sdk-go-v2 v0.29.0 github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v0.3.0 - github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/dynamodb/go.sum b/service/dynamodb/go.sum index c507b1ad6b5..4da19c9cd22 100644 --- a/service/dynamodb/go.sum +++ b/service/dynamodb/go.sum @@ -1,6 +1,8 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 8a1f421f495..00000000000 --- a/service/dynamodb/paginators.go +++ /dev/null @@ -1,160 +0,0 @@ -// 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.mod b/service/dynamodbstreams/go.mod index 1dbd883df99..09c74535a5b 100644 --- a/service/dynamodbstreams/go.mod +++ b/service/dynamodbstreams/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/dynamodbstreams/go.sum b/service/dynamodbstreams/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/dynamodbstreams/go.sum +++ b/service/dynamodbstreams/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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/api_op_ListChangedBlocks.go b/service/ebs/api_op_ListChangedBlocks.go index b3df978f1ec..b586081b7d5 100644 --- a/service/ebs/api_op_ListChangedBlocks.go +++ b/service/ebs/api_op_ListChangedBlocks.go @@ -4,6 +4,7 @@ package ebs import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ebs/types" @@ -136,6 +137,81 @@ func addOperationListChangedBlocksMiddlewares(stack *middleware.Stack, options O return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListChangedBlocksPaginator returns a new ListChangedBlocksPaginator +func NewListChangedBlocksPaginator(client ListChangedBlocksAPIClient, params *ListChangedBlocksInput, optFns ...func(*ListChangedBlocksPaginatorOptions)) *ListChangedBlocksPaginator { + options := ListChangedBlocksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListChangedBlocksInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListChangedBlocks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ebs/api_op_ListSnapshotBlocks.go b/service/ebs/api_op_ListSnapshotBlocks.go index f3ae9016f8d..91ca028c8de 100644 --- a/service/ebs/api_op_ListSnapshotBlocks.go +++ b/service/ebs/api_op_ListSnapshotBlocks.go @@ -4,6 +4,7 @@ package ebs import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ebs/types" @@ -128,6 +129,82 @@ func addOperationListSnapshotBlocksMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListSnapshotBlocksPaginator returns a new ListSnapshotBlocksPaginator +func NewListSnapshotBlocksPaginator(client ListSnapshotBlocksAPIClient, params *ListSnapshotBlocksInput, optFns ...func(*ListSnapshotBlocksPaginatorOptions)) *ListSnapshotBlocksPaginator { + options := ListSnapshotBlocksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSnapshotBlocksInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSnapshotBlocks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ebs/go.mod b/service/ebs/go.mod index adcdf621295..20766c54b6e 100644 --- a/service/ebs/go.mod +++ b/service/ebs/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/ebs/go.sum b/service/ebs/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/ebs/go.sum +++ b/service/ebs/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 06ec240fd92..00000000000 --- a/service/ebs/paginators.go +++ /dev/null @@ -1,159 +0,0 @@ -// 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/api_op_DescribeCapacityReservations.go b/service/ec2/api_op_DescribeCapacityReservations.go index e81e42dc89e..692c45ddd1d 100644 --- a/service/ec2/api_op_DescribeCapacityReservations.go +++ b/service/ec2/api_op_DescribeCapacityReservations.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -201,6 +202,86 @@ func addOperationDescribeCapacityReservationsMiddlewares(stack *middleware.Stack return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeCapacityReservationsPaginator returns a new +// DescribeCapacityReservationsPaginator +func NewDescribeCapacityReservationsPaginator(client DescribeCapacityReservationsAPIClient, params *DescribeCapacityReservationsInput, optFns ...func(*DescribeCapacityReservationsPaginatorOptions)) *DescribeCapacityReservationsPaginator { + options := DescribeCapacityReservationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeCapacityReservationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeCapacityReservations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeCarrierGateways.go b/service/ec2/api_op_DescribeCarrierGateways.go index 37756614830..e8b5b1d9e1e 100644 --- a/service/ec2/api_op_DescribeCarrierGateways.go +++ b/service/ec2/api_op_DescribeCarrierGateways.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -140,6 +141,84 @@ func addOperationDescribeCarrierGatewaysMiddlewares(stack *middleware.Stack, opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeCarrierGatewaysPaginator returns a new +// DescribeCarrierGatewaysPaginator +func NewDescribeCarrierGatewaysPaginator(client DescribeCarrierGatewaysAPIClient, params *DescribeCarrierGatewaysInput, optFns ...func(*DescribeCarrierGatewaysPaginatorOptions)) *DescribeCarrierGatewaysPaginator { + options := DescribeCarrierGatewaysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeCarrierGatewaysInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeCarrierGateways(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeClassicLinkInstances.go b/service/ec2/api_op_DescribeClassicLinkInstances.go index bf2c83e0c61..eea1ef8d0c4 100644 --- a/service/ec2/api_op_DescribeClassicLinkInstances.go +++ b/service/ec2/api_op_DescribeClassicLinkInstances.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -142,6 +143,85 @@ func addOperationDescribeClassicLinkInstancesMiddlewares(stack *middleware.Stack return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeClassicLinkInstancesPaginator returns a new +// DescribeClassicLinkInstancesPaginator +func NewDescribeClassicLinkInstancesPaginator(client DescribeClassicLinkInstancesAPIClient, params *DescribeClassicLinkInstancesInput, optFns ...func(*DescribeClassicLinkInstancesPaginatorOptions)) *DescribeClassicLinkInstancesPaginator { + options := DescribeClassicLinkInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeClassicLinkInstancesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeClassicLinkInstances(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeClientVpnAuthorizationRules.go b/service/ec2/api_op_DescribeClientVpnAuthorizationRules.go index 285fbf120f9..760275671a8 100644 --- a/service/ec2/api_op_DescribeClientVpnAuthorizationRules.go +++ b/service/ec2/api_op_DescribeClientVpnAuthorizationRules.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -134,6 +135,85 @@ func addOperationDescribeClientVpnAuthorizationRulesMiddlewares(stack *middlewar return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeClientVpnAuthorizationRulesPaginator returns a new +// DescribeClientVpnAuthorizationRulesPaginator +func NewDescribeClientVpnAuthorizationRulesPaginator(client DescribeClientVpnAuthorizationRulesAPIClient, params *DescribeClientVpnAuthorizationRulesInput, optFns ...func(*DescribeClientVpnAuthorizationRulesPaginatorOptions)) *DescribeClientVpnAuthorizationRulesPaginator { + options := DescribeClientVpnAuthorizationRulesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeClientVpnAuthorizationRulesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeClientVpnAuthorizationRules(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeClientVpnConnections.go b/service/ec2/api_op_DescribeClientVpnConnections.go index 18ee0bd39e3..b2ec8dd9c00 100644 --- a/service/ec2/api_op_DescribeClientVpnConnections.go +++ b/service/ec2/api_op_DescribeClientVpnConnections.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -133,6 +134,85 @@ func addOperationDescribeClientVpnConnectionsMiddlewares(stack *middleware.Stack return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeClientVpnConnectionsPaginator returns a new +// DescribeClientVpnConnectionsPaginator +func NewDescribeClientVpnConnectionsPaginator(client DescribeClientVpnConnectionsAPIClient, params *DescribeClientVpnConnectionsInput, optFns ...func(*DescribeClientVpnConnectionsPaginatorOptions)) *DescribeClientVpnConnectionsPaginator { + options := DescribeClientVpnConnectionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeClientVpnConnectionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeClientVpnConnections(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeClientVpnEndpoints.go b/service/ec2/api_op_DescribeClientVpnEndpoints.go index 985f33ea3a6..24e912d498c 100644 --- a/service/ec2/api_op_DescribeClientVpnEndpoints.go +++ b/service/ec2/api_op_DescribeClientVpnEndpoints.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -126,6 +127,85 @@ func addOperationDescribeClientVpnEndpointsMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeClientVpnEndpointsPaginator returns a new +// DescribeClientVpnEndpointsPaginator +func NewDescribeClientVpnEndpointsPaginator(client DescribeClientVpnEndpointsAPIClient, params *DescribeClientVpnEndpointsInput, optFns ...func(*DescribeClientVpnEndpointsPaginatorOptions)) *DescribeClientVpnEndpointsPaginator { + options := DescribeClientVpnEndpointsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeClientVpnEndpointsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeClientVpnEndpoints(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeClientVpnRoutes.go b/service/ec2/api_op_DescribeClientVpnRoutes.go index eebf2c45b93..6378c7b09a6 100644 --- a/service/ec2/api_op_DescribeClientVpnRoutes.go +++ b/service/ec2/api_op_DescribeClientVpnRoutes.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -134,6 +135,85 @@ func addOperationDescribeClientVpnRoutesMiddlewares(stack *middleware.Stack, opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeClientVpnRoutesPaginator returns a new +// DescribeClientVpnRoutesPaginator +func NewDescribeClientVpnRoutesPaginator(client DescribeClientVpnRoutesAPIClient, params *DescribeClientVpnRoutesInput, optFns ...func(*DescribeClientVpnRoutesPaginatorOptions)) *DescribeClientVpnRoutesPaginator { + options := DescribeClientVpnRoutesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeClientVpnRoutesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeClientVpnRoutes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeClientVpnTargetNetworks.go b/service/ec2/api_op_DescribeClientVpnTargetNetworks.go index 713d6e9cfe9..325d9d628fb 100644 --- a/service/ec2/api_op_DescribeClientVpnTargetNetworks.go +++ b/service/ec2/api_op_DescribeClientVpnTargetNetworks.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -137,6 +138,85 @@ func addOperationDescribeClientVpnTargetNetworksMiddlewares(stack *middleware.St return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeClientVpnTargetNetworksPaginator returns a new +// DescribeClientVpnTargetNetworksPaginator +func NewDescribeClientVpnTargetNetworksPaginator(client DescribeClientVpnTargetNetworksAPIClient, params *DescribeClientVpnTargetNetworksInput, optFns ...func(*DescribeClientVpnTargetNetworksPaginatorOptions)) *DescribeClientVpnTargetNetworksPaginator { + options := DescribeClientVpnTargetNetworksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeClientVpnTargetNetworksInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeClientVpnTargetNetworks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeCoipPools.go b/service/ec2/api_op_DescribeCoipPools.go index 6e69e60209f..0058f68959f 100644 --- a/service/ec2/api_op_DescribeCoipPools.go +++ b/service/ec2/api_op_DescribeCoipPools.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -125,6 +126,82 @@ func addOperationDescribeCoipPoolsMiddlewares(stack *middleware.Stack, options O return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeCoipPoolsPaginator returns a new DescribeCoipPoolsPaginator +func NewDescribeCoipPoolsPaginator(client DescribeCoipPoolsAPIClient, params *DescribeCoipPoolsInput, optFns ...func(*DescribeCoipPoolsPaginatorOptions)) *DescribeCoipPoolsPaginator { + options := DescribeCoipPoolsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeCoipPoolsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeCoipPools(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeDhcpOptions.go b/service/ec2/api_op_DescribeDhcpOptions.go index e0c6a8d9f26..0e2badc5c34 100644 --- a/service/ec2/api_op_DescribeDhcpOptions.go +++ b/service/ec2/api_op_DescribeDhcpOptions.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -144,6 +145,83 @@ func addOperationDescribeDhcpOptionsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeDhcpOptionsPaginator returns a new DescribeDhcpOptionsPaginator +func NewDescribeDhcpOptionsPaginator(client DescribeDhcpOptionsAPIClient, params *DescribeDhcpOptionsInput, optFns ...func(*DescribeDhcpOptionsPaginatorOptions)) *DescribeDhcpOptionsPaginator { + options := DescribeDhcpOptionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDhcpOptionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDhcpOptions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeEgressOnlyInternetGateways.go b/service/ec2/api_op_DescribeEgressOnlyInternetGateways.go index 0d7e000f4b3..0cad7d6f166 100644 --- a/service/ec2/api_op_DescribeEgressOnlyInternetGateways.go +++ b/service/ec2/api_op_DescribeEgressOnlyInternetGateways.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -129,6 +130,84 @@ func addOperationDescribeEgressOnlyInternetGatewaysMiddlewares(stack *middleware return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeEgressOnlyInternetGatewaysPaginator returns a new +// DescribeEgressOnlyInternetGatewaysPaginator +func NewDescribeEgressOnlyInternetGatewaysPaginator(client DescribeEgressOnlyInternetGatewaysAPIClient, params *DescribeEgressOnlyInternetGatewaysInput, optFns ...func(*DescribeEgressOnlyInternetGatewaysPaginatorOptions)) *DescribeEgressOnlyInternetGatewaysPaginator { + options := DescribeEgressOnlyInternetGatewaysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEgressOnlyInternetGatewaysInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEgressOnlyInternetGateways(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeExportImageTasks.go b/service/ec2/api_op_DescribeExportImageTasks.go index 02604e0cf8f..3ab272cc814 100644 --- a/service/ec2/api_op_DescribeExportImageTasks.go +++ b/service/ec2/api_op_DescribeExportImageTasks.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -119,6 +120,83 @@ func addOperationDescribeExportImageTasksMiddlewares(stack *middleware.Stack, op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeExportImageTasksPaginator returns a new +// DescribeExportImageTasksPaginator +func NewDescribeExportImageTasksPaginator(client DescribeExportImageTasksAPIClient, params *DescribeExportImageTasksInput, optFns ...func(*DescribeExportImageTasksPaginatorOptions)) *DescribeExportImageTasksPaginator { + options := DescribeExportImageTasksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeExportImageTasksInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeExportImageTasks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeFastSnapshotRestores.go b/service/ec2/api_op_DescribeFastSnapshotRestores.go index 895801ee6f6..4d548687c92 100644 --- a/service/ec2/api_op_DescribeFastSnapshotRestores.go +++ b/service/ec2/api_op_DescribeFastSnapshotRestores.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -128,6 +129,84 @@ func addOperationDescribeFastSnapshotRestoresMiddlewares(stack *middleware.Stack return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeFastSnapshotRestoresPaginator returns a new +// DescribeFastSnapshotRestoresPaginator +func NewDescribeFastSnapshotRestoresPaginator(client DescribeFastSnapshotRestoresAPIClient, params *DescribeFastSnapshotRestoresInput, optFns ...func(*DescribeFastSnapshotRestoresPaginatorOptions)) *DescribeFastSnapshotRestoresPaginator { + options := DescribeFastSnapshotRestoresPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeFastSnapshotRestoresInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeFastSnapshotRestores(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeFleets.go b/service/ec2/api_op_DescribeFleets.go index b4ea8967a6d..04b946ead9f 100644 --- a/service/ec2/api_op_DescribeFleets.go +++ b/service/ec2/api_op_DescribeFleets.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -137,6 +138,83 @@ func addOperationDescribeFleetsMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeFleetsPaginator returns a new DescribeFleetsPaginator +func NewDescribeFleetsPaginator(client DescribeFleetsAPIClient, params *DescribeFleetsInput, optFns ...func(*DescribeFleetsPaginatorOptions)) *DescribeFleetsPaginator { + options := DescribeFleetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeFleetsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeFleets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeFlowLogs.go b/service/ec2/api_op_DescribeFlowLogs.go index 09934ff8c99..bc719c5b40f 100644 --- a/service/ec2/api_op_DescribeFlowLogs.go +++ b/service/ec2/api_op_DescribeFlowLogs.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -148,6 +149,82 @@ func addOperationDescribeFlowLogsMiddlewares(stack *middleware.Stack, options Op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeFlowLogsPaginator returns a new DescribeFlowLogsPaginator +func NewDescribeFlowLogsPaginator(client DescribeFlowLogsAPIClient, params *DescribeFlowLogsInput, optFns ...func(*DescribeFlowLogsPaginatorOptions)) *DescribeFlowLogsPaginator { + options := DescribeFlowLogsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeFlowLogsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeFlowLogs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeFpgaImages.go b/service/ec2/api_op_DescribeFpgaImages.go index 68b001621e5..c4049122a29 100644 --- a/service/ec2/api_op_DescribeFpgaImages.go +++ b/service/ec2/api_op_DescribeFpgaImages.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -159,6 +160,82 @@ func addOperationDescribeFpgaImagesMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeFpgaImagesPaginator returns a new DescribeFpgaImagesPaginator +func NewDescribeFpgaImagesPaginator(client DescribeFpgaImagesAPIClient, params *DescribeFpgaImagesInput, optFns ...func(*DescribeFpgaImagesPaginatorOptions)) *DescribeFpgaImagesPaginator { + options := DescribeFpgaImagesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeFpgaImagesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeFpgaImages(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeHostReservationOfferings.go b/service/ec2/api_op_DescribeHostReservationOfferings.go index a711e562613..3c9802685d6 100644 --- a/service/ec2/api_op_DescribeHostReservationOfferings.go +++ b/service/ec2/api_op_DescribeHostReservationOfferings.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -143,6 +144,86 @@ func addOperationDescribeHostReservationOfferingsMiddlewares(stack *middleware.S return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeHostReservationOfferingsPaginator returns a new +// DescribeHostReservationOfferingsPaginator +func NewDescribeHostReservationOfferingsPaginator(client DescribeHostReservationOfferingsAPIClient, params *DescribeHostReservationOfferingsInput, optFns ...func(*DescribeHostReservationOfferingsPaginatorOptions)) *DescribeHostReservationOfferingsPaginator { + options := DescribeHostReservationOfferingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeHostReservationOfferingsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeHostReservationOfferings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeHostReservations.go b/service/ec2/api_op_DescribeHostReservations.go index 55d7fced574..ba557f957e0 100644 --- a/service/ec2/api_op_DescribeHostReservations.go +++ b/service/ec2/api_op_DescribeHostReservations.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -134,6 +135,86 @@ func addOperationDescribeHostReservationsMiddlewares(stack *middleware.Stack, op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeHostReservationsPaginator returns a new +// DescribeHostReservationsPaginator +func NewDescribeHostReservationsPaginator(client DescribeHostReservationsAPIClient, params *DescribeHostReservationsInput, optFns ...func(*DescribeHostReservationsPaginatorOptions)) *DescribeHostReservationsPaginator { + options := DescribeHostReservationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeHostReservationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeHostReservations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeHosts.go b/service/ec2/api_op_DescribeHosts.go index 35e6f40cb11..5526be9e058 100644 --- a/service/ec2/api_op_DescribeHosts.go +++ b/service/ec2/api_op_DescribeHosts.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -142,6 +143,84 @@ func addOperationDescribeHostsMiddlewares(stack *middleware.Stack, options Optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeHostsPaginator returns a new DescribeHostsPaginator +func NewDescribeHostsPaginator(client DescribeHostsAPIClient, params *DescribeHostsInput, optFns ...func(*DescribeHostsPaginatorOptions)) *DescribeHostsPaginator { + options := DescribeHostsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeHostsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeHosts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeIamInstanceProfileAssociations.go b/service/ec2/api_op_DescribeIamInstanceProfileAssociations.go index 9454332f37a..2e4f9afaa62 100644 --- a/service/ec2/api_op_DescribeIamInstanceProfileAssociations.go +++ b/service/ec2/api_op_DescribeIamInstanceProfileAssociations.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -118,6 +119,84 @@ func addOperationDescribeIamInstanceProfileAssociationsMiddlewares(stack *middle return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeIamInstanceProfileAssociationsPaginator returns a new +// DescribeIamInstanceProfileAssociationsPaginator +func NewDescribeIamInstanceProfileAssociationsPaginator(client DescribeIamInstanceProfileAssociationsAPIClient, params *DescribeIamInstanceProfileAssociationsInput, optFns ...func(*DescribeIamInstanceProfileAssociationsPaginatorOptions)) *DescribeIamInstanceProfileAssociationsPaginator { + options := DescribeIamInstanceProfileAssociationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeIamInstanceProfileAssociationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeIamInstanceProfileAssociations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeImportImageTasks.go b/service/ec2/api_op_DescribeImportImageTasks.go index fed051a6d96..93bd470c8d6 100644 --- a/service/ec2/api_op_DescribeImportImageTasks.go +++ b/service/ec2/api_op_DescribeImportImageTasks.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -121,6 +122,83 @@ func addOperationDescribeImportImageTasksMiddlewares(stack *middleware.Stack, op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeImportImageTasksPaginator returns a new +// DescribeImportImageTasksPaginator +func NewDescribeImportImageTasksPaginator(client DescribeImportImageTasksAPIClient, params *DescribeImportImageTasksInput, optFns ...func(*DescribeImportImageTasksPaginatorOptions)) *DescribeImportImageTasksPaginator { + options := DescribeImportImageTasksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeImportImageTasksInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeImportImageTasks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeImportSnapshotTasks.go b/service/ec2/api_op_DescribeImportSnapshotTasks.go index 6ff473e48d0..d480d648886 100644 --- a/service/ec2/api_op_DescribeImportSnapshotTasks.go +++ b/service/ec2/api_op_DescribeImportSnapshotTasks.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -120,6 +121,84 @@ func addOperationDescribeImportSnapshotTasksMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeImportSnapshotTasksPaginator returns a new +// DescribeImportSnapshotTasksPaginator +func NewDescribeImportSnapshotTasksPaginator(client DescribeImportSnapshotTasksAPIClient, params *DescribeImportSnapshotTasksInput, optFns ...func(*DescribeImportSnapshotTasksPaginatorOptions)) *DescribeImportSnapshotTasksPaginator { + options := DescribeImportSnapshotTasksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeImportSnapshotTasksInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeImportSnapshotTasks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeInstanceCreditSpecifications.go b/service/ec2/api_op_DescribeInstanceCreditSpecifications.go index 0bbc63c6b19..9bcfc0087ba 100644 --- a/service/ec2/api_op_DescribeInstanceCreditSpecifications.go +++ b/service/ec2/api_op_DescribeInstanceCreditSpecifications.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -141,6 +142,86 @@ func addOperationDescribeInstanceCreditSpecificationsMiddlewares(stack *middlewa return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeInstanceCreditSpecificationsPaginator returns a new +// DescribeInstanceCreditSpecificationsPaginator +func NewDescribeInstanceCreditSpecificationsPaginator(client DescribeInstanceCreditSpecificationsAPIClient, params *DescribeInstanceCreditSpecificationsInput, optFns ...func(*DescribeInstanceCreditSpecificationsPaginatorOptions)) *DescribeInstanceCreditSpecificationsPaginator { + options := DescribeInstanceCreditSpecificationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeInstanceCreditSpecificationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeInstanceCreditSpecifications(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeInstanceStatus.go b/service/ec2/api_op_DescribeInstanceStatus.go index 196e003b403..5d46db7e5d4 100644 --- a/service/ec2/api_op_DescribeInstanceStatus.go +++ b/service/ec2/api_op_DescribeInstanceStatus.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -198,6 +199,85 @@ func addOperationDescribeInstanceStatusMiddlewares(stack *middleware.Stack, opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeInstanceStatusPaginator returns a new DescribeInstanceStatusPaginator +func NewDescribeInstanceStatusPaginator(client DescribeInstanceStatusAPIClient, params *DescribeInstanceStatusInput, optFns ...func(*DescribeInstanceStatusPaginatorOptions)) *DescribeInstanceStatusPaginator { + options := DescribeInstanceStatusPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeInstanceStatusInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeInstanceStatus(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeInstanceTypeOfferings.go b/service/ec2/api_op_DescribeInstanceTypeOfferings.go index 1c031c08da6..0b22f8e97e6 100644 --- a/service/ec2/api_op_DescribeInstanceTypeOfferings.go +++ b/service/ec2/api_op_DescribeInstanceTypeOfferings.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -129,6 +130,85 @@ func addOperationDescribeInstanceTypeOfferingsMiddlewares(stack *middleware.Stac return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeInstanceTypeOfferingsPaginator returns a new +// DescribeInstanceTypeOfferingsPaginator +func NewDescribeInstanceTypeOfferingsPaginator(client DescribeInstanceTypeOfferingsAPIClient, params *DescribeInstanceTypeOfferingsInput, optFns ...func(*DescribeInstanceTypeOfferingsPaginatorOptions)) *DescribeInstanceTypeOfferingsPaginator { + options := DescribeInstanceTypeOfferingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeInstanceTypeOfferingsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeInstanceTypeOfferings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeInstanceTypes.go b/service/ec2/api_op_DescribeInstanceTypes.go index 7b44475270a..e2458bf2d08 100644 --- a/service/ec2/api_op_DescribeInstanceTypes.go +++ b/service/ec2/api_op_DescribeInstanceTypes.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -268,6 +269,84 @@ func addOperationDescribeInstanceTypesMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeInstanceTypesPaginator returns a new DescribeInstanceTypesPaginator +func NewDescribeInstanceTypesPaginator(client DescribeInstanceTypesAPIClient, params *DescribeInstanceTypesInput, optFns ...func(*DescribeInstanceTypesPaginatorOptions)) *DescribeInstanceTypesPaginator { + options := DescribeInstanceTypesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeInstanceTypesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeInstanceTypes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeInstances.go b/service/ec2/api_op_DescribeInstances.go index beacf907759..188040347fc 100644 --- a/service/ec2/api_op_DescribeInstances.go +++ b/service/ec2/api_op_DescribeInstances.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -436,6 +437,84 @@ func addOperationDescribeInstancesMiddlewares(stack *middleware.Stack, options O return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeInstancesPaginator returns a new DescribeInstancesPaginator +func NewDescribeInstancesPaginator(client DescribeInstancesAPIClient, params *DescribeInstancesInput, optFns ...func(*DescribeInstancesPaginatorOptions)) *DescribeInstancesPaginator { + options := DescribeInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeInstancesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeInstances(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeInternetGateways.go b/service/ec2/api_op_DescribeInternetGateways.go index 698d78a97c1..046aba52667 100644 --- a/service/ec2/api_op_DescribeInternetGateways.go +++ b/service/ec2/api_op_DescribeInternetGateways.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -141,6 +142,84 @@ func addOperationDescribeInternetGatewaysMiddlewares(stack *middleware.Stack, op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeInternetGatewaysPaginator returns a new +// DescribeInternetGatewaysPaginator +func NewDescribeInternetGatewaysPaginator(client DescribeInternetGatewaysAPIClient, params *DescribeInternetGatewaysInput, optFns ...func(*DescribeInternetGatewaysPaginatorOptions)) *DescribeInternetGatewaysPaginator { + options := DescribeInternetGatewaysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeInternetGatewaysInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeInternetGateways(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeIpv6Pools.go b/service/ec2/api_op_DescribeIpv6Pools.go index f3adaaf0f6a..d23500adf34 100644 --- a/service/ec2/api_op_DescribeIpv6Pools.go +++ b/service/ec2/api_op_DescribeIpv6Pools.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -129,6 +130,82 @@ func addOperationDescribeIpv6PoolsMiddlewares(stack *middleware.Stack, options O return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeIpv6PoolsPaginator returns a new DescribeIpv6PoolsPaginator +func NewDescribeIpv6PoolsPaginator(client DescribeIpv6PoolsAPIClient, params *DescribeIpv6PoolsInput, optFns ...func(*DescribeIpv6PoolsPaginatorOptions)) *DescribeIpv6PoolsPaginator { + options := DescribeIpv6PoolsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeIpv6PoolsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeIpv6Pools(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeLaunchTemplateVersions.go b/service/ec2/api_op_DescribeLaunchTemplateVersions.go index 5c452105a4e..f64820ffeb5 100644 --- a/service/ec2/api_op_DescribeLaunchTemplateVersions.go +++ b/service/ec2/api_op_DescribeLaunchTemplateVersions.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -170,6 +171,85 @@ func addOperationDescribeLaunchTemplateVersionsMiddlewares(stack *middleware.Sta return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeLaunchTemplateVersionsPaginator returns a new +// DescribeLaunchTemplateVersionsPaginator +func NewDescribeLaunchTemplateVersionsPaginator(client DescribeLaunchTemplateVersionsAPIClient, params *DescribeLaunchTemplateVersionsInput, optFns ...func(*DescribeLaunchTemplateVersionsPaginatorOptions)) *DescribeLaunchTemplateVersionsPaginator { + options := DescribeLaunchTemplateVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeLaunchTemplateVersionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeLaunchTemplateVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeLaunchTemplates.go b/service/ec2/api_op_DescribeLaunchTemplates.go index 0d710b54e85..e67cc58a9e1 100644 --- a/service/ec2/api_op_DescribeLaunchTemplates.go +++ b/service/ec2/api_op_DescribeLaunchTemplates.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -138,6 +139,85 @@ func addOperationDescribeLaunchTemplatesMiddlewares(stack *middleware.Stack, opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeLaunchTemplatesPaginator returns a new +// DescribeLaunchTemplatesPaginator +func NewDescribeLaunchTemplatesPaginator(client DescribeLaunchTemplatesAPIClient, params *DescribeLaunchTemplatesInput, optFns ...func(*DescribeLaunchTemplatesPaginatorOptions)) *DescribeLaunchTemplatesPaginator { + options := DescribeLaunchTemplatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeLaunchTemplatesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeLaunchTemplates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations.go b/service/ec2/api_op_DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations.go index 58585c705f3..af7fc04d3a7 100644 --- a/service/ec2/api_op_DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations.go +++ b/service/ec2/api_op_DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -134,6 +135,89 @@ func addOperationDescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginator +// returns a new +// DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginator +func NewDescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginator(client DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsAPIClient, params *DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsInput, optFns ...func(*DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginatorOptions)) *DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginator { + options := DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeLocalGatewayRouteTableVpcAssociations.go b/service/ec2/api_op_DescribeLocalGatewayRouteTableVpcAssociations.go index 099d45c1874..c34c87e4ec8 100644 --- a/service/ec2/api_op_DescribeLocalGatewayRouteTableVpcAssociations.go +++ b/service/ec2/api_op_DescribeLocalGatewayRouteTableVpcAssociations.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -133,6 +134,84 @@ func addOperationDescribeLocalGatewayRouteTableVpcAssociationsMiddlewares(stack return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeLocalGatewayRouteTableVpcAssociationsPaginator returns a new +// DescribeLocalGatewayRouteTableVpcAssociationsPaginator +func NewDescribeLocalGatewayRouteTableVpcAssociationsPaginator(client DescribeLocalGatewayRouteTableVpcAssociationsAPIClient, params *DescribeLocalGatewayRouteTableVpcAssociationsInput, optFns ...func(*DescribeLocalGatewayRouteTableVpcAssociationsPaginatorOptions)) *DescribeLocalGatewayRouteTableVpcAssociationsPaginator { + options := DescribeLocalGatewayRouteTableVpcAssociationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeLocalGatewayRouteTableVpcAssociationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeLocalGatewayRouteTableVpcAssociations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeLocalGatewayRouteTables.go b/service/ec2/api_op_DescribeLocalGatewayRouteTables.go index 5ae9f65e23d..fc9d39de4bb 100644 --- a/service/ec2/api_op_DescribeLocalGatewayRouteTables.go +++ b/service/ec2/api_op_DescribeLocalGatewayRouteTables.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -131,6 +132,84 @@ func addOperationDescribeLocalGatewayRouteTablesMiddlewares(stack *middleware.St return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeLocalGatewayRouteTablesPaginator returns a new +// DescribeLocalGatewayRouteTablesPaginator +func NewDescribeLocalGatewayRouteTablesPaginator(client DescribeLocalGatewayRouteTablesAPIClient, params *DescribeLocalGatewayRouteTablesInput, optFns ...func(*DescribeLocalGatewayRouteTablesPaginatorOptions)) *DescribeLocalGatewayRouteTablesPaginator { + options := DescribeLocalGatewayRouteTablesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeLocalGatewayRouteTablesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeLocalGatewayRouteTables(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeLocalGatewayVirtualInterfaceGroups.go b/service/ec2/api_op_DescribeLocalGatewayVirtualInterfaceGroups.go index 156c16e04c3..1b741a57754 100644 --- a/service/ec2/api_op_DescribeLocalGatewayVirtualInterfaceGroups.go +++ b/service/ec2/api_op_DescribeLocalGatewayVirtualInterfaceGroups.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -128,6 +129,84 @@ func addOperationDescribeLocalGatewayVirtualInterfaceGroupsMiddlewares(stack *mi return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeLocalGatewayVirtualInterfaceGroupsPaginator returns a new +// DescribeLocalGatewayVirtualInterfaceGroupsPaginator +func NewDescribeLocalGatewayVirtualInterfaceGroupsPaginator(client DescribeLocalGatewayVirtualInterfaceGroupsAPIClient, params *DescribeLocalGatewayVirtualInterfaceGroupsInput, optFns ...func(*DescribeLocalGatewayVirtualInterfaceGroupsPaginatorOptions)) *DescribeLocalGatewayVirtualInterfaceGroupsPaginator { + options := DescribeLocalGatewayVirtualInterfaceGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeLocalGatewayVirtualInterfaceGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeLocalGatewayVirtualInterfaceGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeLocalGatewayVirtualInterfaces.go b/service/ec2/api_op_DescribeLocalGatewayVirtualInterfaces.go index 7df25c45ea8..9fbaf2efae6 100644 --- a/service/ec2/api_op_DescribeLocalGatewayVirtualInterfaces.go +++ b/service/ec2/api_op_DescribeLocalGatewayVirtualInterfaces.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -119,6 +120,84 @@ func addOperationDescribeLocalGatewayVirtualInterfacesMiddlewares(stack *middlew return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeLocalGatewayVirtualInterfacesPaginator returns a new +// DescribeLocalGatewayVirtualInterfacesPaginator +func NewDescribeLocalGatewayVirtualInterfacesPaginator(client DescribeLocalGatewayVirtualInterfacesAPIClient, params *DescribeLocalGatewayVirtualInterfacesInput, optFns ...func(*DescribeLocalGatewayVirtualInterfacesPaginatorOptions)) *DescribeLocalGatewayVirtualInterfacesPaginator { + options := DescribeLocalGatewayVirtualInterfacesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeLocalGatewayVirtualInterfacesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeLocalGatewayVirtualInterfaces(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeLocalGateways.go b/service/ec2/api_op_DescribeLocalGateways.go index 486156c50de..a37dd3f4fff 100644 --- a/service/ec2/api_op_DescribeLocalGateways.go +++ b/service/ec2/api_op_DescribeLocalGateways.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -137,6 +138,83 @@ func addOperationDescribeLocalGatewaysMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeLocalGatewaysPaginator returns a new DescribeLocalGatewaysPaginator +func NewDescribeLocalGatewaysPaginator(client DescribeLocalGatewaysAPIClient, params *DescribeLocalGatewaysInput, optFns ...func(*DescribeLocalGatewaysPaginatorOptions)) *DescribeLocalGatewaysPaginator { + options := DescribeLocalGatewaysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeLocalGatewaysInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeLocalGateways(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeManagedPrefixLists.go b/service/ec2/api_op_DescribeManagedPrefixLists.go index eb5498ee169..204eb5a2a04 100644 --- a/service/ec2/api_op_DescribeManagedPrefixLists.go +++ b/service/ec2/api_op_DescribeManagedPrefixLists.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -128,6 +129,84 @@ func addOperationDescribeManagedPrefixListsMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeManagedPrefixListsPaginator returns a new +// DescribeManagedPrefixListsPaginator +func NewDescribeManagedPrefixListsPaginator(client DescribeManagedPrefixListsAPIClient, params *DescribeManagedPrefixListsInput, optFns ...func(*DescribeManagedPrefixListsPaginatorOptions)) *DescribeManagedPrefixListsPaginator { + options := DescribeManagedPrefixListsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeManagedPrefixListsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeManagedPrefixLists(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeMovingAddresses.go b/service/ec2/api_op_DescribeMovingAddresses.go index 41913dbe1e6..cb2d1928f94 100644 --- a/service/ec2/api_op_DescribeMovingAddresses.go +++ b/service/ec2/api_op_DescribeMovingAddresses.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -128,6 +129,87 @@ func addOperationDescribeMovingAddressesMiddlewares(stack *middleware.Stack, opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeMovingAddressesPaginator returns a new +// DescribeMovingAddressesPaginator +func NewDescribeMovingAddressesPaginator(client DescribeMovingAddressesAPIClient, params *DescribeMovingAddressesInput, optFns ...func(*DescribeMovingAddressesPaginatorOptions)) *DescribeMovingAddressesPaginator { + options := DescribeMovingAddressesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeMovingAddressesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeMovingAddresses(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeNatGateways.go b/service/ec2/api_op_DescribeNatGateways.go index f7f1b82d4d8..41325428e8b 100644 --- a/service/ec2/api_op_DescribeNatGateways.go +++ b/service/ec2/api_op_DescribeNatGateways.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -140,6 +141,83 @@ func addOperationDescribeNatGatewaysMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeNatGatewaysPaginator returns a new DescribeNatGatewaysPaginator +func NewDescribeNatGatewaysPaginator(client DescribeNatGatewaysAPIClient, params *DescribeNatGatewaysInput, optFns ...func(*DescribeNatGatewaysPaginatorOptions)) *DescribeNatGatewaysPaginator { + options := DescribeNatGatewaysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeNatGatewaysInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeNatGateways(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeNetworkAcls.go b/service/ec2/api_op_DescribeNetworkAcls.go index 07f8c00eef8..728cb0a8c63 100644 --- a/service/ec2/api_op_DescribeNetworkAcls.go +++ b/service/ec2/api_op_DescribeNetworkAcls.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -178,6 +179,83 @@ func addOperationDescribeNetworkAclsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeNetworkAclsPaginator returns a new DescribeNetworkAclsPaginator +func NewDescribeNetworkAclsPaginator(client DescribeNetworkAclsAPIClient, params *DescribeNetworkAclsInput, optFns ...func(*DescribeNetworkAclsPaginatorOptions)) *DescribeNetworkAclsPaginator { + options := DescribeNetworkAclsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeNetworkAclsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeNetworkAcls(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeNetworkInterfacePermissions.go b/service/ec2/api_op_DescribeNetworkInterfacePermissions.go index 3ca7bf28876..6bb37689cde 100644 --- a/service/ec2/api_op_DescribeNetworkInterfacePermissions.go +++ b/service/ec2/api_op_DescribeNetworkInterfacePermissions.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -131,6 +132,85 @@ func addOperationDescribeNetworkInterfacePermissionsMiddlewares(stack *middlewar return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeNetworkInterfacePermissionsPaginator returns a new +// DescribeNetworkInterfacePermissionsPaginator +func NewDescribeNetworkInterfacePermissionsPaginator(client DescribeNetworkInterfacePermissionsAPIClient, params *DescribeNetworkInterfacePermissionsInput, optFns ...func(*DescribeNetworkInterfacePermissionsPaginatorOptions)) *DescribeNetworkInterfacePermissionsPaginator { + options := DescribeNetworkInterfacePermissionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeNetworkInterfacePermissionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeNetworkInterfacePermissions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeNetworkInterfaces.go b/service/ec2/api_op_DescribeNetworkInterfaces.go index 28e3af28627..699237b36b6 100644 --- a/service/ec2/api_op_DescribeNetworkInterfaces.go +++ b/service/ec2/api_op_DescribeNetworkInterfaces.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -241,6 +242,86 @@ func addOperationDescribeNetworkInterfacesMiddlewares(stack *middleware.Stack, o return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeNetworkInterfacesPaginator returns a new +// DescribeNetworkInterfacesPaginator +func NewDescribeNetworkInterfacesPaginator(client DescribeNetworkInterfacesAPIClient, params *DescribeNetworkInterfacesInput, optFns ...func(*DescribeNetworkInterfacesPaginatorOptions)) *DescribeNetworkInterfacesPaginator { + options := DescribeNetworkInterfacesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeNetworkInterfacesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeNetworkInterfaces(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribePrefixLists.go b/service/ec2/api_op_DescribePrefixLists.go index e9bf0436df6..3ebacb8d8f3 100644 --- a/service/ec2/api_op_DescribePrefixLists.go +++ b/service/ec2/api_op_DescribePrefixLists.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -126,6 +127,83 @@ func addOperationDescribePrefixListsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribePrefixListsPaginator returns a new DescribePrefixListsPaginator +func NewDescribePrefixListsPaginator(client DescribePrefixListsAPIClient, params *DescribePrefixListsInput, optFns ...func(*DescribePrefixListsPaginatorOptions)) *DescribePrefixListsPaginator { + options := DescribePrefixListsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribePrefixListsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribePrefixLists(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribePrincipalIdFormat.go b/service/ec2/api_op_DescribePrincipalIdFormat.go index f8ac032a8e4..3c4bcbad3a8 100644 --- a/service/ec2/api_op_DescribePrincipalIdFormat.go +++ b/service/ec2/api_op_DescribePrincipalIdFormat.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -135,6 +136,84 @@ func addOperationDescribePrincipalIdFormatMiddlewares(stack *middleware.Stack, o return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribePrincipalIdFormatPaginator returns a new +// DescribePrincipalIdFormatPaginator +func NewDescribePrincipalIdFormatPaginator(client DescribePrincipalIdFormatAPIClient, params *DescribePrincipalIdFormatInput, optFns ...func(*DescribePrincipalIdFormatPaginatorOptions)) *DescribePrincipalIdFormatPaginator { + options := DescribePrincipalIdFormatPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribePrincipalIdFormatInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribePrincipalIdFormat(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribePublicIpv4Pools.go b/service/ec2/api_op_DescribePublicIpv4Pools.go index b9ebebbf30e..adc9251ae8e 100644 --- a/service/ec2/api_op_DescribePublicIpv4Pools.go +++ b/service/ec2/api_op_DescribePublicIpv4Pools.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -123,6 +124,84 @@ func addOperationDescribePublicIpv4PoolsMiddlewares(stack *middleware.Stack, opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribePublicIpv4PoolsPaginator returns a new +// DescribePublicIpv4PoolsPaginator +func NewDescribePublicIpv4PoolsPaginator(client DescribePublicIpv4PoolsAPIClient, params *DescribePublicIpv4PoolsInput, optFns ...func(*DescribePublicIpv4PoolsPaginatorOptions)) *DescribePublicIpv4PoolsPaginator { + options := DescribePublicIpv4PoolsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribePublicIpv4PoolsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribePublicIpv4Pools(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeReservedInstancesModifications.go b/service/ec2/api_op_DescribeReservedInstancesModifications.go index 75816caccc4..892633b2e96 100644 --- a/service/ec2/api_op_DescribeReservedInstancesModifications.go +++ b/service/ec2/api_op_DescribeReservedInstancesModifications.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -160,6 +161,79 @@ func addOperationDescribeReservedInstancesModificationsMiddlewares(stack *middle return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeReservedInstancesModificationsPaginator returns a new +// DescribeReservedInstancesModificationsPaginator +func NewDescribeReservedInstancesModificationsPaginator(client DescribeReservedInstancesModificationsAPIClient, params *DescribeReservedInstancesModificationsInput, optFns ...func(*DescribeReservedInstancesModificationsPaginatorOptions)) *DescribeReservedInstancesModificationsPaginator { + options := DescribeReservedInstancesModificationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeReservedInstancesModificationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeReservedInstancesModifications(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeReservedInstancesOfferings.go b/service/ec2/api_op_DescribeReservedInstancesOfferings.go index b9cc8a61247..b4f98d2da05 100644 --- a/service/ec2/api_op_DescribeReservedInstancesOfferings.go +++ b/service/ec2/api_op_DescribeReservedInstancesOfferings.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -211,6 +212,85 @@ func addOperationDescribeReservedInstancesOfferingsMiddlewares(stack *middleware return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeReservedInstancesOfferingsPaginator returns a new +// DescribeReservedInstancesOfferingsPaginator +func NewDescribeReservedInstancesOfferingsPaginator(client DescribeReservedInstancesOfferingsAPIClient, params *DescribeReservedInstancesOfferingsInput, optFns ...func(*DescribeReservedInstancesOfferingsPaginatorOptions)) *DescribeReservedInstancesOfferingsPaginator { + options := DescribeReservedInstancesOfferingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeReservedInstancesOfferingsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeReservedInstancesOfferings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeRouteTables.go b/service/ec2/api_op_DescribeRouteTables.go index 36e25c217da..311d676a5fb 100644 --- a/service/ec2/api_op_DescribeRouteTables.go +++ b/service/ec2/api_op_DescribeRouteTables.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -198,6 +199,83 @@ func addOperationDescribeRouteTablesMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeRouteTablesPaginator returns a new DescribeRouteTablesPaginator +func NewDescribeRouteTablesPaginator(client DescribeRouteTablesAPIClient, params *DescribeRouteTablesInput, optFns ...func(*DescribeRouteTablesPaginatorOptions)) *DescribeRouteTablesPaginator { + options := DescribeRouteTablesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeRouteTablesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeRouteTables(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeScheduledInstanceAvailability.go b/service/ec2/api_op_DescribeScheduledInstanceAvailability.go index a0f5d6557ed..e15948b87bf 100644 --- a/service/ec2/api_op_DescribeScheduledInstanceAvailability.go +++ b/service/ec2/api_op_DescribeScheduledInstanceAvailability.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -158,6 +159,85 @@ func addOperationDescribeScheduledInstanceAvailabilityMiddlewares(stack *middlew return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeScheduledInstanceAvailabilityPaginator returns a new +// DescribeScheduledInstanceAvailabilityPaginator +func NewDescribeScheduledInstanceAvailabilityPaginator(client DescribeScheduledInstanceAvailabilityAPIClient, params *DescribeScheduledInstanceAvailabilityInput, optFns ...func(*DescribeScheduledInstanceAvailabilityPaginatorOptions)) *DescribeScheduledInstanceAvailabilityPaginator { + options := DescribeScheduledInstanceAvailabilityPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeScheduledInstanceAvailabilityInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeScheduledInstanceAvailability(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeScheduledInstances.go b/service/ec2/api_op_DescribeScheduledInstances.go index 46c08c38635..a189cafd58a 100644 --- a/service/ec2/api_op_DescribeScheduledInstances.go +++ b/service/ec2/api_op_DescribeScheduledInstances.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -136,6 +137,85 @@ func addOperationDescribeScheduledInstancesMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeScheduledInstancesPaginator returns a new +// DescribeScheduledInstancesPaginator +func NewDescribeScheduledInstancesPaginator(client DescribeScheduledInstancesAPIClient, params *DescribeScheduledInstancesInput, optFns ...func(*DescribeScheduledInstancesPaginatorOptions)) *DescribeScheduledInstancesPaginator { + options := DescribeScheduledInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeScheduledInstancesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeScheduledInstances(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeSecurityGroups.go b/service/ec2/api_op_DescribeSecurityGroups.go index 1dd4bb21347..ca990657537 100644 --- a/service/ec2/api_op_DescribeSecurityGroups.go +++ b/service/ec2/api_op_DescribeSecurityGroups.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -223,6 +224,85 @@ func addOperationDescribeSecurityGroupsMiddlewares(stack *middleware.Stack, opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeSecurityGroupsPaginator returns a new DescribeSecurityGroupsPaginator +func NewDescribeSecurityGroupsPaginator(client DescribeSecurityGroupsAPIClient, params *DescribeSecurityGroupsInput, optFns ...func(*DescribeSecurityGroupsPaginatorOptions)) *DescribeSecurityGroupsPaginator { + options := DescribeSecurityGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeSecurityGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeSecurityGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeSnapshots.go b/service/ec2/api_op_DescribeSnapshots.go index 6f7248ea598..7eb11155225 100644 --- a/service/ec2/api_op_DescribeSnapshots.go +++ b/service/ec2/api_op_DescribeSnapshots.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -220,6 +221,89 @@ func addOperationDescribeSnapshotsMiddlewares(stack *middleware.Stack, options O return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeSnapshotsPaginator returns a new DescribeSnapshotsPaginator +func NewDescribeSnapshotsPaginator(client DescribeSnapshotsAPIClient, params *DescribeSnapshotsInput, optFns ...func(*DescribeSnapshotsPaginatorOptions)) *DescribeSnapshotsPaginator { + options := DescribeSnapshotsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeSnapshotsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeSnapshots(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeSpotFleetRequests.go b/service/ec2/api_op_DescribeSpotFleetRequests.go index c2213aa6778..c1b88918807 100644 --- a/service/ec2/api_op_DescribeSpotFleetRequests.go +++ b/service/ec2/api_op_DescribeSpotFleetRequests.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -120,6 +121,85 @@ func addOperationDescribeSpotFleetRequestsMiddlewares(stack *middleware.Stack, o return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeSpotFleetRequestsPaginator returns a new +// DescribeSpotFleetRequestsPaginator +func NewDescribeSpotFleetRequestsPaginator(client DescribeSpotFleetRequestsAPIClient, params *DescribeSpotFleetRequestsInput, optFns ...func(*DescribeSpotFleetRequestsPaginatorOptions)) *DescribeSpotFleetRequestsPaginator { + options := DescribeSpotFleetRequestsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeSpotFleetRequestsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeSpotFleetRequests(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeSpotInstanceRequests.go b/service/ec2/api_op_DescribeSpotInstanceRequests.go index 2985a830c58..8be39b88ae0 100644 --- a/service/ec2/api_op_DescribeSpotInstanceRequests.go +++ b/service/ec2/api_op_DescribeSpotInstanceRequests.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -264,6 +265,85 @@ func addOperationDescribeSpotInstanceRequestsMiddlewares(stack *middleware.Stack return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeSpotInstanceRequestsPaginator returns a new +// DescribeSpotInstanceRequestsPaginator +func NewDescribeSpotInstanceRequestsPaginator(client DescribeSpotInstanceRequestsAPIClient, params *DescribeSpotInstanceRequestsInput, optFns ...func(*DescribeSpotInstanceRequestsPaginatorOptions)) *DescribeSpotInstanceRequestsPaginator { + options := DescribeSpotInstanceRequestsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeSpotInstanceRequestsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeSpotInstanceRequests(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeSpotPriceHistory.go b/service/ec2/api_op_DescribeSpotPriceHistory.go index 111b36bc8ef..e0b7d618477 100644 --- a/service/ec2/api_op_DescribeSpotPriceHistory.go +++ b/service/ec2/api_op_DescribeSpotPriceHistory.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -163,6 +164,85 @@ func addOperationDescribeSpotPriceHistoryMiddlewares(stack *middleware.Stack, op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeSpotPriceHistoryPaginator returns a new +// DescribeSpotPriceHistoryPaginator +func NewDescribeSpotPriceHistoryPaginator(client DescribeSpotPriceHistoryAPIClient, params *DescribeSpotPriceHistoryInput, optFns ...func(*DescribeSpotPriceHistoryPaginatorOptions)) *DescribeSpotPriceHistoryPaginator { + options := DescribeSpotPriceHistoryPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeSpotPriceHistoryInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeSpotPriceHistory(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeStaleSecurityGroups.go b/service/ec2/api_op_DescribeStaleSecurityGroups.go index 45e6cad19b4..273d336a0a5 100644 --- a/service/ec2/api_op_DescribeStaleSecurityGroups.go +++ b/service/ec2/api_op_DescribeStaleSecurityGroups.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -125,6 +126,84 @@ func addOperationDescribeStaleSecurityGroupsMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeStaleSecurityGroupsPaginator returns a new +// DescribeStaleSecurityGroupsPaginator +func NewDescribeStaleSecurityGroupsPaginator(client DescribeStaleSecurityGroupsAPIClient, params *DescribeStaleSecurityGroupsInput, optFns ...func(*DescribeStaleSecurityGroupsPaginatorOptions)) *DescribeStaleSecurityGroupsPaginator { + options := DescribeStaleSecurityGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeStaleSecurityGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeStaleSecurityGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeSubnets.go b/service/ec2/api_op_DescribeSubnets.go index 3ae922a1163..05b280c25f5 100644 --- a/service/ec2/api_op_DescribeSubnets.go +++ b/service/ec2/api_op_DescribeSubnets.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -174,6 +175,82 @@ func addOperationDescribeSubnetsMiddlewares(stack *middleware.Stack, options Opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeSubnetsPaginator returns a new DescribeSubnetsPaginator +func NewDescribeSubnetsPaginator(client DescribeSubnetsAPIClient, params *DescribeSubnetsInput, optFns ...func(*DescribeSubnetsPaginatorOptions)) *DescribeSubnetsPaginator { + options := DescribeSubnetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeSubnetsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeSubnets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeTags.go b/service/ec2/api_op_DescribeTags.go index b4e560e7140..237123b6869 100644 --- a/service/ec2/api_op_DescribeTags.go +++ b/service/ec2/api_op_DescribeTags.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -139,6 +140,82 @@ func addOperationDescribeTagsMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeTagsPaginator returns a new DescribeTagsPaginator +func NewDescribeTagsPaginator(client DescribeTagsAPIClient, params *DescribeTagsInput, optFns ...func(*DescribeTagsPaginatorOptions)) *DescribeTagsPaginator { + options := DescribeTagsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeTagsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeTags(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeTrafficMirrorFilters.go b/service/ec2/api_op_DescribeTrafficMirrorFilters.go index fdd907b4bfc..d71800ed328 100644 --- a/service/ec2/api_op_DescribeTrafficMirrorFilters.go +++ b/service/ec2/api_op_DescribeTrafficMirrorFilters.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -125,6 +126,84 @@ func addOperationDescribeTrafficMirrorFiltersMiddlewares(stack *middleware.Stack return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeTrafficMirrorFiltersPaginator returns a new +// DescribeTrafficMirrorFiltersPaginator +func NewDescribeTrafficMirrorFiltersPaginator(client DescribeTrafficMirrorFiltersAPIClient, params *DescribeTrafficMirrorFiltersInput, optFns ...func(*DescribeTrafficMirrorFiltersPaginatorOptions)) *DescribeTrafficMirrorFiltersPaginator { + options := DescribeTrafficMirrorFiltersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeTrafficMirrorFiltersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeTrafficMirrorFilters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeTrafficMirrorSessions.go b/service/ec2/api_op_DescribeTrafficMirrorSessions.go index c0ec7106848..c684680e4b6 100644 --- a/service/ec2/api_op_DescribeTrafficMirrorSessions.go +++ b/service/ec2/api_op_DescribeTrafficMirrorSessions.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -147,6 +148,84 @@ func addOperationDescribeTrafficMirrorSessionsMiddlewares(stack *middleware.Stac return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeTrafficMirrorSessionsPaginator returns a new +// DescribeTrafficMirrorSessionsPaginator +func NewDescribeTrafficMirrorSessionsPaginator(client DescribeTrafficMirrorSessionsAPIClient, params *DescribeTrafficMirrorSessionsInput, optFns ...func(*DescribeTrafficMirrorSessionsPaginatorOptions)) *DescribeTrafficMirrorSessionsPaginator { + options := DescribeTrafficMirrorSessionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeTrafficMirrorSessionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeTrafficMirrorSessions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeTrafficMirrorTargets.go b/service/ec2/api_op_DescribeTrafficMirrorTargets.go index 61576aac1b4..781bb4c2ab4 100644 --- a/service/ec2/api_op_DescribeTrafficMirrorTargets.go +++ b/service/ec2/api_op_DescribeTrafficMirrorTargets.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -134,6 +135,84 @@ func addOperationDescribeTrafficMirrorTargetsMiddlewares(stack *middleware.Stack return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeTrafficMirrorTargetsPaginator returns a new +// DescribeTrafficMirrorTargetsPaginator +func NewDescribeTrafficMirrorTargetsPaginator(client DescribeTrafficMirrorTargetsAPIClient, params *DescribeTrafficMirrorTargetsInput, optFns ...func(*DescribeTrafficMirrorTargetsPaginatorOptions)) *DescribeTrafficMirrorTargetsPaginator { + options := DescribeTrafficMirrorTargetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeTrafficMirrorTargetsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeTrafficMirrorTargets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeTransitGatewayAttachments.go b/service/ec2/api_op_DescribeTransitGatewayAttachments.go index 3d26caf502a..4e3ac18a454 100644 --- a/service/ec2/api_op_DescribeTransitGatewayAttachments.go +++ b/service/ec2/api_op_DescribeTransitGatewayAttachments.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -150,6 +151,84 @@ func addOperationDescribeTransitGatewayAttachmentsMiddlewares(stack *middleware. return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeTransitGatewayAttachmentsPaginator returns a new +// DescribeTransitGatewayAttachmentsPaginator +func NewDescribeTransitGatewayAttachmentsPaginator(client DescribeTransitGatewayAttachmentsAPIClient, params *DescribeTransitGatewayAttachmentsInput, optFns ...func(*DescribeTransitGatewayAttachmentsPaginatorOptions)) *DescribeTransitGatewayAttachmentsPaginator { + options := DescribeTransitGatewayAttachmentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeTransitGatewayAttachmentsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeTransitGatewayAttachments(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeTransitGatewayMulticastDomains.go b/service/ec2/api_op_DescribeTransitGatewayMulticastDomains.go index d73fdf25ef7..8a0f12d90c2 100644 --- a/service/ec2/api_op_DescribeTransitGatewayMulticastDomains.go +++ b/service/ec2/api_op_DescribeTransitGatewayMulticastDomains.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -129,6 +130,84 @@ func addOperationDescribeTransitGatewayMulticastDomainsMiddlewares(stack *middle return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeTransitGatewayMulticastDomainsPaginator returns a new +// DescribeTransitGatewayMulticastDomainsPaginator +func NewDescribeTransitGatewayMulticastDomainsPaginator(client DescribeTransitGatewayMulticastDomainsAPIClient, params *DescribeTransitGatewayMulticastDomainsInput, optFns ...func(*DescribeTransitGatewayMulticastDomainsPaginatorOptions)) *DescribeTransitGatewayMulticastDomainsPaginator { + options := DescribeTransitGatewayMulticastDomainsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeTransitGatewayMulticastDomainsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeTransitGatewayMulticastDomains(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeTransitGatewayPeeringAttachments.go b/service/ec2/api_op_DescribeTransitGatewayPeeringAttachments.go index a8eaa2550a7..b3c9bb248e2 100644 --- a/service/ec2/api_op_DescribeTransitGatewayPeeringAttachments.go +++ b/service/ec2/api_op_DescribeTransitGatewayPeeringAttachments.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -135,6 +136,84 @@ func addOperationDescribeTransitGatewayPeeringAttachmentsMiddlewares(stack *midd return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeTransitGatewayPeeringAttachmentsPaginator returns a new +// DescribeTransitGatewayPeeringAttachmentsPaginator +func NewDescribeTransitGatewayPeeringAttachmentsPaginator(client DescribeTransitGatewayPeeringAttachmentsAPIClient, params *DescribeTransitGatewayPeeringAttachmentsInput, optFns ...func(*DescribeTransitGatewayPeeringAttachmentsPaginatorOptions)) *DescribeTransitGatewayPeeringAttachmentsPaginator { + options := DescribeTransitGatewayPeeringAttachmentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeTransitGatewayPeeringAttachmentsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeTransitGatewayPeeringAttachments(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeTransitGatewayRouteTables.go b/service/ec2/api_op_DescribeTransitGatewayRouteTables.go index 4ba3edc6811..7bee000f00c 100644 --- a/service/ec2/api_op_DescribeTransitGatewayRouteTables.go +++ b/service/ec2/api_op_DescribeTransitGatewayRouteTables.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -136,6 +137,84 @@ func addOperationDescribeTransitGatewayRouteTablesMiddlewares(stack *middleware. return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeTransitGatewayRouteTablesPaginator returns a new +// DescribeTransitGatewayRouteTablesPaginator +func NewDescribeTransitGatewayRouteTablesPaginator(client DescribeTransitGatewayRouteTablesAPIClient, params *DescribeTransitGatewayRouteTablesInput, optFns ...func(*DescribeTransitGatewayRouteTablesPaginatorOptions)) *DescribeTransitGatewayRouteTablesPaginator { + options := DescribeTransitGatewayRouteTablesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeTransitGatewayRouteTablesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeTransitGatewayRouteTables(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeTransitGatewayVpcAttachments.go b/service/ec2/api_op_DescribeTransitGatewayVpcAttachments.go index b0618e0c389..6db09904a55 100644 --- a/service/ec2/api_op_DescribeTransitGatewayVpcAttachments.go +++ b/service/ec2/api_op_DescribeTransitGatewayVpcAttachments.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -133,6 +134,84 @@ func addOperationDescribeTransitGatewayVpcAttachmentsMiddlewares(stack *middlewa return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeTransitGatewayVpcAttachmentsPaginator returns a new +// DescribeTransitGatewayVpcAttachmentsPaginator +func NewDescribeTransitGatewayVpcAttachmentsPaginator(client DescribeTransitGatewayVpcAttachmentsAPIClient, params *DescribeTransitGatewayVpcAttachmentsInput, optFns ...func(*DescribeTransitGatewayVpcAttachmentsPaginatorOptions)) *DescribeTransitGatewayVpcAttachmentsPaginator { + options := DescribeTransitGatewayVpcAttachmentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeTransitGatewayVpcAttachmentsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeTransitGatewayVpcAttachments(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeTransitGateways.go b/service/ec2/api_op_DescribeTransitGateways.go index b1ecf506543..3f3c1c52cba 100644 --- a/service/ec2/api_op_DescribeTransitGateways.go +++ b/service/ec2/api_op_DescribeTransitGateways.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -158,6 +159,84 @@ func addOperationDescribeTransitGatewaysMiddlewares(stack *middleware.Stack, opt return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeTransitGatewaysPaginator returns a new +// DescribeTransitGatewaysPaginator +func NewDescribeTransitGatewaysPaginator(client DescribeTransitGatewaysAPIClient, params *DescribeTransitGatewaysInput, optFns ...func(*DescribeTransitGatewaysPaginatorOptions)) *DescribeTransitGatewaysPaginator { + options := DescribeTransitGatewaysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeTransitGatewaysInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeTransitGateways(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeVolumeStatus.go b/service/ec2/api_op_DescribeVolumeStatus.go index 1e7f6eb4bcb..095f2ccab13 100644 --- a/service/ec2/api_op_DescribeVolumeStatus.go +++ b/service/ec2/api_op_DescribeVolumeStatus.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -193,6 +194,89 @@ func addOperationDescribeVolumeStatusMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeVolumeStatusPaginator returns a new DescribeVolumeStatusPaginator +func NewDescribeVolumeStatusPaginator(client DescribeVolumeStatusAPIClient, params *DescribeVolumeStatusInput, optFns ...func(*DescribeVolumeStatusPaginatorOptions)) *DescribeVolumeStatusPaginator { + options := DescribeVolumeStatusPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeVolumeStatusInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeVolumeStatus(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeVolumes.go b/service/ec2/api_op_DescribeVolumes.go index 88ef68ab8f0..ba74752969b 100644 --- a/service/ec2/api_op_DescribeVolumes.go +++ b/service/ec2/api_op_DescribeVolumes.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -194,6 +195,88 @@ func addOperationDescribeVolumesMiddlewares(stack *middleware.Stack, options Opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeVolumesPaginator returns a new DescribeVolumesPaginator +func NewDescribeVolumesPaginator(client DescribeVolumesAPIClient, params *DescribeVolumesInput, optFns ...func(*DescribeVolumesPaginatorOptions)) *DescribeVolumesPaginator { + options := DescribeVolumesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeVolumesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeVolumes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeVolumesModifications.go b/service/ec2/api_op_DescribeVolumesModifications.go index 45fcb88c0b6..502f9a687e2 100644 --- a/service/ec2/api_op_DescribeVolumesModifications.go +++ b/service/ec2/api_op_DescribeVolumesModifications.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -159,6 +160,84 @@ func addOperationDescribeVolumesModificationsMiddlewares(stack *middleware.Stack return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeVolumesModificationsPaginator returns a new +// DescribeVolumesModificationsPaginator +func NewDescribeVolumesModificationsPaginator(client DescribeVolumesModificationsAPIClient, params *DescribeVolumesModificationsInput, optFns ...func(*DescribeVolumesModificationsPaginatorOptions)) *DescribeVolumesModificationsPaginator { + options := DescribeVolumesModificationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeVolumesModificationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeVolumesModifications(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeVpcClassicLinkDnsSupport.go b/service/ec2/api_op_DescribeVpcClassicLinkDnsSupport.go index b5ee9a51a9f..9d5489d8cfe 100644 --- a/service/ec2/api_op_DescribeVpcClassicLinkDnsSupport.go +++ b/service/ec2/api_op_DescribeVpcClassicLinkDnsSupport.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -117,6 +118,84 @@ func addOperationDescribeVpcClassicLinkDnsSupportMiddlewares(stack *middleware.S return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeVpcClassicLinkDnsSupportPaginator returns a new +// DescribeVpcClassicLinkDnsSupportPaginator +func NewDescribeVpcClassicLinkDnsSupportPaginator(client DescribeVpcClassicLinkDnsSupportAPIClient, params *DescribeVpcClassicLinkDnsSupportInput, optFns ...func(*DescribeVpcClassicLinkDnsSupportPaginatorOptions)) *DescribeVpcClassicLinkDnsSupportPaginator { + options := DescribeVpcClassicLinkDnsSupportPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeVpcClassicLinkDnsSupportInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeVpcClassicLinkDnsSupport(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeVpcEndpointConnectionNotifications.go b/service/ec2/api_op_DescribeVpcEndpointConnectionNotifications.go index 00a597a6d2c..480fef2da54 100644 --- a/service/ec2/api_op_DescribeVpcEndpointConnectionNotifications.go +++ b/service/ec2/api_op_DescribeVpcEndpointConnectionNotifications.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -137,6 +138,84 @@ func addOperationDescribeVpcEndpointConnectionNotificationsMiddlewares(stack *mi return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeVpcEndpointConnectionNotificationsPaginator returns a new +// DescribeVpcEndpointConnectionNotificationsPaginator +func NewDescribeVpcEndpointConnectionNotificationsPaginator(client DescribeVpcEndpointConnectionNotificationsAPIClient, params *DescribeVpcEndpointConnectionNotificationsInput, optFns ...func(*DescribeVpcEndpointConnectionNotificationsPaginatorOptions)) *DescribeVpcEndpointConnectionNotificationsPaginator { + options := DescribeVpcEndpointConnectionNotificationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeVpcEndpointConnectionNotificationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeVpcEndpointConnectionNotifications(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeVpcEndpointConnections.go b/service/ec2/api_op_DescribeVpcEndpointConnections.go index 8f305de5b0e..43a33154ffa 100644 --- a/service/ec2/api_op_DescribeVpcEndpointConnections.go +++ b/service/ec2/api_op_DescribeVpcEndpointConnections.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -131,6 +132,86 @@ func addOperationDescribeVpcEndpointConnectionsMiddlewares(stack *middleware.Sta return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeVpcEndpointConnectionsPaginator returns a new +// DescribeVpcEndpointConnectionsPaginator +func NewDescribeVpcEndpointConnectionsPaginator(client DescribeVpcEndpointConnectionsAPIClient, params *DescribeVpcEndpointConnectionsInput, optFns ...func(*DescribeVpcEndpointConnectionsPaginatorOptions)) *DescribeVpcEndpointConnectionsPaginator { + options := DescribeVpcEndpointConnectionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeVpcEndpointConnectionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeVpcEndpointConnections(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeVpcEndpointServiceConfigurations.go b/service/ec2/api_op_DescribeVpcEndpointServiceConfigurations.go index c6fa72b2c09..a197d2709a4 100644 --- a/service/ec2/api_op_DescribeVpcEndpointServiceConfigurations.go +++ b/service/ec2/api_op_DescribeVpcEndpointServiceConfigurations.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -140,6 +141,86 @@ func addOperationDescribeVpcEndpointServiceConfigurationsMiddlewares(stack *midd return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeVpcEndpointServiceConfigurationsPaginator returns a new +// DescribeVpcEndpointServiceConfigurationsPaginator +func NewDescribeVpcEndpointServiceConfigurationsPaginator(client DescribeVpcEndpointServiceConfigurationsAPIClient, params *DescribeVpcEndpointServiceConfigurationsInput, optFns ...func(*DescribeVpcEndpointServiceConfigurationsPaginatorOptions)) *DescribeVpcEndpointServiceConfigurationsPaginator { + options := DescribeVpcEndpointServiceConfigurationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeVpcEndpointServiceConfigurationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeVpcEndpointServiceConfigurations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeVpcEndpointServicePermissions.go b/service/ec2/api_op_DescribeVpcEndpointServicePermissions.go index d96c4b7e648..8c23533cfc8 100644 --- a/service/ec2/api_op_DescribeVpcEndpointServicePermissions.go +++ b/service/ec2/api_op_DescribeVpcEndpointServicePermissions.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -132,6 +133,86 @@ func addOperationDescribeVpcEndpointServicePermissionsMiddlewares(stack *middlew return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeVpcEndpointServicePermissionsPaginator returns a new +// DescribeVpcEndpointServicePermissionsPaginator +func NewDescribeVpcEndpointServicePermissionsPaginator(client DescribeVpcEndpointServicePermissionsAPIClient, params *DescribeVpcEndpointServicePermissionsInput, optFns ...func(*DescribeVpcEndpointServicePermissionsPaginatorOptions)) *DescribeVpcEndpointServicePermissionsPaginator { + options := DescribeVpcEndpointServicePermissionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeVpcEndpointServicePermissionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeVpcEndpointServicePermissions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeVpcEndpoints.go b/service/ec2/api_op_DescribeVpcEndpoints.go index 429314e2dcb..b017704f145 100644 --- a/service/ec2/api_op_DescribeVpcEndpoints.go +++ b/service/ec2/api_op_DescribeVpcEndpoints.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -144,6 +145,84 @@ func addOperationDescribeVpcEndpointsMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeVpcEndpointsPaginator returns a new DescribeVpcEndpointsPaginator +func NewDescribeVpcEndpointsPaginator(client DescribeVpcEndpointsAPIClient, params *DescribeVpcEndpointsInput, optFns ...func(*DescribeVpcEndpointsPaginatorOptions)) *DescribeVpcEndpointsPaginator { + options := DescribeVpcEndpointsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeVpcEndpointsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeVpcEndpoints(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeVpcPeeringConnections.go b/service/ec2/api_op_DescribeVpcPeeringConnections.go index 3b24f693d56..ec5be5326e4 100644 --- a/service/ec2/api_op_DescribeVpcPeeringConnections.go +++ b/service/ec2/api_op_DescribeVpcPeeringConnections.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -161,6 +162,84 @@ func addOperationDescribeVpcPeeringConnectionsMiddlewares(stack *middleware.Stac return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeVpcPeeringConnectionsPaginator returns a new +// DescribeVpcPeeringConnectionsPaginator +func NewDescribeVpcPeeringConnectionsPaginator(client DescribeVpcPeeringConnectionsAPIClient, params *DescribeVpcPeeringConnectionsInput, optFns ...func(*DescribeVpcPeeringConnectionsPaginatorOptions)) *DescribeVpcPeeringConnectionsPaginator { + options := DescribeVpcPeeringConnectionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeVpcPeeringConnectionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeVpcPeeringConnections(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeVpcs.go b/service/ec2/api_op_DescribeVpcs.go index 2b6dea35a2e..5501ae409ea 100644 --- a/service/ec2/api_op_DescribeVpcs.go +++ b/service/ec2/api_op_DescribeVpcs.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -171,6 +172,81 @@ func addOperationDescribeVpcsMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeVpcsPaginator returns a new DescribeVpcsPaginator +func NewDescribeVpcsPaginator(client DescribeVpcsAPIClient, params *DescribeVpcsInput, optFns ...func(*DescribeVpcsPaginatorOptions)) *DescribeVpcsPaginator { + options := DescribeVpcsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeVpcsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeVpcs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_GetAssociatedIpv6PoolCidrs.go b/service/ec2/api_op_GetAssociatedIpv6PoolCidrs.go index 1f046debc42..7f077853602 100644 --- a/service/ec2/api_op_GetAssociatedIpv6PoolCidrs.go +++ b/service/ec2/api_op_GetAssociatedIpv6PoolCidrs.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -122,6 +123,84 @@ func addOperationGetAssociatedIpv6PoolCidrsMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetAssociatedIpv6PoolCidrsPaginator returns a new +// GetAssociatedIpv6PoolCidrsPaginator +func NewGetAssociatedIpv6PoolCidrsPaginator(client GetAssociatedIpv6PoolCidrsAPIClient, params *GetAssociatedIpv6PoolCidrsInput, optFns ...func(*GetAssociatedIpv6PoolCidrsPaginatorOptions)) *GetAssociatedIpv6PoolCidrsPaginator { + options := GetAssociatedIpv6PoolCidrsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetAssociatedIpv6PoolCidrsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetAssociatedIpv6PoolCidrs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_GetGroupsForCapacityReservation.go b/service/ec2/api_op_GetGroupsForCapacityReservation.go index a7b67df5bd3..ed04b302231 100644 --- a/service/ec2/api_op_GetGroupsForCapacityReservation.go +++ b/service/ec2/api_op_GetGroupsForCapacityReservation.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -124,6 +125,86 @@ func addOperationGetGroupsForCapacityReservationMiddlewares(stack *middleware.St return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetGroupsForCapacityReservationPaginator returns a new +// GetGroupsForCapacityReservationPaginator +func NewGetGroupsForCapacityReservationPaginator(client GetGroupsForCapacityReservationAPIClient, params *GetGroupsForCapacityReservationInput, optFns ...func(*GetGroupsForCapacityReservationPaginatorOptions)) *GetGroupsForCapacityReservationPaginator { + options := GetGroupsForCapacityReservationPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetGroupsForCapacityReservationInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetGroupsForCapacityReservation(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_GetManagedPrefixListAssociations.go b/service/ec2/api_op_GetManagedPrefixListAssociations.go index 02e52369fc6..856e076ebf8 100644 --- a/service/ec2/api_op_GetManagedPrefixListAssociations.go +++ b/service/ec2/api_op_GetManagedPrefixListAssociations.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -122,6 +123,84 @@ func addOperationGetManagedPrefixListAssociationsMiddlewares(stack *middleware.S return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetManagedPrefixListAssociationsPaginator returns a new +// GetManagedPrefixListAssociationsPaginator +func NewGetManagedPrefixListAssociationsPaginator(client GetManagedPrefixListAssociationsAPIClient, params *GetManagedPrefixListAssociationsInput, optFns ...func(*GetManagedPrefixListAssociationsPaginatorOptions)) *GetManagedPrefixListAssociationsPaginator { + options := GetManagedPrefixListAssociationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetManagedPrefixListAssociationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetManagedPrefixListAssociations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_GetManagedPrefixListEntries.go b/service/ec2/api_op_GetManagedPrefixListEntries.go index f994f1dd9cf..01a47724227 100644 --- a/service/ec2/api_op_GetManagedPrefixListEntries.go +++ b/service/ec2/api_op_GetManagedPrefixListEntries.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -125,6 +126,84 @@ func addOperationGetManagedPrefixListEntriesMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetManagedPrefixListEntriesPaginator returns a new +// GetManagedPrefixListEntriesPaginator +func NewGetManagedPrefixListEntriesPaginator(client GetManagedPrefixListEntriesAPIClient, params *GetManagedPrefixListEntriesInput, optFns ...func(*GetManagedPrefixListEntriesPaginatorOptions)) *GetManagedPrefixListEntriesPaginator { + options := GetManagedPrefixListEntriesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetManagedPrefixListEntriesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetManagedPrefixListEntries(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_GetTransitGatewayAttachmentPropagations.go b/service/ec2/api_op_GetTransitGatewayAttachmentPropagations.go index 61800fe0253..71afb714232 100644 --- a/service/ec2/api_op_GetTransitGatewayAttachmentPropagations.go +++ b/service/ec2/api_op_GetTransitGatewayAttachmentPropagations.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -128,6 +129,84 @@ func addOperationGetTransitGatewayAttachmentPropagationsMiddlewares(stack *middl return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetTransitGatewayAttachmentPropagationsPaginator returns a new +// GetTransitGatewayAttachmentPropagationsPaginator +func NewGetTransitGatewayAttachmentPropagationsPaginator(client GetTransitGatewayAttachmentPropagationsAPIClient, params *GetTransitGatewayAttachmentPropagationsInput, optFns ...func(*GetTransitGatewayAttachmentPropagationsPaginatorOptions)) *GetTransitGatewayAttachmentPropagationsPaginator { + options := GetTransitGatewayAttachmentPropagationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetTransitGatewayAttachmentPropagationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetTransitGatewayAttachmentPropagations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_GetTransitGatewayMulticastDomainAssociations.go b/service/ec2/api_op_GetTransitGatewayMulticastDomainAssociations.go index 0221fde3761..7a64ffe2ca2 100644 --- a/service/ec2/api_op_GetTransitGatewayMulticastDomainAssociations.go +++ b/service/ec2/api_op_GetTransitGatewayMulticastDomainAssociations.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -135,6 +136,84 @@ func addOperationGetTransitGatewayMulticastDomainAssociationsMiddlewares(stack * return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetTransitGatewayMulticastDomainAssociationsPaginator returns a new +// GetTransitGatewayMulticastDomainAssociationsPaginator +func NewGetTransitGatewayMulticastDomainAssociationsPaginator(client GetTransitGatewayMulticastDomainAssociationsAPIClient, params *GetTransitGatewayMulticastDomainAssociationsInput, optFns ...func(*GetTransitGatewayMulticastDomainAssociationsPaginatorOptions)) *GetTransitGatewayMulticastDomainAssociationsPaginator { + options := GetTransitGatewayMulticastDomainAssociationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetTransitGatewayMulticastDomainAssociationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetTransitGatewayMulticastDomainAssociations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_GetTransitGatewayPrefixListReferences.go b/service/ec2/api_op_GetTransitGatewayPrefixListReferences.go index dfc5b70e62f..7dd758f7ffa 100644 --- a/service/ec2/api_op_GetTransitGatewayPrefixListReferences.go +++ b/service/ec2/api_op_GetTransitGatewayPrefixListReferences.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -146,6 +147,84 @@ func addOperationGetTransitGatewayPrefixListReferencesMiddlewares(stack *middlew return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetTransitGatewayPrefixListReferencesPaginator returns a new +// GetTransitGatewayPrefixListReferencesPaginator +func NewGetTransitGatewayPrefixListReferencesPaginator(client GetTransitGatewayPrefixListReferencesAPIClient, params *GetTransitGatewayPrefixListReferencesInput, optFns ...func(*GetTransitGatewayPrefixListReferencesPaginatorOptions)) *GetTransitGatewayPrefixListReferencesPaginator { + options := GetTransitGatewayPrefixListReferencesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetTransitGatewayPrefixListReferencesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetTransitGatewayPrefixListReferences(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_GetTransitGatewayRouteTableAssociations.go b/service/ec2/api_op_GetTransitGatewayRouteTableAssociations.go index 04bc3057b46..4055088058d 100644 --- a/service/ec2/api_op_GetTransitGatewayRouteTableAssociations.go +++ b/service/ec2/api_op_GetTransitGatewayRouteTableAssociations.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -134,6 +135,84 @@ func addOperationGetTransitGatewayRouteTableAssociationsMiddlewares(stack *middl return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetTransitGatewayRouteTableAssociationsPaginator returns a new +// GetTransitGatewayRouteTableAssociationsPaginator +func NewGetTransitGatewayRouteTableAssociationsPaginator(client GetTransitGatewayRouteTableAssociationsAPIClient, params *GetTransitGatewayRouteTableAssociationsInput, optFns ...func(*GetTransitGatewayRouteTableAssociationsPaginatorOptions)) *GetTransitGatewayRouteTableAssociationsPaginator { + options := GetTransitGatewayRouteTableAssociationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetTransitGatewayRouteTableAssociationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetTransitGatewayRouteTableAssociations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_GetTransitGatewayRouteTablePropagations.go b/service/ec2/api_op_GetTransitGatewayRouteTablePropagations.go index bb82edab26e..09f8ae72baa 100644 --- a/service/ec2/api_op_GetTransitGatewayRouteTablePropagations.go +++ b/service/ec2/api_op_GetTransitGatewayRouteTablePropagations.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -134,6 +135,84 @@ func addOperationGetTransitGatewayRouteTablePropagationsMiddlewares(stack *middl return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetTransitGatewayRouteTablePropagationsPaginator returns a new +// GetTransitGatewayRouteTablePropagationsPaginator +func NewGetTransitGatewayRouteTablePropagationsPaginator(client GetTransitGatewayRouteTablePropagationsAPIClient, params *GetTransitGatewayRouteTablePropagationsInput, optFns ...func(*GetTransitGatewayRouteTablePropagationsPaginatorOptions)) *GetTransitGatewayRouteTablePropagationsPaginator { + options := GetTransitGatewayRouteTablePropagationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetTransitGatewayRouteTablePropagationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetTransitGatewayRouteTablePropagations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_SearchLocalGatewayRoutes.go b/service/ec2/api_op_SearchLocalGatewayRoutes.go index d206fffcd18..e0c85c96f29 100644 --- a/service/ec2/api_op_SearchLocalGatewayRoutes.go +++ b/service/ec2/api_op_SearchLocalGatewayRoutes.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -126,6 +127,84 @@ func addOperationSearchLocalGatewayRoutesMiddlewares(stack *middleware.Stack, op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewSearchLocalGatewayRoutesPaginator returns a new +// SearchLocalGatewayRoutesPaginator +func NewSearchLocalGatewayRoutesPaginator(client SearchLocalGatewayRoutesAPIClient, params *SearchLocalGatewayRoutesInput, optFns ...func(*SearchLocalGatewayRoutesPaginatorOptions)) *SearchLocalGatewayRoutesPaginator { + options := SearchLocalGatewayRoutesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchLocalGatewayRoutesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearchLocalGatewayRoutes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_SearchTransitGatewayMulticastGroups.go b/service/ec2/api_op_SearchTransitGatewayMulticastGroups.go index 07fc8624008..b28adbea2b4 100644 --- a/service/ec2/api_op_SearchTransitGatewayMulticastGroups.go +++ b/service/ec2/api_op_SearchTransitGatewayMulticastGroups.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" @@ -150,6 +151,84 @@ func addOperationSearchTransitGatewayMulticastGroupsMiddlewares(stack *middlewar return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewSearchTransitGatewayMulticastGroupsPaginator returns a new +// SearchTransitGatewayMulticastGroupsPaginator +func NewSearchTransitGatewayMulticastGroupsPaginator(client SearchTransitGatewayMulticastGroupsAPIClient, params *SearchTransitGatewayMulticastGroupsInput, optFns ...func(*SearchTransitGatewayMulticastGroupsPaginatorOptions)) *SearchTransitGatewayMulticastGroupsPaginator { + options := SearchTransitGatewayMulticastGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchTransitGatewayMulticastGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearchTransitGatewayMulticastGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/go.mod b/service/ec2/go.mod index ca9ab136373..dde0768dbe5 100644 --- a/service/ec2/go.mod +++ b/service/ec2/go.mod @@ -5,7 +5,7 @@ go 1.15 require ( github.com/aws/aws-sdk-go-v2 v0.29.0 github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v0.1.0 - github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/ec2/go.sum b/service/ec2/go.sum index 875bf37048a..a611da1251c 100644 --- a/service/ec2/go.sum +++ b/service/ec2/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 1cf4196f31a..00000000000 --- a/service/ec2/paginators.go +++ /dev/null @@ -1,7057 +0,0 @@ -// 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.mod b/service/ec2instanceconnect/go.mod index 633cc4df6fe..e9299c6367a 100644 --- a/service/ec2instanceconnect/go.mod +++ b/service/ec2instanceconnect/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/ec2instanceconnect/go.sum b/service/ec2instanceconnect/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/ec2instanceconnect/go.sum +++ b/service/ec2instanceconnect/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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/api_op_DescribeImageScanFindings.go b/service/ecr/api_op_DescribeImageScanFindings.go index 0806e163f0e..b58b4322d72 100644 --- a/service/ecr/api_op_DescribeImageScanFindings.go +++ b/service/ecr/api_op_DescribeImageScanFindings.go @@ -4,6 +4,7 @@ package ecr import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecr/types" @@ -149,6 +150,90 @@ func addOperationDescribeImageScanFindingsMiddlewares(stack *middleware.Stack, o return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeImageScanFindingsPaginator returns a new +// DescribeImageScanFindingsPaginator +func NewDescribeImageScanFindingsPaginator(client DescribeImageScanFindingsAPIClient, params *DescribeImageScanFindingsInput, optFns ...func(*DescribeImageScanFindingsPaginatorOptions)) *DescribeImageScanFindingsPaginator { + options := DescribeImageScanFindingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeImageScanFindingsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeImageScanFindings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ecr/api_op_DescribeImages.go b/service/ecr/api_op_DescribeImages.go index 7c25be700bc..277ab7d4997 100644 --- a/service/ecr/api_op_DescribeImages.go +++ b/service/ecr/api_op_DescribeImages.go @@ -4,6 +4,7 @@ package ecr import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecr/types" @@ -142,6 +143,88 @@ func addOperationDescribeImagesMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeImagesPaginator returns a new DescribeImagesPaginator +func NewDescribeImagesPaginator(client DescribeImagesAPIClient, params *DescribeImagesInput, optFns ...func(*DescribeImagesPaginatorOptions)) *DescribeImagesPaginator { + options := DescribeImagesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeImagesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeImages(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ecr/api_op_DescribeRepositories.go b/service/ecr/api_op_DescribeRepositories.go index 364a3113a9d..521b14cc051 100644 --- a/service/ecr/api_op_DescribeRepositories.go +++ b/service/ecr/api_op_DescribeRepositories.go @@ -4,6 +4,7 @@ package ecr import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecr/types" @@ -131,6 +132,89 @@ func addOperationDescribeRepositoriesMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeRepositoriesPaginator returns a new DescribeRepositoriesPaginator +func NewDescribeRepositoriesPaginator(client DescribeRepositoriesAPIClient, params *DescribeRepositoriesInput, optFns ...func(*DescribeRepositoriesPaginatorOptions)) *DescribeRepositoriesPaginator { + options := DescribeRepositoriesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeRepositoriesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeRepositories(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ecr/api_op_GetLifecyclePolicyPreview.go b/service/ecr/api_op_GetLifecyclePolicyPreview.go index 965fa49b6a4..5bc74541537 100644 --- a/service/ecr/api_op_GetLifecyclePolicyPreview.go +++ b/service/ecr/api_op_GetLifecyclePolicyPreview.go @@ -4,6 +4,7 @@ package ecr import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecr/types" @@ -157,6 +158,92 @@ func addOperationGetLifecyclePolicyPreviewMiddlewares(stack *middleware.Stack, o return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetLifecyclePolicyPreviewPaginator returns a new +// GetLifecyclePolicyPreviewPaginator +func NewGetLifecyclePolicyPreviewPaginator(client GetLifecyclePolicyPreviewAPIClient, params *GetLifecyclePolicyPreviewInput, optFns ...func(*GetLifecyclePolicyPreviewPaginatorOptions)) *GetLifecyclePolicyPreviewPaginator { + options := GetLifecyclePolicyPreviewPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetLifecyclePolicyPreviewInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetLifecyclePolicyPreview(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ecr/api_op_ListImages.go b/service/ecr/api_op_ListImages.go index 9458b5f49dd..8ce8588866a 100644 --- a/service/ecr/api_op_ListImages.go +++ b/service/ecr/api_op_ListImages.go @@ -4,6 +4,7 @@ package ecr import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecr/types" @@ -140,6 +141,86 @@ func addOperationListImagesMiddlewares(stack *middleware.Stack, options Options) return 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 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListImagesPaginator returns a new ListImagesPaginator +func NewListImagesPaginator(client ListImagesAPIClient, params *ListImagesInput, optFns ...func(*ListImagesPaginatorOptions)) *ListImagesPaginator { + options := ListImagesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListImagesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListImages(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ecr/go.mod b/service/ecr/go.mod index 26217ab1024..f95428ab774 100644 --- a/service/ecr/go.mod +++ b/service/ecr/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/ecr/go.sum b/service/ecr/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/ecr/go.sum +++ b/service/ecr/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 7e2ee509a64..00000000000 --- a/service/ecr/paginators.go +++ /dev/null @@ -1,423 +0,0 @@ -// 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/api_op_ListAccountSettings.go b/service/ecs/api_op_ListAccountSettings.go index 7440760556b..7a08dca4c68 100644 --- a/service/ecs/api_op_ListAccountSettings.go +++ b/service/ecs/api_op_ListAccountSettings.go @@ -4,6 +4,7 @@ package ecs import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecs/types" @@ -137,6 +138,88 @@ func addOperationListAccountSettingsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAccountSettingsPaginator returns a new ListAccountSettingsPaginator +func NewListAccountSettingsPaginator(client ListAccountSettingsAPIClient, params *ListAccountSettingsInput, optFns ...func(*ListAccountSettingsPaginatorOptions)) *ListAccountSettingsPaginator { + options := ListAccountSettingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAccountSettingsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAccountSettings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ecs/api_op_ListAttributes.go b/service/ecs/api_op_ListAttributes.go index e63fb9ade93..346c17122d4 100644 --- a/service/ecs/api_op_ListAttributes.go +++ b/service/ecs/api_op_ListAttributes.go @@ -4,6 +4,7 @@ package ecs import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecs/types" @@ -144,6 +145,87 @@ func addOperationListAttributesMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAttributesPaginator returns a new ListAttributesPaginator +func NewListAttributesPaginator(client ListAttributesAPIClient, params *ListAttributesInput, optFns ...func(*ListAttributesPaginatorOptions)) *ListAttributesPaginator { + options := ListAttributesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAttributesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAttributes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ecs/api_op_ListClusters.go b/service/ecs/api_op_ListClusters.go index 5db53eb06bf..34fda3e293a 100644 --- a/service/ecs/api_op_ListClusters.go +++ b/service/ecs/api_op_ListClusters.go @@ -4,6 +4,7 @@ package ecs import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -119,6 +120,86 @@ func addOperationListClustersMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListClustersPaginator returns a new ListClustersPaginator +func NewListClustersPaginator(client ListClustersAPIClient, params *ListClustersInput, optFns ...func(*ListClustersPaginatorOptions)) *ListClustersPaginator { + options := ListClustersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListClustersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListClusters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ecs/api_op_ListContainerInstances.go b/service/ecs/api_op_ListContainerInstances.go index c428f1354c1..6ea44706ff7 100644 --- a/service/ecs/api_op_ListContainerInstances.go +++ b/service/ecs/api_op_ListContainerInstances.go @@ -4,6 +4,7 @@ package ecs import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecs/types" @@ -144,6 +145,89 @@ func addOperationListContainerInstancesMiddlewares(stack *middleware.Stack, opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListContainerInstancesPaginator returns a new ListContainerInstancesPaginator +func NewListContainerInstancesPaginator(client ListContainerInstancesAPIClient, params *ListContainerInstancesInput, optFns ...func(*ListContainerInstancesPaginatorOptions)) *ListContainerInstancesPaginator { + options := ListContainerInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListContainerInstancesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListContainerInstances(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ecs/api_op_ListServices.go b/service/ecs/api_op_ListServices.go index fcb6cb063bc..022a9adae47 100644 --- a/service/ecs/api_op_ListServices.go +++ b/service/ecs/api_op_ListServices.go @@ -4,6 +4,7 @@ package ecs import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecs/types" @@ -131,6 +132,86 @@ func addOperationListServicesMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListServicesPaginator returns a new ListServicesPaginator +func NewListServicesPaginator(client ListServicesAPIClient, params *ListServicesInput, optFns ...func(*ListServicesPaginatorOptions)) *ListServicesPaginator { + options := ListServicesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListServicesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListServices(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ecs/api_op_ListTaskDefinitionFamilies.go b/service/ecs/api_op_ListTaskDefinitionFamilies.go index 5e96b53c80c..0ac894e8b83 100644 --- a/service/ecs/api_op_ListTaskDefinitionFamilies.go +++ b/service/ecs/api_op_ListTaskDefinitionFamilies.go @@ -4,6 +4,7 @@ package ecs import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecs/types" @@ -140,6 +141,90 @@ func addOperationListTaskDefinitionFamiliesMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTaskDefinitionFamiliesPaginator returns a new +// ListTaskDefinitionFamiliesPaginator +func NewListTaskDefinitionFamiliesPaginator(client ListTaskDefinitionFamiliesAPIClient, params *ListTaskDefinitionFamiliesInput, optFns ...func(*ListTaskDefinitionFamiliesPaginatorOptions)) *ListTaskDefinitionFamiliesPaginator { + options := ListTaskDefinitionFamiliesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTaskDefinitionFamiliesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTaskDefinitionFamilies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ecs/api_op_ListTaskDefinitions.go b/service/ecs/api_op_ListTaskDefinitions.go index 6c8abcb592e..6135c0a856e 100644 --- a/service/ecs/api_op_ListTaskDefinitions.go +++ b/service/ecs/api_op_ListTaskDefinitions.go @@ -4,6 +4,7 @@ package ecs import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecs/types" @@ -142,6 +143,88 @@ func addOperationListTaskDefinitionsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTaskDefinitionsPaginator returns a new ListTaskDefinitionsPaginator +func NewListTaskDefinitionsPaginator(client ListTaskDefinitionsAPIClient, params *ListTaskDefinitionsInput, optFns ...func(*ListTaskDefinitionsPaginatorOptions)) *ListTaskDefinitionsPaginator { + options := ListTaskDefinitionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTaskDefinitionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTaskDefinitions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ecs/api_op_ListTasks.go b/service/ecs/api_op_ListTasks.go index a4c74c6a08c..37c302aca3b 100644 --- a/service/ecs/api_op_ListTasks.go +++ b/service/ecs/api_op_ListTasks.go @@ -4,6 +4,7 @@ package ecs import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ecs/types" @@ -157,6 +158,86 @@ func addOperationListTasksMiddlewares(stack *middleware.Stack, options Options) return 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 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTasksPaginator returns a new ListTasksPaginator +func NewListTasksPaginator(client ListTasksAPIClient, params *ListTasksInput, optFns ...func(*ListTasksPaginatorOptions)) *ListTasksPaginator { + options := ListTasksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTasksInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTasks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ecs/go.mod b/service/ecs/go.mod index fe357227b38..b3a6696cc8f 100644 --- a/service/ecs/go.mod +++ b/service/ecs/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/ecs/go.sum b/service/ecs/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/ecs/go.sum +++ b/service/ecs/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 8fdc67b74ec..00000000000 --- a/service/ecs/paginators.go +++ /dev/null @@ -1,660 +0,0 @@ -// 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/api_op_DescribeAccessPoints.go b/service/efs/api_op_DescribeAccessPoints.go index dd87bdeeab4..731ddebd1e8 100644 --- a/service/efs/api_op_DescribeAccessPoints.go +++ b/service/efs/api_op_DescribeAccessPoints.go @@ -4,6 +4,7 @@ package efs import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/efs/types" @@ -122,6 +123,84 @@ func addOperationDescribeAccessPointsMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeAccessPointsPaginator returns a new DescribeAccessPointsPaginator +func NewDescribeAccessPointsPaginator(client DescribeAccessPointsAPIClient, params *DescribeAccessPointsInput, optFns ...func(*DescribeAccessPointsPaginatorOptions)) *DescribeAccessPointsPaginator { + options := DescribeAccessPointsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeAccessPointsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeAccessPoints(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/efs/api_op_DescribeFileSystems.go b/service/efs/api_op_DescribeFileSystems.go index 9421a05aa33..0771ef7c463 100644 --- a/service/efs/api_op_DescribeFileSystems.go +++ b/service/efs/api_op_DescribeFileSystems.go @@ -4,6 +4,7 @@ package efs import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/efs/types" @@ -139,6 +140,84 @@ func addOperationDescribeFileSystemsMiddlewares(stack *middleware.Stack, options return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeFileSystemsPaginator returns a new DescribeFileSystemsPaginator +func NewDescribeFileSystemsPaginator(client DescribeFileSystemsAPIClient, params *DescribeFileSystemsInput, optFns ...func(*DescribeFileSystemsPaginatorOptions)) *DescribeFileSystemsPaginator { + options := DescribeFileSystemsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeFileSystemsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeFileSystems(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/efs/api_op_DescribeTags.go b/service/efs/api_op_DescribeTags.go index 6e0458ffc07..540fb3b4fff 100644 --- a/service/efs/api_op_DescribeTags.go +++ b/service/efs/api_op_DescribeTags.go @@ -4,6 +4,7 @@ package efs import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/efs/types" @@ -131,6 +132,83 @@ func addOperationDescribeTagsMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeTagsPaginator returns a new DescribeTagsPaginator +func NewDescribeTagsPaginator(client DescribeTagsAPIClient, params *DescribeTagsInput, optFns ...func(*DescribeTagsPaginatorOptions)) *DescribeTagsPaginator { + options := DescribeTagsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeTagsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeTags(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/efs/api_op_ListTagsForResource.go b/service/efs/api_op_ListTagsForResource.go index 6cda5136de5..7b1f922e76b 100644 --- a/service/efs/api_op_ListTagsForResource.go +++ b/service/efs/api_op_ListTagsForResource.go @@ -4,6 +4,7 @@ package efs import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/efs/types" @@ -119,6 +120,83 @@ func addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator +func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator { + options := ListTagsForResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTagsForResourceInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/efs/go.mod b/service/efs/go.mod index 9f13763e5f2..827ec4c682e 100644 --- a/service/efs/go.mod +++ b/service/efs/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/efs/go.sum b/service/efs/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/efs/go.sum +++ b/service/efs/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 2f55d88d433..00000000000 --- a/service/efs/paginators.go +++ /dev/null @@ -1,318 +0,0 @@ -// 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/api_op_ListClusters.go b/service/eks/api_op_ListClusters.go index c35e8b643b6..fb45e9abd2f 100644 --- a/service/eks/api_op_ListClusters.go +++ b/service/eks/api_op_ListClusters.go @@ -4,6 +4,7 @@ package eks import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -118,6 +119,86 @@ func addOperationListClustersMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListClustersPaginator returns a new ListClustersPaginator +func NewListClustersPaginator(client ListClustersAPIClient, params *ListClustersInput, optFns ...func(*ListClustersPaginatorOptions)) *ListClustersPaginator { + options := ListClustersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListClustersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListClusters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/eks/api_op_ListFargateProfiles.go b/service/eks/api_op_ListFargateProfiles.go index a8d3db2df29..26fa036565d 100644 --- a/service/eks/api_op_ListFargateProfiles.go +++ b/service/eks/api_op_ListFargateProfiles.go @@ -4,6 +4,7 @@ package eks import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -126,6 +127,88 @@ func addOperationListFargateProfilesMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListFargateProfilesPaginator returns a new ListFargateProfilesPaginator +func NewListFargateProfilesPaginator(client ListFargateProfilesAPIClient, params *ListFargateProfilesInput, optFns ...func(*ListFargateProfilesPaginatorOptions)) *ListFargateProfilesPaginator { + options := ListFargateProfilesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListFargateProfilesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListFargateProfiles(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/eks/api_op_ListNodegroups.go b/service/eks/api_op_ListNodegroups.go index eb85a328442..fa9410f4cf5 100644 --- a/service/eks/api_op_ListNodegroups.go +++ b/service/eks/api_op_ListNodegroups.go @@ -4,6 +4,7 @@ package eks import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -126,6 +127,87 @@ func addOperationListNodegroupsMiddlewares(stack *middleware.Stack, options Opti return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListNodegroupsPaginator returns a new ListNodegroupsPaginator +func NewListNodegroupsPaginator(client ListNodegroupsAPIClient, params *ListNodegroupsInput, optFns ...func(*ListNodegroupsPaginatorOptions)) *ListNodegroupsPaginator { + options := ListNodegroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListNodegroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListNodegroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/eks/api_op_ListUpdates.go b/service/eks/api_op_ListUpdates.go index 9a90cf969f7..42dc3641a08 100644 --- a/service/eks/api_op_ListUpdates.go +++ b/service/eks/api_op_ListUpdates.go @@ -4,6 +4,7 @@ package eks import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -128,6 +129,86 @@ func addOperationListUpdatesMiddlewares(stack *middleware.Stack, options Options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListUpdatesPaginator returns a new ListUpdatesPaginator +func NewListUpdatesPaginator(client ListUpdatesAPIClient, params *ListUpdatesInput, optFns ...func(*ListUpdatesPaginatorOptions)) *ListUpdatesPaginator { + options := ListUpdatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListUpdatesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListUpdates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/eks/go.mod b/service/eks/go.mod index 9c10252a7e4..aced7ee26b4 100644 --- a/service/eks/go.mod +++ b/service/eks/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/eks/go.sum b/service/eks/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/eks/go.sum +++ b/service/eks/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 14ba058ba4c..00000000000 --- a/service/eks/paginators.go +++ /dev/null @@ -1,331 +0,0 @@ -// 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/api_op_DescribeCacheClusters.go b/service/elasticache/api_op_DescribeCacheClusters.go index e2df30c4dea..d8bf0151b7a 100644 --- a/service/elasticache/api_op_DescribeCacheClusters.go +++ b/service/elasticache/api_op_DescribeCacheClusters.go @@ -4,6 +4,7 @@ package elasticache import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/elasticache/types" @@ -141,6 +142,85 @@ func addOperationDescribeCacheClustersMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeCacheClustersPaginator returns a new DescribeCacheClustersPaginator +func NewDescribeCacheClustersPaginator(client DescribeCacheClustersAPIClient, params *DescribeCacheClustersInput, optFns ...func(*DescribeCacheClustersPaginatorOptions)) *DescribeCacheClustersPaginator { + options := DescribeCacheClustersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeCacheClustersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeCacheClusters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticache/api_op_DescribeCacheEngineVersions.go b/service/elasticache/api_op_DescribeCacheEngineVersions.go index 4b1dcd82029..72057cd47ca 100644 --- a/service/elasticache/api_op_DescribeCacheEngineVersions.go +++ b/service/elasticache/api_op_DescribeCacheEngineVersions.go @@ -4,6 +4,7 @@ package elasticache import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/elasticache/types" @@ -137,6 +138,86 @@ func addOperationDescribeCacheEngineVersionsMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeCacheEngineVersionsPaginator returns a new +// DescribeCacheEngineVersionsPaginator +func NewDescribeCacheEngineVersionsPaginator(client DescribeCacheEngineVersionsAPIClient, params *DescribeCacheEngineVersionsInput, optFns ...func(*DescribeCacheEngineVersionsPaginatorOptions)) *DescribeCacheEngineVersionsPaginator { + options := DescribeCacheEngineVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeCacheEngineVersionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeCacheEngineVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticache/api_op_DescribeCacheParameterGroups.go b/service/elasticache/api_op_DescribeCacheParameterGroups.go index a2e22448c0e..0ebf4c0a7f5 100644 --- a/service/elasticache/api_op_DescribeCacheParameterGroups.go +++ b/service/elasticache/api_op_DescribeCacheParameterGroups.go @@ -4,6 +4,7 @@ package elasticache import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/elasticache/types" @@ -118,6 +119,86 @@ func addOperationDescribeCacheParameterGroupsMiddlewares(stack *middleware.Stack return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeCacheParameterGroupsPaginator returns a new +// DescribeCacheParameterGroupsPaginator +func NewDescribeCacheParameterGroupsPaginator(client DescribeCacheParameterGroupsAPIClient, params *DescribeCacheParameterGroupsInput, optFns ...func(*DescribeCacheParameterGroupsPaginatorOptions)) *DescribeCacheParameterGroupsPaginator { + options := DescribeCacheParameterGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeCacheParameterGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeCacheParameterGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticache/api_op_DescribeCacheParameters.go b/service/elasticache/api_op_DescribeCacheParameters.go index 7c75e4c3d7c..30cb0c7b32f 100644 --- a/service/elasticache/api_op_DescribeCacheParameters.go +++ b/service/elasticache/api_op_DescribeCacheParameters.go @@ -4,6 +4,7 @@ package elasticache import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/elasticache/types" @@ -128,6 +129,86 @@ func addOperationDescribeCacheParametersMiddlewares(stack *middleware.Stack, opt return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeCacheParametersPaginator returns a new +// DescribeCacheParametersPaginator +func NewDescribeCacheParametersPaginator(client DescribeCacheParametersAPIClient, params *DescribeCacheParametersInput, optFns ...func(*DescribeCacheParametersPaginatorOptions)) *DescribeCacheParametersPaginator { + options := DescribeCacheParametersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeCacheParametersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeCacheParameters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticache/api_op_DescribeCacheSecurityGroups.go b/service/elasticache/api_op_DescribeCacheSecurityGroups.go index d287bbb2e90..b89b7d37d18 100644 --- a/service/elasticache/api_op_DescribeCacheSecurityGroups.go +++ b/service/elasticache/api_op_DescribeCacheSecurityGroups.go @@ -4,6 +4,7 @@ package elasticache import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/elasticache/types" @@ -119,6 +120,86 @@ func addOperationDescribeCacheSecurityGroupsMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeCacheSecurityGroupsPaginator returns a new +// DescribeCacheSecurityGroupsPaginator +func NewDescribeCacheSecurityGroupsPaginator(client DescribeCacheSecurityGroupsAPIClient, params *DescribeCacheSecurityGroupsInput, optFns ...func(*DescribeCacheSecurityGroupsPaginatorOptions)) *DescribeCacheSecurityGroupsPaginator { + options := DescribeCacheSecurityGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeCacheSecurityGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeCacheSecurityGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticache/api_op_DescribeCacheSubnetGroups.go b/service/elasticache/api_op_DescribeCacheSubnetGroups.go index 62ec63071d5..d55f26c72c7 100644 --- a/service/elasticache/api_op_DescribeCacheSubnetGroups.go +++ b/service/elasticache/api_op_DescribeCacheSubnetGroups.go @@ -4,6 +4,7 @@ package elasticache import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/elasticache/types" @@ -120,6 +121,86 @@ func addOperationDescribeCacheSubnetGroupsMiddlewares(stack *middleware.Stack, o return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeCacheSubnetGroupsPaginator returns a new +// DescribeCacheSubnetGroupsPaginator +func NewDescribeCacheSubnetGroupsPaginator(client DescribeCacheSubnetGroupsAPIClient, params *DescribeCacheSubnetGroupsInput, optFns ...func(*DescribeCacheSubnetGroupsPaginatorOptions)) *DescribeCacheSubnetGroupsPaginator { + options := DescribeCacheSubnetGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeCacheSubnetGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeCacheSubnetGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticache/api_op_DescribeEngineDefaultParameters.go b/service/elasticache/api_op_DescribeEngineDefaultParameters.go index 87f3cb6e8c1..13676f648a6 100644 --- a/service/elasticache/api_op_DescribeEngineDefaultParameters.go +++ b/service/elasticache/api_op_DescribeEngineDefaultParameters.go @@ -4,6 +4,7 @@ package elasticache import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/elasticache/types" @@ -119,6 +120,91 @@ func addOperationDescribeEngineDefaultParametersMiddlewares(stack *middleware.St return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeEngineDefaultParametersPaginator returns a new +// DescribeEngineDefaultParametersPaginator +func NewDescribeEngineDefaultParametersPaginator(client DescribeEngineDefaultParametersAPIClient, params *DescribeEngineDefaultParametersInput, optFns ...func(*DescribeEngineDefaultParametersPaginatorOptions)) *DescribeEngineDefaultParametersPaginator { + options := DescribeEngineDefaultParametersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEngineDefaultParametersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + if result.EngineDefaults != nil { + p.nextToken = result.EngineDefaults.Marker + } else { + p.nextToken = nil + } + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEngineDefaultParameters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticache/api_op_DescribeEvents.go b/service/elasticache/api_op_DescribeEvents.go index ad0d6d23185..95a3b5b7491 100644 --- a/service/elasticache/api_op_DescribeEvents.go +++ b/service/elasticache/api_op_DescribeEvents.go @@ -4,6 +4,7 @@ package elasticache import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/elasticache/types" @@ -138,6 +139,84 @@ func addOperationDescribeEventsMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeEventsPaginator returns a new DescribeEventsPaginator +func NewDescribeEventsPaginator(client DescribeEventsAPIClient, params *DescribeEventsInput, optFns ...func(*DescribeEventsPaginatorOptions)) *DescribeEventsPaginator { + options := DescribeEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEventsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEvents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticache/api_op_DescribeGlobalReplicationGroups.go b/service/elasticache/api_op_DescribeGlobalReplicationGroups.go index 067af5c9d14..816220cae7d 100644 --- a/service/elasticache/api_op_DescribeGlobalReplicationGroups.go +++ b/service/elasticache/api_op_DescribeGlobalReplicationGroups.go @@ -4,6 +4,7 @@ package elasticache import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/elasticache/types" @@ -120,6 +121,85 @@ func addOperationDescribeGlobalReplicationGroupsMiddlewares(stack *middleware.St return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeGlobalReplicationGroupsPaginator returns a new +// DescribeGlobalReplicationGroupsPaginator +func NewDescribeGlobalReplicationGroupsPaginator(client DescribeGlobalReplicationGroupsAPIClient, params *DescribeGlobalReplicationGroupsInput, optFns ...func(*DescribeGlobalReplicationGroupsPaginatorOptions)) *DescribeGlobalReplicationGroupsPaginator { + options := DescribeGlobalReplicationGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeGlobalReplicationGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeGlobalReplicationGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticache/api_op_DescribeReplicationGroups.go b/service/elasticache/api_op_DescribeReplicationGroups.go index 7759cb36b53..bd554c2b132 100644 --- a/service/elasticache/api_op_DescribeReplicationGroups.go +++ b/service/elasticache/api_op_DescribeReplicationGroups.go @@ -4,6 +4,7 @@ package elasticache import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/elasticache/types" @@ -121,6 +122,86 @@ func addOperationDescribeReplicationGroupsMiddlewares(stack *middleware.Stack, o return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeReplicationGroupsPaginator returns a new +// DescribeReplicationGroupsPaginator +func NewDescribeReplicationGroupsPaginator(client DescribeReplicationGroupsAPIClient, params *DescribeReplicationGroupsInput, optFns ...func(*DescribeReplicationGroupsPaginatorOptions)) *DescribeReplicationGroupsPaginator { + options := DescribeReplicationGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeReplicationGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeReplicationGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticache/api_op_DescribeReservedCacheNodes.go b/service/elasticache/api_op_DescribeReservedCacheNodes.go index 8db137e0b6d..f42c72a44ed 100644 --- a/service/elasticache/api_op_DescribeReservedCacheNodes.go +++ b/service/elasticache/api_op_DescribeReservedCacheNodes.go @@ -4,6 +4,7 @@ package elasticache import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/elasticache/types" @@ -205,6 +206,86 @@ func addOperationDescribeReservedCacheNodesMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeReservedCacheNodesPaginator returns a new +// DescribeReservedCacheNodesPaginator +func NewDescribeReservedCacheNodesPaginator(client DescribeReservedCacheNodesAPIClient, params *DescribeReservedCacheNodesInput, optFns ...func(*DescribeReservedCacheNodesPaginatorOptions)) *DescribeReservedCacheNodesPaginator { + options := DescribeReservedCacheNodesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeReservedCacheNodesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeReservedCacheNodes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticache/api_op_DescribeReservedCacheNodesOfferings.go b/service/elasticache/api_op_DescribeReservedCacheNodesOfferings.go index c605b83c9b3..39a8a291708 100644 --- a/service/elasticache/api_op_DescribeReservedCacheNodesOfferings.go +++ b/service/elasticache/api_op_DescribeReservedCacheNodesOfferings.go @@ -4,6 +4,7 @@ package elasticache import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/elasticache/types" @@ -200,6 +201,86 @@ func addOperationDescribeReservedCacheNodesOfferingsMiddlewares(stack *middlewar return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeReservedCacheNodesOfferingsPaginator returns a new +// DescribeReservedCacheNodesOfferingsPaginator +func NewDescribeReservedCacheNodesOfferingsPaginator(client DescribeReservedCacheNodesOfferingsAPIClient, params *DescribeReservedCacheNodesOfferingsInput, optFns ...func(*DescribeReservedCacheNodesOfferingsPaginatorOptions)) *DescribeReservedCacheNodesOfferingsPaginator { + options := DescribeReservedCacheNodesOfferingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeReservedCacheNodesOfferingsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeReservedCacheNodesOfferings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticache/api_op_DescribeServiceUpdates.go b/service/elasticache/api_op_DescribeServiceUpdates.go index 21aff90a3fa..a953b2fca95 100644 --- a/service/elasticache/api_op_DescribeServiceUpdates.go +++ b/service/elasticache/api_op_DescribeServiceUpdates.go @@ -4,6 +4,7 @@ package elasticache import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/elasticache/types" @@ -117,6 +118,82 @@ func addOperationDescribeServiceUpdatesMiddlewares(stack *middleware.Stack, opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeServiceUpdatesPaginator returns a new DescribeServiceUpdatesPaginator +func NewDescribeServiceUpdatesPaginator(client DescribeServiceUpdatesAPIClient, params *DescribeServiceUpdatesInput, optFns ...func(*DescribeServiceUpdatesPaginatorOptions)) *DescribeServiceUpdatesPaginator { + options := DescribeServiceUpdatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeServiceUpdatesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeServiceUpdates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticache/api_op_DescribeSnapshots.go b/service/elasticache/api_op_DescribeSnapshots.go index a9ba23955ab..e0220410438 100644 --- a/service/elasticache/api_op_DescribeSnapshots.go +++ b/service/elasticache/api_op_DescribeSnapshots.go @@ -4,6 +4,7 @@ package elasticache import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/elasticache/types" @@ -142,6 +143,84 @@ func addOperationDescribeSnapshotsMiddlewares(stack *middleware.Stack, options O return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeSnapshotsPaginator returns a new DescribeSnapshotsPaginator +func NewDescribeSnapshotsPaginator(client DescribeSnapshotsAPIClient, params *DescribeSnapshotsInput, optFns ...func(*DescribeSnapshotsPaginatorOptions)) *DescribeSnapshotsPaginator { + options := DescribeSnapshotsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeSnapshotsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeSnapshots(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticache/api_op_DescribeUpdateActions.go b/service/elasticache/api_op_DescribeUpdateActions.go index c8c8aa4094c..1cb73c18a0c 100644 --- a/service/elasticache/api_op_DescribeUpdateActions.go +++ b/service/elasticache/api_op_DescribeUpdateActions.go @@ -4,6 +4,7 @@ package elasticache import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/elasticache/types" @@ -136,6 +137,82 @@ func addOperationDescribeUpdateActionsMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeUpdateActionsPaginator returns a new DescribeUpdateActionsPaginator +func NewDescribeUpdateActionsPaginator(client DescribeUpdateActionsAPIClient, params *DescribeUpdateActionsInput, optFns ...func(*DescribeUpdateActionsPaginatorOptions)) *DescribeUpdateActionsPaginator { + options := DescribeUpdateActionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeUpdateActionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeUpdateActions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticache/api_op_DescribeUserGroups.go b/service/elasticache/api_op_DescribeUserGroups.go index 1d00c74a738..22539bdb740 100644 --- a/service/elasticache/api_op_DescribeUserGroups.go +++ b/service/elasticache/api_op_DescribeUserGroups.go @@ -4,6 +4,7 @@ package elasticache import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/elasticache/types" @@ -116,6 +117,84 @@ func addOperationDescribeUserGroupsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeUserGroupsPaginator returns a new DescribeUserGroupsPaginator +func NewDescribeUserGroupsPaginator(client DescribeUserGroupsAPIClient, params *DescribeUserGroupsInput, optFns ...func(*DescribeUserGroupsPaginatorOptions)) *DescribeUserGroupsPaginator { + options := DescribeUserGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeUserGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeUserGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticache/api_op_DescribeUsers.go b/service/elasticache/api_op_DescribeUsers.go index 2af333f42f6..c2265f4b9c0 100644 --- a/service/elasticache/api_op_DescribeUsers.go +++ b/service/elasticache/api_op_DescribeUsers.go @@ -4,6 +4,7 @@ package elasticache import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/elasticache/types" @@ -125,6 +126,82 @@ func addOperationDescribeUsersMiddlewares(stack *middleware.Stack, options Optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeUsersPaginator returns a new DescribeUsersPaginator +func NewDescribeUsersPaginator(client DescribeUsersAPIClient, params *DescribeUsersInput, optFns ...func(*DescribeUsersPaginatorOptions)) *DescribeUsersPaginator { + options := DescribeUsersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeUsersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeUsers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticache/go.mod b/service/elasticache/go.mod index f618150b575..6fdafca9855 100644 --- a/service/elasticache/go.mod +++ b/service/elasticache/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/elasticache/go.sum b/service/elasticache/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/elasticache/go.sum +++ b/service/elasticache/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 386af038ab9..00000000000 --- a/service/elasticache/paginators.go +++ /dev/null @@ -1,1350 +0,0 @@ -// 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/api_op_DescribeEnvironmentManagedActionHistory.go b/service/elasticbeanstalk/api_op_DescribeEnvironmentManagedActionHistory.go index b7713045a53..76f0eda4c61 100644 --- a/service/elasticbeanstalk/api_op_DescribeEnvironmentManagedActionHistory.go +++ b/service/elasticbeanstalk/api_op_DescribeEnvironmentManagedActionHistory.go @@ -4,6 +4,7 @@ package elasticbeanstalk import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk/types" @@ -114,6 +115,83 @@ func addOperationDescribeEnvironmentManagedActionHistoryMiddlewares(stack *middl return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeEnvironmentManagedActionHistoryPaginator returns a new +// DescribeEnvironmentManagedActionHistoryPaginator +func NewDescribeEnvironmentManagedActionHistoryPaginator(client DescribeEnvironmentManagedActionHistoryAPIClient, params *DescribeEnvironmentManagedActionHistoryInput, optFns ...func(*DescribeEnvironmentManagedActionHistoryPaginatorOptions)) *DescribeEnvironmentManagedActionHistoryPaginator { + options := DescribeEnvironmentManagedActionHistoryPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEnvironmentManagedActionHistoryInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEnvironmentManagedActionHistory(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticbeanstalk/api_op_DescribeEvents.go b/service/elasticbeanstalk/api_op_DescribeEvents.go index a1386288541..9cde9dfd665 100644 --- a/service/elasticbeanstalk/api_op_DescribeEvents.go +++ b/service/elasticbeanstalk/api_op_DescribeEvents.go @@ -4,6 +4,7 @@ package elasticbeanstalk import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk/types" @@ -152,6 +153,82 @@ func addOperationDescribeEventsMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeEventsPaginator returns a new DescribeEventsPaginator +func NewDescribeEventsPaginator(client DescribeEventsAPIClient, params *DescribeEventsInput, optFns ...func(*DescribeEventsPaginatorOptions)) *DescribeEventsPaginator { + options := DescribeEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEventsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEvents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticbeanstalk/api_op_ListPlatformBranches.go b/service/elasticbeanstalk/api_op_ListPlatformBranches.go index e845c74d02f..2909298715b 100644 --- a/service/elasticbeanstalk/api_op_ListPlatformBranches.go +++ b/service/elasticbeanstalk/api_op_ListPlatformBranches.go @@ -4,6 +4,7 @@ package elasticbeanstalk import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk/types" @@ -148,6 +149,82 @@ func addOperationListPlatformBranchesMiddlewares(stack *middleware.Stack, option return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListPlatformBranchesPaginator returns a new ListPlatformBranchesPaginator +func NewListPlatformBranchesPaginator(client ListPlatformBranchesAPIClient, params *ListPlatformBranchesInput, optFns ...func(*ListPlatformBranchesPaginatorOptions)) *ListPlatformBranchesPaginator { + options := ListPlatformBranchesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPlatformBranchesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPlatformBranches(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticbeanstalk/api_op_ListPlatformVersions.go b/service/elasticbeanstalk/api_op_ListPlatformVersions.go index 097a450f5c6..b1cc0603116 100644 --- a/service/elasticbeanstalk/api_op_ListPlatformVersions.go +++ b/service/elasticbeanstalk/api_op_ListPlatformVersions.go @@ -4,6 +4,7 @@ package elasticbeanstalk import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk/types" @@ -118,6 +119,82 @@ func addOperationListPlatformVersionsMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListPlatformVersionsPaginator returns a new ListPlatformVersionsPaginator +func NewListPlatformVersionsPaginator(client ListPlatformVersionsAPIClient, params *ListPlatformVersionsInput, optFns ...func(*ListPlatformVersionsPaginatorOptions)) *ListPlatformVersionsPaginator { + options := ListPlatformVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPlatformVersionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPlatformVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticbeanstalk/go.mod b/service/elasticbeanstalk/go.mod index c1a7537afc3..0171739047f 100644 --- a/service/elasticbeanstalk/go.mod +++ b/service/elasticbeanstalk/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/elasticbeanstalk/go.sum b/service/elasticbeanstalk/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/elasticbeanstalk/go.sum +++ b/service/elasticbeanstalk/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 495de43c411..00000000000 --- a/service/elasticbeanstalk/paginators.go +++ /dev/null @@ -1,313 +0,0 @@ -// 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/api_op_DescribeAccelerators.go b/service/elasticinference/api_op_DescribeAccelerators.go index a0b04e16098..5fd2d5fd22d 100644 --- a/service/elasticinference/api_op_DescribeAccelerators.go +++ b/service/elasticinference/api_op_DescribeAccelerators.go @@ -4,6 +4,7 @@ package elasticinference import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/elasticinference/types" @@ -120,6 +121,86 @@ func addOperationDescribeAcceleratorsMiddlewares(stack *middleware.Stack, option return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeAcceleratorsPaginator returns a new DescribeAcceleratorsPaginator +func NewDescribeAcceleratorsPaginator(client DescribeAcceleratorsAPIClient, params *DescribeAcceleratorsInput, optFns ...func(*DescribeAcceleratorsPaginatorOptions)) *DescribeAcceleratorsPaginator { + options := DescribeAcceleratorsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeAcceleratorsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeAccelerators(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticinference/go.mod b/service/elasticinference/go.mod index ba37552a328..07e009a5fe6 100644 --- a/service/elasticinference/go.mod +++ b/service/elasticinference/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/elasticinference/go.sum b/service/elasticinference/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/elasticinference/go.sum +++ b/service/elasticinference/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 214c65727d6..00000000000 --- a/service/elasticinference/paginators.go +++ /dev/null @@ -1,88 +0,0 @@ -// 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/api_op_DescribeLoadBalancers.go b/service/elasticloadbalancing/api_op_DescribeLoadBalancers.go index 6fb2542b212..b206ff777c1 100644 --- a/service/elasticloadbalancing/api_op_DescribeLoadBalancers.go +++ b/service/elasticloadbalancing/api_op_DescribeLoadBalancers.go @@ -4,6 +4,7 @@ package elasticloadbalancing import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/types" @@ -114,6 +115,78 @@ func addOperationDescribeLoadBalancersMiddlewares(stack *middleware.Stack, optio return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeLoadBalancersPaginator returns a new DescribeLoadBalancersPaginator +func NewDescribeLoadBalancersPaginator(client DescribeLoadBalancersAPIClient, params *DescribeLoadBalancersInput, optFns ...func(*DescribeLoadBalancersPaginatorOptions)) *DescribeLoadBalancersPaginator { + options := DescribeLoadBalancersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeLoadBalancersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeLoadBalancers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticloadbalancing/go.mod b/service/elasticloadbalancing/go.mod index d409632dcaa..ae6ebb259c1 100644 --- a/service/elasticloadbalancing/go.mod +++ b/service/elasticloadbalancing/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/elasticloadbalancing/go.sum b/service/elasticloadbalancing/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/elasticloadbalancing/go.sum +++ b/service/elasticloadbalancing/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index e3cb5a53e70..00000000000 --- a/service/elasticloadbalancing/paginators.go +++ /dev/null @@ -1,80 +0,0 @@ -// 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/api_op_DescribeListeners.go b/service/elasticloadbalancingv2/api_op_DescribeListeners.go index f6e6887d00f..12eee8f0e81 100644 --- a/service/elasticloadbalancingv2/api_op_DescribeListeners.go +++ b/service/elasticloadbalancingv2/api_op_DescribeListeners.go @@ -4,6 +4,7 @@ package elasticloadbalancingv2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/types" @@ -117,6 +118,77 @@ func addOperationDescribeListenersMiddlewares(stack *middleware.Stack, options O return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeListenersPaginator returns a new DescribeListenersPaginator +func NewDescribeListenersPaginator(client DescribeListenersAPIClient, params *DescribeListenersInput, optFns ...func(*DescribeListenersPaginatorOptions)) *DescribeListenersPaginator { + options := DescribeListenersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeListenersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeListeners(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticloadbalancingv2/api_op_DescribeLoadBalancers.go b/service/elasticloadbalancingv2/api_op_DescribeLoadBalancers.go index 99507aa39bc..e1d5f839f4c 100644 --- a/service/elasticloadbalancingv2/api_op_DescribeLoadBalancers.go +++ b/service/elasticloadbalancingv2/api_op_DescribeLoadBalancers.go @@ -4,6 +4,7 @@ package elasticloadbalancingv2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/types" @@ -116,6 +117,78 @@ func addOperationDescribeLoadBalancersMiddlewares(stack *middleware.Stack, optio return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeLoadBalancersPaginator returns a new DescribeLoadBalancersPaginator +func NewDescribeLoadBalancersPaginator(client DescribeLoadBalancersAPIClient, params *DescribeLoadBalancersInput, optFns ...func(*DescribeLoadBalancersPaginatorOptions)) *DescribeLoadBalancersPaginator { + options := DescribeLoadBalancersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeLoadBalancersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeLoadBalancers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticloadbalancingv2/api_op_DescribeTargetGroups.go b/service/elasticloadbalancingv2/api_op_DescribeTargetGroups.go index 6eb28ab0324..5339bfb0f1e 100644 --- a/service/elasticloadbalancingv2/api_op_DescribeTargetGroups.go +++ b/service/elasticloadbalancingv2/api_op_DescribeTargetGroups.go @@ -4,6 +4,7 @@ package elasticloadbalancingv2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/types" @@ -121,6 +122,78 @@ func addOperationDescribeTargetGroupsMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeTargetGroupsPaginator returns a new DescribeTargetGroupsPaginator +func NewDescribeTargetGroupsPaginator(client DescribeTargetGroupsAPIClient, params *DescribeTargetGroupsInput, optFns ...func(*DescribeTargetGroupsPaginatorOptions)) *DescribeTargetGroupsPaginator { + options := DescribeTargetGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeTargetGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeTargetGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticloadbalancingv2/go.mod b/service/elasticloadbalancingv2/go.mod index 5ece2f8293a..ed7e9e22f12 100644 --- a/service/elasticloadbalancingv2/go.mod +++ b/service/elasticloadbalancingv2/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/elasticloadbalancingv2/go.sum b/service/elasticloadbalancingv2/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/elasticloadbalancingv2/go.sum +++ b/service/elasticloadbalancingv2/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index f5b27a57561..00000000000 --- a/service/elasticloadbalancingv2/paginators.go +++ /dev/null @@ -1,223 +0,0 @@ -// 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/api_op_DescribeInboundCrossClusterSearchConnections.go b/service/elasticsearchservice/api_op_DescribeInboundCrossClusterSearchConnections.go index b019d68e717..b121170b0cd 100644 --- a/service/elasticsearchservice/api_op_DescribeInboundCrossClusterSearchConnections.go +++ b/service/elasticsearchservice/api_op_DescribeInboundCrossClusterSearchConnections.go @@ -4,6 +4,7 @@ package elasticsearchservice import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/elasticsearchservice/types" @@ -130,6 +131,84 @@ func addOperationDescribeInboundCrossClusterSearchConnectionsMiddlewares(stack * return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeInboundCrossClusterSearchConnectionsPaginator returns a new +// DescribeInboundCrossClusterSearchConnectionsPaginator +func NewDescribeInboundCrossClusterSearchConnectionsPaginator(client DescribeInboundCrossClusterSearchConnectionsAPIClient, params *DescribeInboundCrossClusterSearchConnectionsInput, optFns ...func(*DescribeInboundCrossClusterSearchConnectionsPaginatorOptions)) *DescribeInboundCrossClusterSearchConnectionsPaginator { + options := DescribeInboundCrossClusterSearchConnectionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeInboundCrossClusterSearchConnectionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeInboundCrossClusterSearchConnections(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticsearchservice/api_op_DescribeOutboundCrossClusterSearchConnections.go b/service/elasticsearchservice/api_op_DescribeOutboundCrossClusterSearchConnections.go index 62f4dc5c3a4..6cf11ac66e5 100644 --- a/service/elasticsearchservice/api_op_DescribeOutboundCrossClusterSearchConnections.go +++ b/service/elasticsearchservice/api_op_DescribeOutboundCrossClusterSearchConnections.go @@ -4,6 +4,7 @@ package elasticsearchservice import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/elasticsearchservice/types" @@ -130,6 +131,84 @@ func addOperationDescribeOutboundCrossClusterSearchConnectionsMiddlewares(stack return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeOutboundCrossClusterSearchConnectionsPaginator returns a new +// DescribeOutboundCrossClusterSearchConnectionsPaginator +func NewDescribeOutboundCrossClusterSearchConnectionsPaginator(client DescribeOutboundCrossClusterSearchConnectionsAPIClient, params *DescribeOutboundCrossClusterSearchConnectionsInput, optFns ...func(*DescribeOutboundCrossClusterSearchConnectionsPaginatorOptions)) *DescribeOutboundCrossClusterSearchConnectionsPaginator { + options := DescribeOutboundCrossClusterSearchConnectionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeOutboundCrossClusterSearchConnectionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeOutboundCrossClusterSearchConnections(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticsearchservice/api_op_DescribePackages.go b/service/elasticsearchservice/api_op_DescribePackages.go index a24caa65906..528bfc30328 100644 --- a/service/elasticsearchservice/api_op_DescribePackages.go +++ b/service/elasticsearchservice/api_op_DescribePackages.go @@ -4,6 +4,7 @@ package elasticsearchservice import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/elasticsearchservice/types" @@ -110,6 +111,81 @@ func addOperationDescribePackagesMiddlewares(stack *middleware.Stack, options Op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribePackagesPaginator returns a new DescribePackagesPaginator +func NewDescribePackagesPaginator(client DescribePackagesAPIClient, params *DescribePackagesInput, optFns ...func(*DescribePackagesPaginatorOptions)) *DescribePackagesPaginator { + options := DescribePackagesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribePackagesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribePackages(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticsearchservice/api_op_DescribeReservedElasticsearchInstanceOfferings.go b/service/elasticsearchservice/api_op_DescribeReservedElasticsearchInstanceOfferings.go index f3cbc7d8499..65a7f4b6899 100644 --- a/service/elasticsearchservice/api_op_DescribeReservedElasticsearchInstanceOfferings.go +++ b/service/elasticsearchservice/api_op_DescribeReservedElasticsearchInstanceOfferings.go @@ -4,6 +4,7 @@ package elasticsearchservice import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/elasticsearchservice/types" @@ -113,6 +114,84 @@ func addOperationDescribeReservedElasticsearchInstanceOfferingsMiddlewares(stack return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeReservedElasticsearchInstanceOfferingsPaginator returns a new +// DescribeReservedElasticsearchInstanceOfferingsPaginator +func NewDescribeReservedElasticsearchInstanceOfferingsPaginator(client DescribeReservedElasticsearchInstanceOfferingsAPIClient, params *DescribeReservedElasticsearchInstanceOfferingsInput, optFns ...func(*DescribeReservedElasticsearchInstanceOfferingsPaginatorOptions)) *DescribeReservedElasticsearchInstanceOfferingsPaginator { + options := DescribeReservedElasticsearchInstanceOfferingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeReservedElasticsearchInstanceOfferingsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeReservedElasticsearchInstanceOfferings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticsearchservice/api_op_DescribeReservedElasticsearchInstances.go b/service/elasticsearchservice/api_op_DescribeReservedElasticsearchInstances.go index 6581be7e1bd..35fde454a92 100644 --- a/service/elasticsearchservice/api_op_DescribeReservedElasticsearchInstances.go +++ b/service/elasticsearchservice/api_op_DescribeReservedElasticsearchInstances.go @@ -4,6 +4,7 @@ package elasticsearchservice import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/elasticsearchservice/types" @@ -113,6 +114,84 @@ func addOperationDescribeReservedElasticsearchInstancesMiddlewares(stack *middle return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeReservedElasticsearchInstancesPaginator returns a new +// DescribeReservedElasticsearchInstancesPaginator +func NewDescribeReservedElasticsearchInstancesPaginator(client DescribeReservedElasticsearchInstancesAPIClient, params *DescribeReservedElasticsearchInstancesInput, optFns ...func(*DescribeReservedElasticsearchInstancesPaginatorOptions)) *DescribeReservedElasticsearchInstancesPaginator { + options := DescribeReservedElasticsearchInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeReservedElasticsearchInstancesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeReservedElasticsearchInstances(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticsearchservice/api_op_GetUpgradeHistory.go b/service/elasticsearchservice/api_op_GetUpgradeHistory.go index 7f8912e1ca4..27a244de2c7 100644 --- a/service/elasticsearchservice/api_op_GetUpgradeHistory.go +++ b/service/elasticsearchservice/api_op_GetUpgradeHistory.go @@ -4,6 +4,7 @@ package elasticsearchservice import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/elasticsearchservice/types" @@ -124,6 +125,81 @@ func addOperationGetUpgradeHistoryMiddlewares(stack *middleware.Stack, options O return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetUpgradeHistoryPaginator returns a new GetUpgradeHistoryPaginator +func NewGetUpgradeHistoryPaginator(client GetUpgradeHistoryAPIClient, params *GetUpgradeHistoryInput, optFns ...func(*GetUpgradeHistoryPaginatorOptions)) *GetUpgradeHistoryPaginator { + options := GetUpgradeHistoryPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetUpgradeHistoryInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetUpgradeHistory(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticsearchservice/api_op_ListDomainsForPackage.go b/service/elasticsearchservice/api_op_ListDomainsForPackage.go index 8c9c8b507cf..7eed5c275e0 100644 --- a/service/elasticsearchservice/api_op_ListDomainsForPackage.go +++ b/service/elasticsearchservice/api_op_ListDomainsForPackage.go @@ -4,6 +4,7 @@ package elasticsearchservice import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/elasticsearchservice/types" @@ -115,6 +116,82 @@ func addOperationListDomainsForPackageMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDomainsForPackagePaginator returns a new ListDomainsForPackagePaginator +func NewListDomainsForPackagePaginator(client ListDomainsForPackageAPIClient, params *ListDomainsForPackageInput, optFns ...func(*ListDomainsForPackagePaginatorOptions)) *ListDomainsForPackagePaginator { + options := ListDomainsForPackagePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDomainsForPackageInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDomainsForPackage(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticsearchservice/api_op_ListElasticsearchInstanceTypes.go b/service/elasticsearchservice/api_op_ListElasticsearchInstanceTypes.go index ab8114975cd..9dbed092d52 100644 --- a/service/elasticsearchservice/api_op_ListElasticsearchInstanceTypes.go +++ b/service/elasticsearchservice/api_op_ListElasticsearchInstanceTypes.go @@ -4,6 +4,7 @@ package elasticsearchservice import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/elasticsearchservice/types" @@ -128,6 +129,84 @@ func addOperationListElasticsearchInstanceTypesMiddlewares(stack *middleware.Sta return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListElasticsearchInstanceTypesPaginator returns a new +// ListElasticsearchInstanceTypesPaginator +func NewListElasticsearchInstanceTypesPaginator(client ListElasticsearchInstanceTypesAPIClient, params *ListElasticsearchInstanceTypesInput, optFns ...func(*ListElasticsearchInstanceTypesPaginatorOptions)) *ListElasticsearchInstanceTypesPaginator { + options := ListElasticsearchInstanceTypesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListElasticsearchInstanceTypesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListElasticsearchInstanceTypes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticsearchservice/api_op_ListElasticsearchVersions.go b/service/elasticsearchservice/api_op_ListElasticsearchVersions.go index 1c501d7cdbc..bdc86f82d5d 100644 --- a/service/elasticsearchservice/api_op_ListElasticsearchVersions.go +++ b/service/elasticsearchservice/api_op_ListElasticsearchVersions.go @@ -4,6 +4,7 @@ package elasticsearchservice import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -116,6 +117,84 @@ func addOperationListElasticsearchVersionsMiddlewares(stack *middleware.Stack, o return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListElasticsearchVersionsPaginator returns a new +// ListElasticsearchVersionsPaginator +func NewListElasticsearchVersionsPaginator(client ListElasticsearchVersionsAPIClient, params *ListElasticsearchVersionsInput, optFns ...func(*ListElasticsearchVersionsPaginatorOptions)) *ListElasticsearchVersionsPaginator { + options := ListElasticsearchVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListElasticsearchVersionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListElasticsearchVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticsearchservice/api_op_ListPackagesForDomain.go b/service/elasticsearchservice/api_op_ListPackagesForDomain.go index 42c7959dde2..b41bbf22f00 100644 --- a/service/elasticsearchservice/api_op_ListPackagesForDomain.go +++ b/service/elasticsearchservice/api_op_ListPackagesForDomain.go @@ -4,6 +4,7 @@ package elasticsearchservice import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/elasticsearchservice/types" @@ -117,6 +118,82 @@ func addOperationListPackagesForDomainMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListPackagesForDomainPaginator returns a new ListPackagesForDomainPaginator +func NewListPackagesForDomainPaginator(client ListPackagesForDomainAPIClient, params *ListPackagesForDomainInput, optFns ...func(*ListPackagesForDomainPaginatorOptions)) *ListPackagesForDomainPaginator { + options := ListPackagesForDomainPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPackagesForDomainInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPackagesForDomain(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticsearchservice/go.mod b/service/elasticsearchservice/go.mod index c426d3d38c0..feb22aaefef 100644 --- a/service/elasticsearchservice/go.mod +++ b/service/elasticsearchservice/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/elasticsearchservice/go.sum b/service/elasticsearchservice/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/elasticsearchservice/go.sum +++ b/service/elasticsearchservice/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 8b3d3fc8dce..00000000000 --- a/service/elasticsearchservice/paginators.go +++ /dev/null @@ -1,778 +0,0 @@ -// 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/api_op_ListJobsByPipeline.go b/service/elastictranscoder/api_op_ListJobsByPipeline.go index d394082eb11..a36ffaf6cf6 100644 --- a/service/elastictranscoder/api_op_ListJobsByPipeline.go +++ b/service/elastictranscoder/api_op_ListJobsByPipeline.go @@ -4,6 +4,7 @@ package elastictranscoder import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/elastictranscoder/types" @@ -122,6 +123,78 @@ func addOperationListJobsByPipelineMiddlewares(stack *middleware.Stack, options return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListJobsByPipelinePaginator returns a new ListJobsByPipelinePaginator +func NewListJobsByPipelinePaginator(client ListJobsByPipelineAPIClient, params *ListJobsByPipelineInput, optFns ...func(*ListJobsByPipelinePaginatorOptions)) *ListJobsByPipelinePaginator { + options := ListJobsByPipelinePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListJobsByPipelineInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListJobsByPipeline(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elastictranscoder/api_op_ListJobsByStatus.go b/service/elastictranscoder/api_op_ListJobsByStatus.go index e100bbc2978..c959e2468d9 100644 --- a/service/elastictranscoder/api_op_ListJobsByStatus.go +++ b/service/elastictranscoder/api_op_ListJobsByStatus.go @@ -4,6 +4,7 @@ package elastictranscoder import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/elastictranscoder/types" @@ -123,6 +124,77 @@ func addOperationListJobsByStatusMiddlewares(stack *middleware.Stack, options Op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListJobsByStatusPaginator returns a new ListJobsByStatusPaginator +func NewListJobsByStatusPaginator(client ListJobsByStatusAPIClient, params *ListJobsByStatusInput, optFns ...func(*ListJobsByStatusPaginatorOptions)) *ListJobsByStatusPaginator { + options := ListJobsByStatusPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListJobsByStatusInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListJobsByStatus(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elastictranscoder/api_op_ListPipelines.go b/service/elastictranscoder/api_op_ListPipelines.go index 53d33cc4aa3..7b193dfebfb 100644 --- a/service/elastictranscoder/api_op_ListPipelines.go +++ b/service/elastictranscoder/api_op_ListPipelines.go @@ -4,6 +4,7 @@ package elastictranscoder import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/elastictranscoder/types" @@ -113,6 +114,76 @@ func addOperationListPipelinesMiddlewares(stack *middleware.Stack, options Optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListPipelinesPaginator returns a new ListPipelinesPaginator +func NewListPipelinesPaginator(client ListPipelinesAPIClient, params *ListPipelinesInput, optFns ...func(*ListPipelinesPaginatorOptions)) *ListPipelinesPaginator { + options := ListPipelinesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPipelinesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPipelines(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elastictranscoder/api_op_ListPresets.go b/service/elastictranscoder/api_op_ListPresets.go index a5b7defe4ec..52d515ecb54 100644 --- a/service/elastictranscoder/api_op_ListPresets.go +++ b/service/elastictranscoder/api_op_ListPresets.go @@ -4,6 +4,7 @@ package elastictranscoder import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/elastictranscoder/types" @@ -113,6 +114,76 @@ func addOperationListPresetsMiddlewares(stack *middleware.Stack, options Options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListPresetsPaginator returns a new ListPresetsPaginator +func NewListPresetsPaginator(client ListPresetsAPIClient, params *ListPresetsInput, optFns ...func(*ListPresetsPaginatorOptions)) *ListPresetsPaginator { + options := ListPresetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPresetsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPresets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elastictranscoder/go.mod b/service/elastictranscoder/go.mod index 715356fadad..79df2beb4b9 100644 --- a/service/elastictranscoder/go.mod +++ b/service/elastictranscoder/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/elastictranscoder/go.sum b/service/elastictranscoder/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/elastictranscoder/go.sum +++ b/service/elastictranscoder/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index a04202cef22..00000000000 --- a/service/elastictranscoder/paginators.go +++ /dev/null @@ -1,291 +0,0 @@ -// 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/api_op_ListBootstrapActions.go b/service/emr/api_op_ListBootstrapActions.go index 92d55c7dcaa..023c5cc7308 100644 --- a/service/emr/api_op_ListBootstrapActions.go +++ b/service/emr/api_op_ListBootstrapActions.go @@ -4,6 +4,7 @@ package emr import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/emr/types" @@ -112,6 +113,78 @@ func addOperationListBootstrapActionsMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListBootstrapActionsPaginator returns a new ListBootstrapActionsPaginator +func NewListBootstrapActionsPaginator(client ListBootstrapActionsAPIClient, params *ListBootstrapActionsInput, optFns ...func(*ListBootstrapActionsPaginatorOptions)) *ListBootstrapActionsPaginator { + options := ListBootstrapActionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListBootstrapActionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListBootstrapActions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/emr/api_op_ListClusters.go b/service/emr/api_op_ListClusters.go index 7f8dfe39392..99fe5f3c2ae 100644 --- a/service/emr/api_op_ListClusters.go +++ b/service/emr/api_op_ListClusters.go @@ -4,6 +4,7 @@ package emr import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/emr/types" @@ -120,6 +121,76 @@ func addOperationListClustersMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListClustersPaginator returns a new ListClustersPaginator +func NewListClustersPaginator(client ListClustersAPIClient, params *ListClustersInput, optFns ...func(*ListClustersPaginatorOptions)) *ListClustersPaginator { + options := ListClustersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListClustersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListClusters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/emr/api_op_ListInstanceFleets.go b/service/emr/api_op_ListInstanceFleets.go index 2f31d7c0ff2..3571877a230 100644 --- a/service/emr/api_op_ListInstanceFleets.go +++ b/service/emr/api_op_ListInstanceFleets.go @@ -4,6 +4,7 @@ package emr import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/emr/types" @@ -112,6 +113,78 @@ func addOperationListInstanceFleetsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListInstanceFleetsPaginator returns a new ListInstanceFleetsPaginator +func NewListInstanceFleetsPaginator(client ListInstanceFleetsAPIClient, params *ListInstanceFleetsInput, optFns ...func(*ListInstanceFleetsPaginatorOptions)) *ListInstanceFleetsPaginator { + options := ListInstanceFleetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListInstanceFleetsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListInstanceFleets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/emr/api_op_ListInstanceGroups.go b/service/emr/api_op_ListInstanceGroups.go index bf1a105391d..dc3bdb09954 100644 --- a/service/emr/api_op_ListInstanceGroups.go +++ b/service/emr/api_op_ListInstanceGroups.go @@ -4,6 +4,7 @@ package emr import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/emr/types" @@ -112,6 +113,78 @@ func addOperationListInstanceGroupsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListInstanceGroupsPaginator returns a new ListInstanceGroupsPaginator +func NewListInstanceGroupsPaginator(client ListInstanceGroupsAPIClient, params *ListInstanceGroupsInput, optFns ...func(*ListInstanceGroupsPaginatorOptions)) *ListInstanceGroupsPaginator { + options := ListInstanceGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListInstanceGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListInstanceGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/emr/api_op_ListInstances.go b/service/emr/api_op_ListInstances.go index 24211679f26..6768488083b 100644 --- a/service/emr/api_op_ListInstances.go +++ b/service/emr/api_op_ListInstances.go @@ -4,6 +4,7 @@ package emr import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/emr/types" @@ -131,6 +132,76 @@ func addOperationListInstancesMiddlewares(stack *middleware.Stack, options Optio return 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 { + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListInstancesPaginator returns a new ListInstancesPaginator +func NewListInstancesPaginator(client ListInstancesAPIClient, params *ListInstancesInput, optFns ...func(*ListInstancesPaginatorOptions)) *ListInstancesPaginator { + options := ListInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListInstancesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListInstances(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/emr/api_op_ListNotebookExecutions.go b/service/emr/api_op_ListNotebookExecutions.go index e13595fa146..b9dbfb4e6ce 100644 --- a/service/emr/api_op_ListNotebookExecutions.go +++ b/service/emr/api_op_ListNotebookExecutions.go @@ -4,6 +4,7 @@ package emr import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/emr/types" @@ -153,6 +154,78 @@ func addOperationListNotebookExecutionsMiddlewares(stack *middleware.Stack, opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListNotebookExecutionsPaginator returns a new ListNotebookExecutionsPaginator +func NewListNotebookExecutionsPaginator(client ListNotebookExecutionsAPIClient, params *ListNotebookExecutionsInput, optFns ...func(*ListNotebookExecutionsPaginatorOptions)) *ListNotebookExecutionsPaginator { + options := ListNotebookExecutionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListNotebookExecutionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListNotebookExecutions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/emr/api_op_ListSecurityConfigurations.go b/service/emr/api_op_ListSecurityConfigurations.go index a88870b6d76..9fceb78e5f0 100644 --- a/service/emr/api_op_ListSecurityConfigurations.go +++ b/service/emr/api_op_ListSecurityConfigurations.go @@ -4,6 +4,7 @@ package emr import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/emr/types" @@ -107,6 +108,79 @@ func addOperationListSecurityConfigurationsMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListSecurityConfigurationsPaginator returns a new +// ListSecurityConfigurationsPaginator +func NewListSecurityConfigurationsPaginator(client ListSecurityConfigurationsAPIClient, params *ListSecurityConfigurationsInput, optFns ...func(*ListSecurityConfigurationsPaginatorOptions)) *ListSecurityConfigurationsPaginator { + options := ListSecurityConfigurationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSecurityConfigurationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSecurityConfigurations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/emr/api_op_ListSteps.go b/service/emr/api_op_ListSteps.go index 34522fbdc63..ecdabc0b198 100644 --- a/service/emr/api_op_ListSteps.go +++ b/service/emr/api_op_ListSteps.go @@ -4,6 +4,7 @@ package emr import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/emr/types" @@ -123,6 +124,76 @@ func addOperationListStepsMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListStepsPaginator returns a new ListStepsPaginator +func NewListStepsPaginator(client ListStepsAPIClient, params *ListStepsInput, optFns ...func(*ListStepsPaginatorOptions)) *ListStepsPaginator { + options := ListStepsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListStepsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSteps(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/emr/go.mod b/service/emr/go.mod index 676a600ddac..332c2bd40f7 100644 --- a/service/emr/go.mod +++ b/service/emr/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/emr/go.sum b/service/emr/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/emr/go.sum +++ b/service/emr/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 8cfcead4cea..00000000000 --- a/service/emr/paginators.go +++ /dev/null @@ -1,579 +0,0 @@ -// 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.mod b/service/eventbridge/go.mod index 3c50b66a4ce..dafd721defa 100644 --- a/service/eventbridge/go.mod +++ b/service/eventbridge/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/eventbridge/go.sum b/service/eventbridge/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/eventbridge/go.sum +++ b/service/eventbridge/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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.mod b/service/firehose/go.mod index 12289c1b871..4d8d3606b6d 100644 --- a/service/firehose/go.mod +++ b/service/firehose/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/firehose/go.sum b/service/firehose/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/firehose/go.sum +++ b/service/firehose/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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/api_op_ListComplianceStatus.go b/service/fms/api_op_ListComplianceStatus.go index 3805d6efae9..68597304458 100644 --- a/service/fms/api_op_ListComplianceStatus.go +++ b/service/fms/api_op_ListComplianceStatus.go @@ -4,6 +4,7 @@ package fms import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/fms/types" @@ -128,6 +129,86 @@ func addOperationListComplianceStatusMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListComplianceStatusPaginator returns a new ListComplianceStatusPaginator +func NewListComplianceStatusPaginator(client ListComplianceStatusAPIClient, params *ListComplianceStatusInput, optFns ...func(*ListComplianceStatusPaginatorOptions)) *ListComplianceStatusPaginator { + options := ListComplianceStatusPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListComplianceStatusInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListComplianceStatus(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/fms/api_op_ListMemberAccounts.go b/service/fms/api_op_ListMemberAccounts.go index 9bc39711e06..9b7da6959ca 100644 --- a/service/fms/api_op_ListMemberAccounts.go +++ b/service/fms/api_op_ListMemberAccounts.go @@ -4,6 +4,7 @@ package fms import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -117,6 +118,85 @@ func addOperationListMemberAccountsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListMemberAccountsPaginator returns a new ListMemberAccountsPaginator +func NewListMemberAccountsPaginator(client ListMemberAccountsAPIClient, params *ListMemberAccountsInput, optFns ...func(*ListMemberAccountsPaginatorOptions)) *ListMemberAccountsPaginator { + options := ListMemberAccountsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListMemberAccountsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListMemberAccounts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/fms/api_op_ListPolicies.go b/service/fms/api_op_ListPolicies.go index 0cb6db076b1..5d2d40b7b74 100644 --- a/service/fms/api_op_ListPolicies.go +++ b/service/fms/api_op_ListPolicies.go @@ -4,6 +4,7 @@ package fms import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/fms/types" @@ -116,6 +117,83 @@ func addOperationListPoliciesMiddlewares(stack *middleware.Stack, options Option return 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 { + // 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListPoliciesPaginator returns a new ListPoliciesPaginator +func NewListPoliciesPaginator(client ListPoliciesAPIClient, params *ListPoliciesInput, optFns ...func(*ListPoliciesPaginatorOptions)) *ListPoliciesPaginator { + options := ListPoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPoliciesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPolicies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/fms/go.mod b/service/fms/go.mod index a801dc9f1e8..6b7b2e2f368 100644 --- a/service/fms/go.mod +++ b/service/fms/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/fms/go.sum b/service/fms/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/fms/go.sum +++ b/service/fms/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 2247dada79a..00000000000 --- a/service/fms/paginators.go +++ /dev/null @@ -1,244 +0,0 @@ -// 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/api_op_ListDatasetGroups.go b/service/forecast/api_op_ListDatasetGroups.go index c7ece5c186f..f87cdebc597 100644 --- a/service/forecast/api_op_ListDatasetGroups.go +++ b/service/forecast/api_op_ListDatasetGroups.go @@ -4,6 +4,7 @@ package forecast import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/forecast/types" @@ -112,6 +113,81 @@ func addOperationListDatasetGroupsMiddlewares(stack *middleware.Stack, options O return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDatasetGroupsPaginator returns a new ListDatasetGroupsPaginator +func NewListDatasetGroupsPaginator(client ListDatasetGroupsAPIClient, params *ListDatasetGroupsInput, optFns ...func(*ListDatasetGroupsPaginatorOptions)) *ListDatasetGroupsPaginator { + options := ListDatasetGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDatasetGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDatasetGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/forecast/api_op_ListDatasetImportJobs.go b/service/forecast/api_op_ListDatasetImportJobs.go index 8f6e68ee273..2f2fdd3ddd5 100644 --- a/service/forecast/api_op_ListDatasetImportJobs.go +++ b/service/forecast/api_op_ListDatasetImportJobs.go @@ -4,6 +4,7 @@ package forecast import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/forecast/types" @@ -136,6 +137,82 @@ func addOperationListDatasetImportJobsMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDatasetImportJobsPaginator returns a new ListDatasetImportJobsPaginator +func NewListDatasetImportJobsPaginator(client ListDatasetImportJobsAPIClient, params *ListDatasetImportJobsInput, optFns ...func(*ListDatasetImportJobsPaginatorOptions)) *ListDatasetImportJobsPaginator { + options := ListDatasetImportJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDatasetImportJobsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDatasetImportJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/forecast/api_op_ListDatasets.go b/service/forecast/api_op_ListDatasets.go index eb041271278..b3dac61ab8d 100644 --- a/service/forecast/api_op_ListDatasets.go +++ b/service/forecast/api_op_ListDatasets.go @@ -4,6 +4,7 @@ package forecast import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/forecast/types" @@ -111,6 +112,80 @@ func addOperationListDatasetsMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDatasetsPaginator returns a new ListDatasetsPaginator +func NewListDatasetsPaginator(client ListDatasetsAPIClient, params *ListDatasetsInput, optFns ...func(*ListDatasetsPaginatorOptions)) *ListDatasetsPaginator { + options := ListDatasetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDatasetsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDatasets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/forecast/api_op_ListForecastExportJobs.go b/service/forecast/api_op_ListForecastExportJobs.go index 480088286d4..f236349c627 100644 --- a/service/forecast/api_op_ListForecastExportJobs.go +++ b/service/forecast/api_op_ListForecastExportJobs.go @@ -4,6 +4,7 @@ package forecast import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/forecast/types" @@ -137,6 +138,82 @@ func addOperationListForecastExportJobsMiddlewares(stack *middleware.Stack, opti return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListForecastExportJobsPaginator returns a new ListForecastExportJobsPaginator +func NewListForecastExportJobsPaginator(client ListForecastExportJobsAPIClient, params *ListForecastExportJobsInput, optFns ...func(*ListForecastExportJobsPaginatorOptions)) *ListForecastExportJobsPaginator { + options := ListForecastExportJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListForecastExportJobsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListForecastExportJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/forecast/api_op_ListForecasts.go b/service/forecast/api_op_ListForecasts.go index f8358b9c279..05a5894b500 100644 --- a/service/forecast/api_op_ListForecasts.go +++ b/service/forecast/api_op_ListForecasts.go @@ -4,6 +4,7 @@ package forecast import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/forecast/types" @@ -136,6 +137,80 @@ func addOperationListForecastsMiddlewares(stack *middleware.Stack, options Optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListForecastsPaginator returns a new ListForecastsPaginator +func NewListForecastsPaginator(client ListForecastsAPIClient, params *ListForecastsInput, optFns ...func(*ListForecastsPaginatorOptions)) *ListForecastsPaginator { + options := ListForecastsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListForecastsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListForecasts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/forecast/api_op_ListPredictors.go b/service/forecast/api_op_ListPredictors.go index c529e8cc847..e415397997e 100644 --- a/service/forecast/api_op_ListPredictors.go +++ b/service/forecast/api_op_ListPredictors.go @@ -4,6 +4,7 @@ package forecast import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/forecast/types" @@ -136,6 +137,81 @@ func addOperationListPredictorsMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListPredictorsPaginator returns a new ListPredictorsPaginator +func NewListPredictorsPaginator(client ListPredictorsAPIClient, params *ListPredictorsInput, optFns ...func(*ListPredictorsPaginatorOptions)) *ListPredictorsPaginator { + options := ListPredictorsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPredictorsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPredictors(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/forecast/go.mod b/service/forecast/go.mod index bbad1f6ec9a..0a2f00df032 100644 --- a/service/forecast/go.mod +++ b/service/forecast/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/forecast/go.sum b/service/forecast/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/forecast/go.sum +++ b/service/forecast/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index e3f8bf95ecb..00000000000 --- a/service/forecast/paginators.go +++ /dev/null @@ -1,458 +0,0 @@ -// 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.mod b/service/forecastquery/go.mod index 3763a79c1b0..7cd0faf2475 100644 --- a/service/forecastquery/go.mod +++ b/service/forecastquery/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/forecastquery/go.sum b/service/forecastquery/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/forecastquery/go.sum +++ b/service/forecastquery/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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/api_op_DescribeModelVersions.go b/service/frauddetector/api_op_DescribeModelVersions.go index e45c61eacc9..41062a2888a 100644 --- a/service/frauddetector/api_op_DescribeModelVersions.go +++ b/service/frauddetector/api_op_DescribeModelVersions.go @@ -4,6 +4,7 @@ package frauddetector import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/frauddetector/types" @@ -116,6 +117,82 @@ func addOperationDescribeModelVersionsMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeModelVersionsPaginator returns a new DescribeModelVersionsPaginator +func NewDescribeModelVersionsPaginator(client DescribeModelVersionsAPIClient, params *DescribeModelVersionsInput, optFns ...func(*DescribeModelVersionsPaginatorOptions)) *DescribeModelVersionsPaginator { + options := DescribeModelVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeModelVersionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeModelVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/frauddetector/api_op_GetDetectors.go b/service/frauddetector/api_op_GetDetectors.go index db42c450dd4..725cac132e0 100644 --- a/service/frauddetector/api_op_GetDetectors.go +++ b/service/frauddetector/api_op_GetDetectors.go @@ -4,6 +4,7 @@ package frauddetector import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/frauddetector/types" @@ -113,6 +114,80 @@ func addOperationGetDetectorsMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetDetectorsPaginator returns a new GetDetectorsPaginator +func NewGetDetectorsPaginator(client GetDetectorsAPIClient, params *GetDetectorsInput, optFns ...func(*GetDetectorsPaginatorOptions)) *GetDetectorsPaginator { + options := GetDetectorsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetDetectorsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetDetectors(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/frauddetector/api_op_GetEntityTypes.go b/service/frauddetector/api_op_GetEntityTypes.go index af9520548c4..68eb1629e52 100644 --- a/service/frauddetector/api_op_GetEntityTypes.go +++ b/service/frauddetector/api_op_GetEntityTypes.go @@ -4,6 +4,7 @@ package frauddetector import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/frauddetector/types" @@ -113,6 +114,81 @@ func addOperationGetEntityTypesMiddlewares(stack *middleware.Stack, options Opti return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetEntityTypesPaginator returns a new GetEntityTypesPaginator +func NewGetEntityTypesPaginator(client GetEntityTypesAPIClient, params *GetEntityTypesInput, optFns ...func(*GetEntityTypesPaginatorOptions)) *GetEntityTypesPaginator { + options := GetEntityTypesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetEntityTypesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetEntityTypes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/frauddetector/api_op_GetEventTypes.go b/service/frauddetector/api_op_GetEventTypes.go index 7c99b5350b1..6b07ffa3f9e 100644 --- a/service/frauddetector/api_op_GetEventTypes.go +++ b/service/frauddetector/api_op_GetEventTypes.go @@ -4,6 +4,7 @@ package frauddetector import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/frauddetector/types" @@ -113,6 +114,80 @@ func addOperationGetEventTypesMiddlewares(stack *middleware.Stack, options Optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetEventTypesPaginator returns a new GetEventTypesPaginator +func NewGetEventTypesPaginator(client GetEventTypesAPIClient, params *GetEventTypesInput, optFns ...func(*GetEventTypesPaginatorOptions)) *GetEventTypesPaginator { + options := GetEventTypesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetEventTypesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetEventTypes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/frauddetector/api_op_GetExternalModels.go b/service/frauddetector/api_op_GetExternalModels.go index 6ea37c911a4..c6e983e1e41 100644 --- a/service/frauddetector/api_op_GetExternalModels.go +++ b/service/frauddetector/api_op_GetExternalModels.go @@ -4,6 +4,7 @@ package frauddetector import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/frauddetector/types" @@ -113,6 +114,81 @@ func addOperationGetExternalModelsMiddlewares(stack *middleware.Stack, options O return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetExternalModelsPaginator returns a new GetExternalModelsPaginator +func NewGetExternalModelsPaginator(client GetExternalModelsAPIClient, params *GetExternalModelsInput, optFns ...func(*GetExternalModelsPaginatorOptions)) *GetExternalModelsPaginator { + options := GetExternalModelsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetExternalModelsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetExternalModels(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/frauddetector/api_op_GetLabels.go b/service/frauddetector/api_op_GetLabels.go index 009e6b918c9..fd414d52fc2 100644 --- a/service/frauddetector/api_op_GetLabels.go +++ b/service/frauddetector/api_op_GetLabels.go @@ -4,6 +4,7 @@ package frauddetector import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/frauddetector/types" @@ -113,6 +114,80 @@ func addOperationGetLabelsMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetLabelsPaginator returns a new GetLabelsPaginator +func NewGetLabelsPaginator(client GetLabelsAPIClient, params *GetLabelsInput, optFns ...func(*GetLabelsPaginatorOptions)) *GetLabelsPaginator { + options := GetLabelsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetLabelsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetLabels(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/frauddetector/api_op_GetModels.go b/service/frauddetector/api_op_GetModels.go index 37064041269..45b5b08f14f 100644 --- a/service/frauddetector/api_op_GetModels.go +++ b/service/frauddetector/api_op_GetModels.go @@ -4,6 +4,7 @@ package frauddetector import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/frauddetector/types" @@ -118,6 +119,80 @@ func addOperationGetModelsMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetModelsPaginator returns a new GetModelsPaginator +func NewGetModelsPaginator(client GetModelsAPIClient, params *GetModelsInput, optFns ...func(*GetModelsPaginatorOptions)) *GetModelsPaginator { + options := GetModelsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetModelsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetModels(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/frauddetector/api_op_GetOutcomes.go b/service/frauddetector/api_op_GetOutcomes.go index 7147a74f11e..a3ac48ac120 100644 --- a/service/frauddetector/api_op_GetOutcomes.go +++ b/service/frauddetector/api_op_GetOutcomes.go @@ -4,6 +4,7 @@ package frauddetector import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/frauddetector/types" @@ -112,6 +113,80 @@ func addOperationGetOutcomesMiddlewares(stack *middleware.Stack, options Options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetOutcomesPaginator returns a new GetOutcomesPaginator +func NewGetOutcomesPaginator(client GetOutcomesAPIClient, params *GetOutcomesInput, optFns ...func(*GetOutcomesPaginatorOptions)) *GetOutcomesPaginator { + options := GetOutcomesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetOutcomesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetOutcomes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/frauddetector/api_op_GetRules.go b/service/frauddetector/api_op_GetRules.go index dd35cd69339..d30ab599e85 100644 --- a/service/frauddetector/api_op_GetRules.go +++ b/service/frauddetector/api_op_GetRules.go @@ -4,6 +4,7 @@ package frauddetector import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/frauddetector/types" @@ -126,6 +127,80 @@ func addOperationGetRulesMiddlewares(stack *middleware.Stack, options Options) ( return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetRulesPaginator returns a new GetRulesPaginator +func NewGetRulesPaginator(client GetRulesAPIClient, params *GetRulesInput, optFns ...func(*GetRulesPaginatorOptions)) *GetRulesPaginator { + options := GetRulesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetRulesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetRules(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/frauddetector/api_op_GetVariables.go b/service/frauddetector/api_op_GetVariables.go index c9b28b59a9d..985b9578144 100644 --- a/service/frauddetector/api_op_GetVariables.go +++ b/service/frauddetector/api_op_GetVariables.go @@ -4,6 +4,7 @@ package frauddetector import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/frauddetector/types" @@ -113,6 +114,80 @@ func addOperationGetVariablesMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetVariablesPaginator returns a new GetVariablesPaginator +func NewGetVariablesPaginator(client GetVariablesAPIClient, params *GetVariablesInput, optFns ...func(*GetVariablesPaginatorOptions)) *GetVariablesPaginator { + options := GetVariablesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetVariablesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetVariables(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/frauddetector/api_op_ListTagsForResource.go b/service/frauddetector/api_op_ListTagsForResource.go index 02f3267e12e..c46ab684a15 100644 --- a/service/frauddetector/api_op_ListTagsForResource.go +++ b/service/frauddetector/api_op_ListTagsForResource.go @@ -4,6 +4,7 @@ package frauddetector import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/frauddetector/types" @@ -115,6 +116,82 @@ func addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator +func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator { + options := ListTagsForResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTagsForResourceInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/frauddetector/go.mod b/service/frauddetector/go.mod index fd5f7cf485b..2d0805ad0a7 100644 --- a/service/frauddetector/go.mod +++ b/service/frauddetector/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/frauddetector/go.sum b/service/frauddetector/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/frauddetector/go.sum +++ b/service/frauddetector/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index fe9c0427b98..00000000000 --- a/service/frauddetector/paginators.go +++ /dev/null @@ -1,828 +0,0 @@ -// 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/api_op_DescribeBackups.go b/service/fsx/api_op_DescribeBackups.go index be907b77d53..0c85604a2f9 100644 --- a/service/fsx/api_op_DescribeBackups.go +++ b/service/fsx/api_op_DescribeBackups.go @@ -4,6 +4,7 @@ package fsx import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/fsx/types" @@ -140,6 +141,84 @@ func addOperationDescribeBackupsMiddlewares(stack *middleware.Stack, options Opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeBackupsPaginator returns a new DescribeBackupsPaginator +func NewDescribeBackupsPaginator(client DescribeBackupsAPIClient, params *DescribeBackupsInput, optFns ...func(*DescribeBackupsPaginatorOptions)) *DescribeBackupsPaginator { + options := DescribeBackupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeBackupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeBackups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/fsx/api_op_DescribeDataRepositoryTasks.go b/service/fsx/api_op_DescribeDataRepositoryTasks.go index f1a0f68b70a..0034742a54e 100644 --- a/service/fsx/api_op_DescribeDataRepositoryTasks.go +++ b/service/fsx/api_op_DescribeDataRepositoryTasks.go @@ -4,6 +4,7 @@ package fsx import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/fsx/types" @@ -128,6 +129,84 @@ func addOperationDescribeDataRepositoryTasksMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeDataRepositoryTasksPaginator returns a new +// DescribeDataRepositoryTasksPaginator +func NewDescribeDataRepositoryTasksPaginator(client DescribeDataRepositoryTasksAPIClient, params *DescribeDataRepositoryTasksInput, optFns ...func(*DescribeDataRepositoryTasksPaginatorOptions)) *DescribeDataRepositoryTasksPaginator { + options := DescribeDataRepositoryTasksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDataRepositoryTasksInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDataRepositoryTasks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/fsx/api_op_DescribeFileSystems.go b/service/fsx/api_op_DescribeFileSystems.go index 2330129fc58..d7c9ad1916c 100644 --- a/service/fsx/api_op_DescribeFileSystems.go +++ b/service/fsx/api_op_DescribeFileSystems.go @@ -4,6 +4,7 @@ package fsx import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/fsx/types" @@ -136,6 +137,85 @@ func addOperationDescribeFileSystemsMiddlewares(stack *middleware.Stack, options return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeFileSystemsPaginator returns a new DescribeFileSystemsPaginator +func NewDescribeFileSystemsPaginator(client DescribeFileSystemsAPIClient, params *DescribeFileSystemsInput, optFns ...func(*DescribeFileSystemsPaginatorOptions)) *DescribeFileSystemsPaginator { + options := DescribeFileSystemsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeFileSystemsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeFileSystems(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/fsx/go.mod b/service/fsx/go.mod index f470989ce42..1fa549fc351 100644 --- a/service/fsx/go.mod +++ b/service/fsx/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/fsx/go.sum b/service/fsx/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/fsx/go.sum +++ b/service/fsx/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 8684ce70816..00000000000 --- a/service/fsx/paginators.go +++ /dev/null @@ -1,243 +0,0 @@ -// 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/api_op_DescribeFleetAttributes.go b/service/gamelift/api_op_DescribeFleetAttributes.go index ecabb3a8a3e..8d6cdd4c58d 100644 --- a/service/gamelift/api_op_DescribeFleetAttributes.go +++ b/service/gamelift/api_op_DescribeFleetAttributes.go @@ -4,6 +4,7 @@ package gamelift import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/gamelift/types" @@ -163,6 +164,85 @@ func addOperationDescribeFleetAttributesMiddlewares(stack *middleware.Stack, opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeFleetAttributesPaginator returns a new +// DescribeFleetAttributesPaginator +func NewDescribeFleetAttributesPaginator(client DescribeFleetAttributesAPIClient, params *DescribeFleetAttributesInput, optFns ...func(*DescribeFleetAttributesPaginatorOptions)) *DescribeFleetAttributesPaginator { + options := DescribeFleetAttributesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeFleetAttributesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeFleetAttributes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/gamelift/api_op_DescribeFleetCapacity.go b/service/gamelift/api_op_DescribeFleetCapacity.go index aba781a3acf..b1bb7c204bb 100644 --- a/service/gamelift/api_op_DescribeFleetCapacity.go +++ b/service/gamelift/api_op_DescribeFleetCapacity.go @@ -4,6 +4,7 @@ package gamelift import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/gamelift/types" @@ -164,6 +165,84 @@ func addOperationDescribeFleetCapacityMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeFleetCapacityPaginator returns a new DescribeFleetCapacityPaginator +func NewDescribeFleetCapacityPaginator(client DescribeFleetCapacityAPIClient, params *DescribeFleetCapacityInput, optFns ...func(*DescribeFleetCapacityPaginatorOptions)) *DescribeFleetCapacityPaginator { + options := DescribeFleetCapacityPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeFleetCapacityInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeFleetCapacity(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/gamelift/api_op_DescribeFleetEvents.go b/service/gamelift/api_op_DescribeFleetEvents.go index ececfd2ceac..44b85a8058b 100644 --- a/service/gamelift/api_op_DescribeFleetEvents.go +++ b/service/gamelift/api_op_DescribeFleetEvents.go @@ -4,6 +4,7 @@ package gamelift import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/gamelift/types" @@ -168,6 +169,83 @@ func addOperationDescribeFleetEventsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeFleetEventsPaginator returns a new DescribeFleetEventsPaginator +func NewDescribeFleetEventsPaginator(client DescribeFleetEventsAPIClient, params *DescribeFleetEventsInput, optFns ...func(*DescribeFleetEventsPaginatorOptions)) *DescribeFleetEventsPaginator { + options := DescribeFleetEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeFleetEventsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeFleetEvents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/gamelift/api_op_DescribeFleetUtilization.go b/service/gamelift/api_op_DescribeFleetUtilization.go index a37a5bae40a..88592320bf0 100644 --- a/service/gamelift/api_op_DescribeFleetUtilization.go +++ b/service/gamelift/api_op_DescribeFleetUtilization.go @@ -4,6 +4,7 @@ package gamelift import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/gamelift/types" @@ -165,6 +166,85 @@ func addOperationDescribeFleetUtilizationMiddlewares(stack *middleware.Stack, op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeFleetUtilizationPaginator returns a new +// DescribeFleetUtilizationPaginator +func NewDescribeFleetUtilizationPaginator(client DescribeFleetUtilizationAPIClient, params *DescribeFleetUtilizationInput, optFns ...func(*DescribeFleetUtilizationPaginatorOptions)) *DescribeFleetUtilizationPaginator { + options := DescribeFleetUtilizationPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeFleetUtilizationInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeFleetUtilization(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/gamelift/api_op_DescribeGameServerInstances.go b/service/gamelift/api_op_DescribeGameServerInstances.go index b917e314259..fe13ad895ca 100644 --- a/service/gamelift/api_op_DescribeGameServerInstances.go +++ b/service/gamelift/api_op_DescribeGameServerInstances.go @@ -4,6 +4,7 @@ package gamelift import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/gamelift/types" @@ -157,6 +158,84 @@ func addOperationDescribeGameServerInstancesMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeGameServerInstancesPaginator returns a new +// DescribeGameServerInstancesPaginator +func NewDescribeGameServerInstancesPaginator(client DescribeGameServerInstancesAPIClient, params *DescribeGameServerInstancesInput, optFns ...func(*DescribeGameServerInstancesPaginatorOptions)) *DescribeGameServerInstancesPaginator { + options := DescribeGameServerInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeGameServerInstancesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeGameServerInstances(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/gamelift/api_op_DescribeGameSessionDetails.go b/service/gamelift/api_op_DescribeGameSessionDetails.go index ca513127e95..e9188965211 100644 --- a/service/gamelift/api_op_DescribeGameSessionDetails.go +++ b/service/gamelift/api_op_DescribeGameSessionDetails.go @@ -4,6 +4,7 @@ package gamelift import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/gamelift/types" @@ -159,6 +160,84 @@ func addOperationDescribeGameSessionDetailsMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeGameSessionDetailsPaginator returns a new +// DescribeGameSessionDetailsPaginator +func NewDescribeGameSessionDetailsPaginator(client DescribeGameSessionDetailsAPIClient, params *DescribeGameSessionDetailsInput, optFns ...func(*DescribeGameSessionDetailsPaginatorOptions)) *DescribeGameSessionDetailsPaginator { + options := DescribeGameSessionDetailsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeGameSessionDetailsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeGameSessionDetails(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/gamelift/api_op_DescribeGameSessionQueues.go b/service/gamelift/api_op_DescribeGameSessionQueues.go index 89ff9f2ff03..cbfcd301a4f 100644 --- a/service/gamelift/api_op_DescribeGameSessionQueues.go +++ b/service/gamelift/api_op_DescribeGameSessionQueues.go @@ -4,6 +4,7 @@ package gamelift import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/gamelift/types" @@ -131,6 +132,84 @@ func addOperationDescribeGameSessionQueuesMiddlewares(stack *middleware.Stack, o return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeGameSessionQueuesPaginator returns a new +// DescribeGameSessionQueuesPaginator +func NewDescribeGameSessionQueuesPaginator(client DescribeGameSessionQueuesAPIClient, params *DescribeGameSessionQueuesInput, optFns ...func(*DescribeGameSessionQueuesPaginatorOptions)) *DescribeGameSessionQueuesPaginator { + options := DescribeGameSessionQueuesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeGameSessionQueuesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeGameSessionQueues(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/gamelift/api_op_DescribeGameSessions.go b/service/gamelift/api_op_DescribeGameSessions.go index 11ecc867783..a0ba7374a2a 100644 --- a/service/gamelift/api_op_DescribeGameSessions.go +++ b/service/gamelift/api_op_DescribeGameSessions.go @@ -4,6 +4,7 @@ package gamelift import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/gamelift/types" @@ -159,6 +160,83 @@ func addOperationDescribeGameSessionsMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeGameSessionsPaginator returns a new DescribeGameSessionsPaginator +func NewDescribeGameSessionsPaginator(client DescribeGameSessionsAPIClient, params *DescribeGameSessionsInput, optFns ...func(*DescribeGameSessionsPaginatorOptions)) *DescribeGameSessionsPaginator { + options := DescribeGameSessionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeGameSessionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeGameSessions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/gamelift/api_op_DescribeInstances.go b/service/gamelift/api_op_DescribeInstances.go index bc0a7cbd896..db98c26b89d 100644 --- a/service/gamelift/api_op_DescribeInstances.go +++ b/service/gamelift/api_op_DescribeInstances.go @@ -4,6 +4,7 @@ package gamelift import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/gamelift/types" @@ -138,6 +139,82 @@ func addOperationDescribeInstancesMiddlewares(stack *middleware.Stack, options O return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeInstancesPaginator returns a new DescribeInstancesPaginator +func NewDescribeInstancesPaginator(client DescribeInstancesAPIClient, params *DescribeInstancesInput, optFns ...func(*DescribeInstancesPaginatorOptions)) *DescribeInstancesPaginator { + options := DescribeInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeInstancesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeInstances(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/gamelift/api_op_DescribeMatchmakingConfigurations.go b/service/gamelift/api_op_DescribeMatchmakingConfigurations.go index d7adabfdc8b..877dc4b770d 100644 --- a/service/gamelift/api_op_DescribeMatchmakingConfigurations.go +++ b/service/gamelift/api_op_DescribeMatchmakingConfigurations.go @@ -4,6 +4,7 @@ package gamelift import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/gamelift/types" @@ -151,6 +152,84 @@ func addOperationDescribeMatchmakingConfigurationsMiddlewares(stack *middleware. return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeMatchmakingConfigurationsPaginator returns a new +// DescribeMatchmakingConfigurationsPaginator +func NewDescribeMatchmakingConfigurationsPaginator(client DescribeMatchmakingConfigurationsAPIClient, params *DescribeMatchmakingConfigurationsInput, optFns ...func(*DescribeMatchmakingConfigurationsPaginatorOptions)) *DescribeMatchmakingConfigurationsPaginator { + options := DescribeMatchmakingConfigurationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeMatchmakingConfigurationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeMatchmakingConfigurations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/gamelift/api_op_DescribeMatchmakingRuleSets.go b/service/gamelift/api_op_DescribeMatchmakingRuleSets.go index e3d64c9c95b..c91a4c838d8 100644 --- a/service/gamelift/api_op_DescribeMatchmakingRuleSets.go +++ b/service/gamelift/api_op_DescribeMatchmakingRuleSets.go @@ -4,6 +4,7 @@ package gamelift import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/gamelift/types" @@ -149,6 +150,84 @@ func addOperationDescribeMatchmakingRuleSetsMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeMatchmakingRuleSetsPaginator returns a new +// DescribeMatchmakingRuleSetsPaginator +func NewDescribeMatchmakingRuleSetsPaginator(client DescribeMatchmakingRuleSetsAPIClient, params *DescribeMatchmakingRuleSetsInput, optFns ...func(*DescribeMatchmakingRuleSetsPaginatorOptions)) *DescribeMatchmakingRuleSetsPaginator { + options := DescribeMatchmakingRuleSetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeMatchmakingRuleSetsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeMatchmakingRuleSets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/gamelift/api_op_DescribePlayerSessions.go b/service/gamelift/api_op_DescribePlayerSessions.go index fe64e51da2d..32a81258163 100644 --- a/service/gamelift/api_op_DescribePlayerSessions.go +++ b/service/gamelift/api_op_DescribePlayerSessions.go @@ -4,6 +4,7 @@ package gamelift import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/gamelift/types" @@ -166,6 +167,84 @@ func addOperationDescribePlayerSessionsMiddlewares(stack *middleware.Stack, opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribePlayerSessionsPaginator returns a new DescribePlayerSessionsPaginator +func NewDescribePlayerSessionsPaginator(client DescribePlayerSessionsAPIClient, params *DescribePlayerSessionsInput, optFns ...func(*DescribePlayerSessionsPaginatorOptions)) *DescribePlayerSessionsPaginator { + options := DescribePlayerSessionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribePlayerSessionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribePlayerSessions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/gamelift/api_op_DescribeScalingPolicies.go b/service/gamelift/api_op_DescribeScalingPolicies.go index 1953f1f4623..38da4fee8af 100644 --- a/service/gamelift/api_op_DescribeScalingPolicies.go +++ b/service/gamelift/api_op_DescribeScalingPolicies.go @@ -4,6 +4,7 @@ package gamelift import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/gamelift/types" @@ -176,6 +177,84 @@ func addOperationDescribeScalingPoliciesMiddlewares(stack *middleware.Stack, opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeScalingPoliciesPaginator returns a new +// DescribeScalingPoliciesPaginator +func NewDescribeScalingPoliciesPaginator(client DescribeScalingPoliciesAPIClient, params *DescribeScalingPoliciesInput, optFns ...func(*DescribeScalingPoliciesPaginatorOptions)) *DescribeScalingPoliciesPaginator { + options := DescribeScalingPoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeScalingPoliciesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeScalingPolicies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/gamelift/api_op_ListAliases.go b/service/gamelift/api_op_ListAliases.go index 60739191689..6191b9faef5 100644 --- a/service/gamelift/api_op_ListAliases.go +++ b/service/gamelift/api_op_ListAliases.go @@ -4,6 +4,7 @@ package gamelift import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/gamelift/types" @@ -145,6 +146,81 @@ func addOperationListAliasesMiddlewares(stack *middleware.Stack, options Options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAliasesPaginator returns a new ListAliasesPaginator +func NewListAliasesPaginator(client ListAliasesAPIClient, params *ListAliasesInput, optFns ...func(*ListAliasesPaginatorOptions)) *ListAliasesPaginator { + options := ListAliasesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAliasesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAliases(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/gamelift/api_op_ListBuilds.go b/service/gamelift/api_op_ListBuilds.go index 5ee6f0ca07f..a876c9009ac 100644 --- a/service/gamelift/api_op_ListBuilds.go +++ b/service/gamelift/api_op_ListBuilds.go @@ -4,6 +4,7 @@ package gamelift import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/gamelift/types" @@ -143,6 +144,81 @@ func addOperationListBuildsMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListBuildsPaginator returns a new ListBuildsPaginator +func NewListBuildsPaginator(client ListBuildsAPIClient, params *ListBuildsInput, optFns ...func(*ListBuildsPaginatorOptions)) *ListBuildsPaginator { + options := ListBuildsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListBuildsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListBuilds(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/gamelift/api_op_ListFleets.go b/service/gamelift/api_op_ListFleets.go index df4db5bc665..088300414a7 100644 --- a/service/gamelift/api_op_ListFleets.go +++ b/service/gamelift/api_op_ListFleets.go @@ -4,6 +4,7 @@ package gamelift import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -143,6 +144,81 @@ func addOperationListFleetsMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListFleetsPaginator returns a new ListFleetsPaginator +func NewListFleetsPaginator(client ListFleetsAPIClient, params *ListFleetsInput, optFns ...func(*ListFleetsPaginatorOptions)) *ListFleetsPaginator { + options := ListFleetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListFleetsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListFleets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/gamelift/api_op_ListGameServerGroups.go b/service/gamelift/api_op_ListGameServerGroups.go index 9c9044fe4b6..9be75b11f7f 100644 --- a/service/gamelift/api_op_ListGameServerGroups.go +++ b/service/gamelift/api_op_ListGameServerGroups.go @@ -4,6 +4,7 @@ package gamelift import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/gamelift/types" @@ -133,6 +134,83 @@ func addOperationListGameServerGroupsMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListGameServerGroupsPaginator returns a new ListGameServerGroupsPaginator +func NewListGameServerGroupsPaginator(client ListGameServerGroupsAPIClient, params *ListGameServerGroupsInput, optFns ...func(*ListGameServerGroupsPaginatorOptions)) *ListGameServerGroupsPaginator { + options := ListGameServerGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListGameServerGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListGameServerGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/gamelift/api_op_ListGameServers.go b/service/gamelift/api_op_ListGameServers.go index 3bf646fc58e..6c207194a12 100644 --- a/service/gamelift/api_op_ListGameServers.go +++ b/service/gamelift/api_op_ListGameServers.go @@ -4,6 +4,7 @@ package gamelift import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/gamelift/types" @@ -145,6 +146,82 @@ func addOperationListGameServersMiddlewares(stack *middleware.Stack, options Opt return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListGameServersPaginator returns a new ListGameServersPaginator +func NewListGameServersPaginator(client ListGameServersAPIClient, params *ListGameServersInput, optFns ...func(*ListGameServersPaginatorOptions)) *ListGameServersPaginator { + options := ListGameServersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListGameServersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListGameServers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/gamelift/api_op_ListScripts.go b/service/gamelift/api_op_ListScripts.go index d0ff1882bcd..205dc5d965e 100644 --- a/service/gamelift/api_op_ListScripts.go +++ b/service/gamelift/api_op_ListScripts.go @@ -4,6 +4,7 @@ package gamelift import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/gamelift/types" @@ -124,6 +125,81 @@ func addOperationListScriptsMiddlewares(stack *middleware.Stack, options Options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListScriptsPaginator returns a new ListScriptsPaginator +func NewListScriptsPaginator(client ListScriptsAPIClient, params *ListScriptsInput, optFns ...func(*ListScriptsPaginatorOptions)) *ListScriptsPaginator { + options := ListScriptsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListScriptsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListScripts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/gamelift/api_op_SearchGameSessions.go b/service/gamelift/api_op_SearchGameSessions.go index d4917a6bc47..418b03edd46 100644 --- a/service/gamelift/api_op_SearchGameSessions.go +++ b/service/gamelift/api_op_SearchGameSessions.go @@ -4,6 +4,7 @@ package gamelift import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/gamelift/types" @@ -255,6 +256,84 @@ func addOperationSearchGameSessionsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewSearchGameSessionsPaginator returns a new SearchGameSessionsPaginator +func NewSearchGameSessionsPaginator(client SearchGameSessionsAPIClient, params *SearchGameSessionsInput, optFns ...func(*SearchGameSessionsPaginatorOptions)) *SearchGameSessionsPaginator { + options := SearchGameSessionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchGameSessionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearchGameSessions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/gamelift/go.mod b/service/gamelift/go.mod index d920a17fa62..7ab50b41830 100644 --- a/service/gamelift/go.mod +++ b/service/gamelift/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/gamelift/go.sum b/service/gamelift/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/gamelift/go.sum +++ b/service/gamelift/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 2b9d68b200e..00000000000 --- a/service/gamelift/paginators.go +++ /dev/null @@ -1,1551 +0,0 @@ -// 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.mod b/service/glacier/go.mod index adc6f23c9ea..166a4997bdf 100644 --- a/service/glacier/go.mod +++ b/service/glacier/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/glacier/go.sum b/service/glacier/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/glacier/go.sum +++ b/service/glacier/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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.mod b/service/globalaccelerator/go.mod index 8e821c1d96f..6937c423dc3 100644 --- a/service/globalaccelerator/go.mod +++ b/service/globalaccelerator/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/globalaccelerator/go.sum b/service/globalaccelerator/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/globalaccelerator/go.sum +++ b/service/globalaccelerator/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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/api_op_GetClassifiers.go b/service/glue/api_op_GetClassifiers.go index 5be3b17009c..14498435f06 100644 --- a/service/glue/api_op_GetClassifiers.go +++ b/service/glue/api_op_GetClassifiers.go @@ -4,6 +4,7 @@ package glue import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/glue/types" @@ -105,6 +106,81 @@ func addOperationGetClassifiersMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetClassifiersPaginator returns a new GetClassifiersPaginator +func NewGetClassifiersPaginator(client GetClassifiersAPIClient, params *GetClassifiersInput, optFns ...func(*GetClassifiersPaginatorOptions)) *GetClassifiersPaginator { + options := GetClassifiersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetClassifiersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetClassifiers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/glue/api_op_GetConnections.go b/service/glue/api_op_GetConnections.go index 35e168d808e..b83b3869da9 100644 --- a/service/glue/api_op_GetConnections.go +++ b/service/glue/api_op_GetConnections.go @@ -4,6 +4,7 @@ package glue import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/glue/types" @@ -120,6 +121,81 @@ func addOperationGetConnectionsMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetConnectionsPaginator returns a new GetConnectionsPaginator +func NewGetConnectionsPaginator(client GetConnectionsAPIClient, params *GetConnectionsInput, optFns ...func(*GetConnectionsPaginatorOptions)) *GetConnectionsPaginator { + options := GetConnectionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetConnectionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetConnections(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/glue/api_op_GetCrawlerMetrics.go b/service/glue/api_op_GetCrawlerMetrics.go index 4bb5c4f4dad..75c38542e9c 100644 --- a/service/glue/api_op_GetCrawlerMetrics.go +++ b/service/glue/api_op_GetCrawlerMetrics.go @@ -4,6 +4,7 @@ package glue import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/glue/types" @@ -109,6 +110,81 @@ func addOperationGetCrawlerMetricsMiddlewares(stack *middleware.Stack, options O return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetCrawlerMetricsPaginator returns a new GetCrawlerMetricsPaginator +func NewGetCrawlerMetricsPaginator(client GetCrawlerMetricsAPIClient, params *GetCrawlerMetricsInput, optFns ...func(*GetCrawlerMetricsPaginatorOptions)) *GetCrawlerMetricsPaginator { + options := GetCrawlerMetricsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetCrawlerMetricsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetCrawlerMetrics(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/glue/api_op_GetCrawlers.go b/service/glue/api_op_GetCrawlers.go index 7ce6ff51ea6..c8dff5562ab 100644 --- a/service/glue/api_op_GetCrawlers.go +++ b/service/glue/api_op_GetCrawlers.go @@ -4,6 +4,7 @@ package glue import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/glue/types" @@ -106,6 +107,80 @@ func addOperationGetCrawlersMiddlewares(stack *middleware.Stack, options Options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetCrawlersPaginator returns a new GetCrawlersPaginator +func NewGetCrawlersPaginator(client GetCrawlersAPIClient, params *GetCrawlersInput, optFns ...func(*GetCrawlersPaginatorOptions)) *GetCrawlersPaginator { + options := GetCrawlersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetCrawlersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetCrawlers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/glue/api_op_GetDatabases.go b/service/glue/api_op_GetDatabases.go index 04b9e836890..db1f903b8b2 100644 --- a/service/glue/api_op_GetDatabases.go +++ b/service/glue/api_op_GetDatabases.go @@ -4,6 +4,7 @@ package glue import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/glue/types" @@ -123,6 +124,80 @@ func addOperationGetDatabasesMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetDatabasesPaginator returns a new GetDatabasesPaginator +func NewGetDatabasesPaginator(client GetDatabasesAPIClient, params *GetDatabasesInput, optFns ...func(*GetDatabasesPaginatorOptions)) *GetDatabasesPaginator { + options := GetDatabasesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetDatabasesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetDatabases(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/glue/api_op_GetDevEndpoints.go b/service/glue/api_op_GetDevEndpoints.go index 250870a4660..e2e65bdd5ef 100644 --- a/service/glue/api_op_GetDevEndpoints.go +++ b/service/glue/api_op_GetDevEndpoints.go @@ -4,6 +4,7 @@ package glue import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/glue/types" @@ -109,6 +110,81 @@ func addOperationGetDevEndpointsMiddlewares(stack *middleware.Stack, options Opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetDevEndpointsPaginator returns a new GetDevEndpointsPaginator +func NewGetDevEndpointsPaginator(client GetDevEndpointsAPIClient, params *GetDevEndpointsInput, optFns ...func(*GetDevEndpointsPaginatorOptions)) *GetDevEndpointsPaginator { + options := GetDevEndpointsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetDevEndpointsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetDevEndpoints(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/glue/api_op_GetJobRuns.go b/service/glue/api_op_GetJobRuns.go index 52f1efc2fe7..63de8caa66c 100644 --- a/service/glue/api_op_GetJobRuns.go +++ b/service/glue/api_op_GetJobRuns.go @@ -4,6 +4,7 @@ package glue import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/glue/types" @@ -113,6 +114,80 @@ func addOperationGetJobRunsMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetJobRunsPaginator returns a new GetJobRunsPaginator +func NewGetJobRunsPaginator(client GetJobRunsAPIClient, params *GetJobRunsInput, optFns ...func(*GetJobRunsPaginatorOptions)) *GetJobRunsPaginator { + options := GetJobRunsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetJobRunsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetJobRuns(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/glue/api_op_GetJobs.go b/service/glue/api_op_GetJobs.go index bce53e951b2..5124435eddc 100644 --- a/service/glue/api_op_GetJobs.go +++ b/service/glue/api_op_GetJobs.go @@ -4,6 +4,7 @@ package glue import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/glue/types" @@ -105,6 +106,80 @@ func addOperationGetJobsMiddlewares(stack *middleware.Stack, options Options) (e return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetJobsPaginator returns a new GetJobsPaginator +func NewGetJobsPaginator(client GetJobsAPIClient, params *GetJobsInput, optFns ...func(*GetJobsPaginatorOptions)) *GetJobsPaginator { + options := GetJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetJobsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/glue/api_op_GetMLTaskRuns.go b/service/glue/api_op_GetMLTaskRuns.go index f7de2a0c965..00420fb68c1 100644 --- a/service/glue/api_op_GetMLTaskRuns.go +++ b/service/glue/api_op_GetMLTaskRuns.go @@ -4,6 +4,7 @@ package glue import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/glue/types" @@ -124,6 +125,80 @@ func addOperationGetMLTaskRunsMiddlewares(stack *middleware.Stack, options Optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetMLTaskRunsPaginator returns a new GetMLTaskRunsPaginator +func NewGetMLTaskRunsPaginator(client GetMLTaskRunsAPIClient, params *GetMLTaskRunsInput, optFns ...func(*GetMLTaskRunsPaginatorOptions)) *GetMLTaskRunsPaginator { + options := GetMLTaskRunsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetMLTaskRunsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetMLTaskRuns(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/glue/api_op_GetMLTransforms.go b/service/glue/api_op_GetMLTransforms.go index 1a669d8b4be..7c8b69178b2 100644 --- a/service/glue/api_op_GetMLTransforms.go +++ b/service/glue/api_op_GetMLTransforms.go @@ -4,6 +4,7 @@ package glue import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/glue/types" @@ -120,6 +121,81 @@ func addOperationGetMLTransformsMiddlewares(stack *middleware.Stack, options Opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetMLTransformsPaginator returns a new GetMLTransformsPaginator +func NewGetMLTransformsPaginator(client GetMLTransformsAPIClient, params *GetMLTransformsInput, optFns ...func(*GetMLTransformsPaginatorOptions)) *GetMLTransformsPaginator { + options := GetMLTransformsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetMLTransformsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetMLTransforms(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/glue/api_op_GetPartitionIndexes.go b/service/glue/api_op_GetPartitionIndexes.go index 67378518b2e..d0e2511b969 100644 --- a/service/glue/api_op_GetPartitionIndexes.go +++ b/service/glue/api_op_GetPartitionIndexes.go @@ -4,6 +4,7 @@ package glue import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/glue/types" @@ -120,6 +121,78 @@ func addOperationGetPartitionIndexesMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetPartitionIndexesPaginator returns a new GetPartitionIndexesPaginator +func NewGetPartitionIndexesPaginator(client GetPartitionIndexesAPIClient, params *GetPartitionIndexesInput, optFns ...func(*GetPartitionIndexesPaginatorOptions)) *GetPartitionIndexesPaginator { + options := GetPartitionIndexesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetPartitionIndexesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetPartitionIndexes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/glue/api_op_GetPartitions.go b/service/glue/api_op_GetPartitions.go index 9fb132e915f..f9115f212bb 100644 --- a/service/glue/api_op_GetPartitions.go +++ b/service/glue/api_op_GetPartitions.go @@ -4,6 +4,7 @@ package glue import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/glue/types" @@ -173,6 +174,80 @@ func addOperationGetPartitionsMiddlewares(stack *middleware.Stack, options Optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetPartitionsPaginator returns a new GetPartitionsPaginator +func NewGetPartitionsPaginator(client GetPartitionsAPIClient, params *GetPartitionsInput, optFns ...func(*GetPartitionsPaginatorOptions)) *GetPartitionsPaginator { + options := GetPartitionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetPartitionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetPartitions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/glue/api_op_GetSecurityConfigurations.go b/service/glue/api_op_GetSecurityConfigurations.go index f938e83b402..fa99990ba45 100644 --- a/service/glue/api_op_GetSecurityConfigurations.go +++ b/service/glue/api_op_GetSecurityConfigurations.go @@ -4,6 +4,7 @@ package glue import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/glue/types" @@ -105,6 +106,83 @@ func addOperationGetSecurityConfigurationsMiddlewares(stack *middleware.Stack, o return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetSecurityConfigurationsPaginator returns a new +// GetSecurityConfigurationsPaginator +func NewGetSecurityConfigurationsPaginator(client GetSecurityConfigurationsAPIClient, params *GetSecurityConfigurationsInput, optFns ...func(*GetSecurityConfigurationsPaginatorOptions)) *GetSecurityConfigurationsPaginator { + options := GetSecurityConfigurationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetSecurityConfigurationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetSecurityConfigurations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/glue/api_op_GetTableVersions.go b/service/glue/api_op_GetTableVersions.go index 72dd2ec09ac..2226c9e36eb 100644 --- a/service/glue/api_op_GetTableVersions.go +++ b/service/glue/api_op_GetTableVersions.go @@ -4,6 +4,7 @@ package glue import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/glue/types" @@ -125,6 +126,81 @@ func addOperationGetTableVersionsMiddlewares(stack *middleware.Stack, options Op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetTableVersionsPaginator returns a new GetTableVersionsPaginator +func NewGetTableVersionsPaginator(client GetTableVersionsAPIClient, params *GetTableVersionsInput, optFns ...func(*GetTableVersionsPaginatorOptions)) *GetTableVersionsPaginator { + options := GetTableVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetTableVersionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetTableVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/glue/api_op_GetTables.go b/service/glue/api_op_GetTables.go index 59dd533bb20..00f3d6ea75f 100644 --- a/service/glue/api_op_GetTables.go +++ b/service/glue/api_op_GetTables.go @@ -4,6 +4,7 @@ package glue import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/glue/types" @@ -122,6 +123,80 @@ func addOperationGetTablesMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetTablesPaginator returns a new GetTablesPaginator +func NewGetTablesPaginator(client GetTablesAPIClient, params *GetTablesInput, optFns ...func(*GetTablesPaginatorOptions)) *GetTablesPaginator { + options := GetTablesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetTablesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetTables(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/glue/api_op_GetTriggers.go b/service/glue/api_op_GetTriggers.go index 6cb42f89c4d..19b6f3cbbaf 100644 --- a/service/glue/api_op_GetTriggers.go +++ b/service/glue/api_op_GetTriggers.go @@ -4,6 +4,7 @@ package glue import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/glue/types" @@ -109,6 +110,80 @@ func addOperationGetTriggersMiddlewares(stack *middleware.Stack, options Options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetTriggersPaginator returns a new GetTriggersPaginator +func NewGetTriggersPaginator(client GetTriggersAPIClient, params *GetTriggersInput, optFns ...func(*GetTriggersPaginatorOptions)) *GetTriggersPaginator { + options := GetTriggersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetTriggersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetTriggers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/glue/api_op_GetUserDefinedFunctions.go b/service/glue/api_op_GetUserDefinedFunctions.go index 5c5b3589b25..781d0df14f3 100644 --- a/service/glue/api_op_GetUserDefinedFunctions.go +++ b/service/glue/api_op_GetUserDefinedFunctions.go @@ -4,6 +4,7 @@ package glue import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/glue/types" @@ -123,6 +124,83 @@ func addOperationGetUserDefinedFunctionsMiddlewares(stack *middleware.Stack, opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetUserDefinedFunctionsPaginator returns a new +// GetUserDefinedFunctionsPaginator +func NewGetUserDefinedFunctionsPaginator(client GetUserDefinedFunctionsAPIClient, params *GetUserDefinedFunctionsInput, optFns ...func(*GetUserDefinedFunctionsPaginatorOptions)) *GetUserDefinedFunctionsPaginator { + options := GetUserDefinedFunctionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetUserDefinedFunctionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetUserDefinedFunctions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/glue/api_op_GetWorkflowRuns.go b/service/glue/api_op_GetWorkflowRuns.go index eb9effede32..e0272eeb887 100644 --- a/service/glue/api_op_GetWorkflowRuns.go +++ b/service/glue/api_op_GetWorkflowRuns.go @@ -4,6 +4,7 @@ package glue import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/glue/types" @@ -116,6 +117,81 @@ func addOperationGetWorkflowRunsMiddlewares(stack *middleware.Stack, options Opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetWorkflowRunsPaginator returns a new GetWorkflowRunsPaginator +func NewGetWorkflowRunsPaginator(client GetWorkflowRunsAPIClient, params *GetWorkflowRunsInput, optFns ...func(*GetWorkflowRunsPaginatorOptions)) *GetWorkflowRunsPaginator { + options := GetWorkflowRunsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetWorkflowRunsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetWorkflowRuns(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/glue/api_op_ListCrawlers.go b/service/glue/api_op_ListCrawlers.go index f356d70936c..9428067d4a3 100644 --- a/service/glue/api_op_ListCrawlers.go +++ b/service/glue/api_op_ListCrawlers.go @@ -4,6 +4,7 @@ package glue import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -114,6 +115,80 @@ func addOperationListCrawlersMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListCrawlersPaginator returns a new ListCrawlersPaginator +func NewListCrawlersPaginator(client ListCrawlersAPIClient, params *ListCrawlersInput, optFns ...func(*ListCrawlersPaginatorOptions)) *ListCrawlersPaginator { + options := ListCrawlersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListCrawlersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListCrawlers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/glue/api_op_ListDevEndpoints.go b/service/glue/api_op_ListDevEndpoints.go index 46950a9ca32..5e0a4faf3ba 100644 --- a/service/glue/api_op_ListDevEndpoints.go +++ b/service/glue/api_op_ListDevEndpoints.go @@ -4,6 +4,7 @@ package glue import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -114,6 +115,81 @@ func addOperationListDevEndpointsMiddlewares(stack *middleware.Stack, options Op return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDevEndpointsPaginator returns a new ListDevEndpointsPaginator +func NewListDevEndpointsPaginator(client ListDevEndpointsAPIClient, params *ListDevEndpointsInput, optFns ...func(*ListDevEndpointsPaginatorOptions)) *ListDevEndpointsPaginator { + options := ListDevEndpointsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDevEndpointsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDevEndpoints(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/glue/api_op_ListJobs.go b/service/glue/api_op_ListJobs.go index f7f27936764..c3f18b381a5 100644 --- a/service/glue/api_op_ListJobs.go +++ b/service/glue/api_op_ListJobs.go @@ -4,6 +4,7 @@ package glue import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -113,6 +114,80 @@ func addOperationListJobsMiddlewares(stack *middleware.Stack, options Options) ( return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListJobsPaginator returns a new ListJobsPaginator +func NewListJobsPaginator(client ListJobsAPIClient, params *ListJobsInput, optFns ...func(*ListJobsPaginatorOptions)) *ListJobsPaginator { + options := ListJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListJobsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/glue/api_op_ListMLTransforms.go b/service/glue/api_op_ListMLTransforms.go index 918df95fecd..f93a194749b 100644 --- a/service/glue/api_op_ListMLTransforms.go +++ b/service/glue/api_op_ListMLTransforms.go @@ -4,6 +4,7 @@ package glue import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/glue/types" @@ -125,6 +126,81 @@ func addOperationListMLTransformsMiddlewares(stack *middleware.Stack, options Op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListMLTransformsPaginator returns a new ListMLTransformsPaginator +func NewListMLTransformsPaginator(client ListMLTransformsAPIClient, params *ListMLTransformsInput, optFns ...func(*ListMLTransformsPaginatorOptions)) *ListMLTransformsPaginator { + options := ListMLTransformsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListMLTransformsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListMLTransforms(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/glue/api_op_ListTriggers.go b/service/glue/api_op_ListTriggers.go index d06a3664867..b8d543596b9 100644 --- a/service/glue/api_op_ListTriggers.go +++ b/service/glue/api_op_ListTriggers.go @@ -4,6 +4,7 @@ package glue import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -118,6 +119,80 @@ func addOperationListTriggersMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTriggersPaginator returns a new ListTriggersPaginator +func NewListTriggersPaginator(client ListTriggersAPIClient, params *ListTriggersInput, optFns ...func(*ListTriggersPaginatorOptions)) *ListTriggersPaginator { + options := ListTriggersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTriggersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTriggers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/glue/api_op_ListWorkflows.go b/service/glue/api_op_ListWorkflows.go index 752dab033b2..bfbd33ef368 100644 --- a/service/glue/api_op_ListWorkflows.go +++ b/service/glue/api_op_ListWorkflows.go @@ -4,6 +4,7 @@ package glue import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -104,6 +105,80 @@ func addOperationListWorkflowsMiddlewares(stack *middleware.Stack, options Optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListWorkflowsPaginator returns a new ListWorkflowsPaginator +func NewListWorkflowsPaginator(client ListWorkflowsAPIClient, params *ListWorkflowsInput, optFns ...func(*ListWorkflowsPaginatorOptions)) *ListWorkflowsPaginator { + options := ListWorkflowsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListWorkflowsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListWorkflows(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/glue/api_op_SearchTables.go b/service/glue/api_op_SearchTables.go index eb295f91368..60a0faa5262 100644 --- a/service/glue/api_op_SearchTables.go +++ b/service/glue/api_op_SearchTables.go @@ -4,6 +4,7 @@ package glue import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/glue/types" @@ -146,6 +147,80 @@ func addOperationSearchTablesMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewSearchTablesPaginator returns a new SearchTablesPaginator +func NewSearchTablesPaginator(client SearchTablesAPIClient, params *SearchTablesInput, optFns ...func(*SearchTablesPaginatorOptions)) *SearchTablesPaginator { + options := SearchTablesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchTablesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearchTables(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/glue/go.mod b/service/glue/go.mod index d407692de26..f114397d97d 100644 --- a/service/glue/go.mod +++ b/service/glue/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/glue/go.sum b/service/glue/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/glue/go.sum +++ b/service/glue/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 73735ee0024..00000000000 --- a/service/glue/paginators.go +++ /dev/null @@ -1,1871 +0,0 @@ -// 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.mod b/service/greengrass/go.mod index 168db2acea6..620d7adb08a 100644 --- a/service/greengrass/go.mod +++ b/service/greengrass/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/greengrass/go.sum b/service/greengrass/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/greengrass/go.sum +++ b/service/greengrass/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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/api_op_ListConfigs.go b/service/groundstation/api_op_ListConfigs.go index 605c8c7c806..b6d6ea9c408 100644 --- a/service/groundstation/api_op_ListConfigs.go +++ b/service/groundstation/api_op_ListConfigs.go @@ -4,6 +4,7 @@ package groundstation import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/groundstation/types" @@ -105,3 +106,77 @@ func addOperationListConfigsMiddlewares(stack *middleware.Stack, options Options } return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListConfigsPaginator returns a new ListConfigsPaginator +func NewListConfigsPaginator(client ListConfigsAPIClient, params *ListConfigsInput, optFns ...func(*ListConfigsPaginatorOptions)) *ListConfigsPaginator { + options := ListConfigsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListConfigsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} diff --git a/service/groundstation/api_op_ListContacts.go b/service/groundstation/api_op_ListContacts.go index bfadd554f8f..a1ba5a003c9 100644 --- a/service/groundstation/api_op_ListContacts.go +++ b/service/groundstation/api_op_ListContacts.go @@ -4,6 +4,7 @@ package groundstation import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/groundstation/types" @@ -134,3 +135,77 @@ func addOperationListContactsMiddlewares(stack *middleware.Stack, options Option } return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListContactsPaginator returns a new ListContactsPaginator +func NewListContactsPaginator(client ListContactsAPIClient, params *ListContactsInput, optFns ...func(*ListContactsPaginatorOptions)) *ListContactsPaginator { + options := ListContactsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListContactsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} diff --git a/service/groundstation/api_op_ListDataflowEndpointGroups.go b/service/groundstation/api_op_ListDataflowEndpointGroups.go index e8ec828bde6..f1d4ad8ba14 100644 --- a/service/groundstation/api_op_ListDataflowEndpointGroups.go +++ b/service/groundstation/api_op_ListDataflowEndpointGroups.go @@ -4,6 +4,7 @@ package groundstation import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/groundstation/types" @@ -105,3 +106,80 @@ func addOperationListDataflowEndpointGroupsMiddlewares(stack *middleware.Stack, } return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDataflowEndpointGroupsPaginator returns a new +// ListDataflowEndpointGroupsPaginator +func NewListDataflowEndpointGroupsPaginator(client ListDataflowEndpointGroupsAPIClient, params *ListDataflowEndpointGroupsInput, optFns ...func(*ListDataflowEndpointGroupsPaginatorOptions)) *ListDataflowEndpointGroupsPaginator { + options := ListDataflowEndpointGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDataflowEndpointGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} diff --git a/service/groundstation/api_op_ListGroundStations.go b/service/groundstation/api_op_ListGroundStations.go index 09fe122bdab..d85acb6bccc 100644 --- a/service/groundstation/api_op_ListGroundStations.go +++ b/service/groundstation/api_op_ListGroundStations.go @@ -4,6 +4,7 @@ package groundstation import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/groundstation/types" @@ -108,3 +109,79 @@ func addOperationListGroundStationsMiddlewares(stack *middleware.Stack, options } return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListGroundStationsPaginator returns a new ListGroundStationsPaginator +func NewListGroundStationsPaginator(client ListGroundStationsAPIClient, params *ListGroundStationsInput, optFns ...func(*ListGroundStationsPaginatorOptions)) *ListGroundStationsPaginator { + options := ListGroundStationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListGroundStationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} diff --git a/service/groundstation/api_op_ListMissionProfiles.go b/service/groundstation/api_op_ListMissionProfiles.go index 9aa7f00c75f..66e8d4dd118 100644 --- a/service/groundstation/api_op_ListMissionProfiles.go +++ b/service/groundstation/api_op_ListMissionProfiles.go @@ -4,6 +4,7 @@ package groundstation import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/groundstation/types" @@ -105,3 +106,79 @@ func addOperationListMissionProfilesMiddlewares(stack *middleware.Stack, options } return nil } + +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListMissionProfilesPaginator returns a new ListMissionProfilesPaginator +func NewListMissionProfilesPaginator(client ListMissionProfilesAPIClient, params *ListMissionProfilesInput, optFns ...func(*ListMissionProfilesPaginatorOptions)) *ListMissionProfilesPaginator { + options := ListMissionProfilesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListMissionProfilesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} diff --git a/service/groundstation/api_op_ListSatellites.go b/service/groundstation/api_op_ListSatellites.go index 7e4b656665f..16052459061 100644 --- a/service/groundstation/api_op_ListSatellites.go +++ b/service/groundstation/api_op_ListSatellites.go @@ -4,6 +4,7 @@ package groundstation import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/groundstation/types" @@ -105,3 +106,78 @@ func addOperationListSatellitesMiddlewares(stack *middleware.Stack, options Opti } return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListSatellitesPaginator returns a new ListSatellitesPaginator +func NewListSatellitesPaginator(client ListSatellitesAPIClient, params *ListSatellitesInput, optFns ...func(*ListSatellitesPaginatorOptions)) *ListSatellitesPaginator { + options := ListSatellitesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSatellitesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} diff --git a/service/groundstation/go.mod b/service/groundstation/go.mod index 6e718f38d24..d2d6cffc4ee 100644 --- a/service/groundstation/go.mod +++ b/service/groundstation/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/groundstation/go.sum b/service/groundstation/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/groundstation/go.sum +++ b/service/groundstation/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index e1cb2c96f7e..00000000000 --- a/service/groundstation/paginators.go +++ /dev/null @@ -1,460 +0,0 @@ -// 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/api_op_GetUsageStatistics.go b/service/guardduty/api_op_GetUsageStatistics.go index a690f69a1cf..93c6277a698 100644 --- a/service/guardduty/api_op_GetUsageStatistics.go +++ b/service/guardduty/api_op_GetUsageStatistics.go @@ -4,6 +4,7 @@ package guardduty import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/guardduty/types" @@ -139,6 +140,82 @@ func addOperationGetUsageStatisticsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetUsageStatisticsPaginator returns a new GetUsageStatisticsPaginator +func NewGetUsageStatisticsPaginator(client GetUsageStatisticsAPIClient, params *GetUsageStatisticsInput, optFns ...func(*GetUsageStatisticsPaginatorOptions)) *GetUsageStatisticsPaginator { + options := GetUsageStatisticsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetUsageStatisticsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetUsageStatistics(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/guardduty/api_op_ListDetectors.go b/service/guardduty/api_op_ListDetectors.go index 960d5df43bb..da8e43d32b4 100644 --- a/service/guardduty/api_op_ListDetectors.go +++ b/service/guardduty/api_op_ListDetectors.go @@ -4,6 +4,7 @@ package guardduty import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -111,6 +112,81 @@ func addOperationListDetectorsMiddlewares(stack *middleware.Stack, options Optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDetectorsPaginator returns a new ListDetectorsPaginator +func NewListDetectorsPaginator(client ListDetectorsAPIClient, params *ListDetectorsInput, optFns ...func(*ListDetectorsPaginatorOptions)) *ListDetectorsPaginator { + options := ListDetectorsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDetectorsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDetectors(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/guardduty/api_op_ListFilters.go b/service/guardduty/api_op_ListFilters.go index c29b908277a..ae2c1c99faf 100644 --- a/service/guardduty/api_op_ListFilters.go +++ b/service/guardduty/api_op_ListFilters.go @@ -4,6 +4,7 @@ package guardduty import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -119,6 +120,81 @@ func addOperationListFiltersMiddlewares(stack *middleware.Stack, options Options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListFiltersPaginator returns a new ListFiltersPaginator +func NewListFiltersPaginator(client ListFiltersAPIClient, params *ListFiltersInput, optFns ...func(*ListFiltersPaginatorOptions)) *ListFiltersPaginator { + options := ListFiltersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListFiltersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListFilters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/guardduty/api_op_ListFindings.go b/service/guardduty/api_op_ListFindings.go index 9a402690357..2d7c0156d96 100644 --- a/service/guardduty/api_op_ListFindings.go +++ b/service/guardduty/api_op_ListFindings.go @@ -4,6 +4,7 @@ package guardduty import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/guardduty/types" @@ -265,6 +266,81 @@ func addOperationListFindingsMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListFindingsPaginator returns a new ListFindingsPaginator +func NewListFindingsPaginator(client ListFindingsAPIClient, params *ListFindingsInput, optFns ...func(*ListFindingsPaginatorOptions)) *ListFindingsPaginator { + options := ListFindingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListFindingsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListFindings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/guardduty/api_op_ListIPSets.go b/service/guardduty/api_op_ListIPSets.go index cab5fa2a2f5..8f2fe0eeafb 100644 --- a/service/guardduty/api_op_ListIPSets.go +++ b/service/guardduty/api_op_ListIPSets.go @@ -4,6 +4,7 @@ package guardduty import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -121,6 +122,81 @@ func addOperationListIPSetsMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListIPSetsPaginator returns a new ListIPSetsPaginator +func NewListIPSetsPaginator(client ListIPSetsAPIClient, params *ListIPSetsInput, optFns ...func(*ListIPSetsPaginatorOptions)) *ListIPSetsPaginator { + options := ListIPSetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListIPSetsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListIPSets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/guardduty/api_op_ListInvitations.go b/service/guardduty/api_op_ListInvitations.go index feb194dfb61..1ba3bd09dea 100644 --- a/service/guardduty/api_op_ListInvitations.go +++ b/service/guardduty/api_op_ListInvitations.go @@ -4,6 +4,7 @@ package guardduty import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/guardduty/types" @@ -111,6 +112,82 @@ func addOperationListInvitationsMiddlewares(stack *middleware.Stack, options Opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListInvitationsPaginator returns a new ListInvitationsPaginator +func NewListInvitationsPaginator(client ListInvitationsAPIClient, params *ListInvitationsInput, optFns ...func(*ListInvitationsPaginatorOptions)) *ListInvitationsPaginator { + options := ListInvitationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListInvitationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListInvitations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/guardduty/api_op_ListMembers.go b/service/guardduty/api_op_ListMembers.go index 2a21443bbba..d2bed1ba3e9 100644 --- a/service/guardduty/api_op_ListMembers.go +++ b/service/guardduty/api_op_ListMembers.go @@ -4,6 +4,7 @@ package guardduty import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/guardduty/types" @@ -123,6 +124,81 @@ func addOperationListMembersMiddlewares(stack *middleware.Stack, options Options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListMembersPaginator returns a new ListMembersPaginator +func NewListMembersPaginator(client ListMembersAPIClient, params *ListMembersInput, optFns ...func(*ListMembersPaginatorOptions)) *ListMembersPaginator { + options := ListMembersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListMembersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListMembers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/guardduty/api_op_ListOrganizationAdminAccounts.go b/service/guardduty/api_op_ListOrganizationAdminAccounts.go index 02714402c46..c5385279e81 100644 --- a/service/guardduty/api_op_ListOrganizationAdminAccounts.go +++ b/service/guardduty/api_op_ListOrganizationAdminAccounts.go @@ -4,6 +4,7 @@ package guardduty import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/guardduty/types" @@ -110,6 +111,83 @@ func addOperationListOrganizationAdminAccountsMiddlewares(stack *middleware.Stac return 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 results to return in the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListOrganizationAdminAccountsPaginator returns a new +// ListOrganizationAdminAccountsPaginator +func NewListOrganizationAdminAccountsPaginator(client ListOrganizationAdminAccountsAPIClient, params *ListOrganizationAdminAccountsInput, optFns ...func(*ListOrganizationAdminAccountsPaginatorOptions)) *ListOrganizationAdminAccountsPaginator { + options := ListOrganizationAdminAccountsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListOrganizationAdminAccountsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListOrganizationAdminAccounts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/guardduty/api_op_ListPublishingDestinations.go b/service/guardduty/api_op_ListPublishingDestinations.go index 66eb5d7220f..738864686c2 100644 --- a/service/guardduty/api_op_ListPublishingDestinations.go +++ b/service/guardduty/api_op_ListPublishingDestinations.go @@ -4,6 +4,7 @@ package guardduty import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/guardduty/types" @@ -123,6 +124,83 @@ func addOperationListPublishingDestinationsMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListPublishingDestinationsPaginator returns a new +// ListPublishingDestinationsPaginator +func NewListPublishingDestinationsPaginator(client ListPublishingDestinationsAPIClient, params *ListPublishingDestinationsInput, optFns ...func(*ListPublishingDestinationsPaginatorOptions)) *ListPublishingDestinationsPaginator { + options := ListPublishingDestinationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPublishingDestinationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPublishingDestinations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/guardduty/api_op_ListThreatIntelSets.go b/service/guardduty/api_op_ListThreatIntelSets.go index 10a92eb74e8..69d71deb023 100644 --- a/service/guardduty/api_op_ListThreatIntelSets.go +++ b/service/guardduty/api_op_ListThreatIntelSets.go @@ -4,6 +4,7 @@ package guardduty import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -121,6 +122,83 @@ func addOperationListThreatIntelSetsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListThreatIntelSetsPaginator returns a new ListThreatIntelSetsPaginator +func NewListThreatIntelSetsPaginator(client ListThreatIntelSetsAPIClient, params *ListThreatIntelSetsInput, optFns ...func(*ListThreatIntelSetsPaginatorOptions)) *ListThreatIntelSetsPaginator { + options := ListThreatIntelSetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListThreatIntelSetsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListThreatIntelSets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/guardduty/go.mod b/service/guardduty/go.mod index fd2523e0d19..c0d567e2390 100644 --- a/service/guardduty/go.mod +++ b/service/guardduty/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/guardduty/go.sum b/service/guardduty/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/guardduty/go.sum +++ b/service/guardduty/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index e0444ea7d58..00000000000 --- a/service/guardduty/paginators.go +++ /dev/null @@ -1,766 +0,0 @@ -// 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/api_op_DescribeAffectedAccountsForOrganization.go b/service/health/api_op_DescribeAffectedAccountsForOrganization.go index c3636e7b5c2..fa809db1dd8 100644 --- a/service/health/api_op_DescribeAffectedAccountsForOrganization.go +++ b/service/health/api_op_DescribeAffectedAccountsForOrganization.go @@ -4,6 +4,7 @@ package health import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/health/types" @@ -151,6 +152,84 @@ func addOperationDescribeAffectedAccountsForOrganizationMiddlewares(stack *middl return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeAffectedAccountsForOrganizationPaginator returns a new +// DescribeAffectedAccountsForOrganizationPaginator +func NewDescribeAffectedAccountsForOrganizationPaginator(client DescribeAffectedAccountsForOrganizationAPIClient, params *DescribeAffectedAccountsForOrganizationInput, optFns ...func(*DescribeAffectedAccountsForOrganizationPaginatorOptions)) *DescribeAffectedAccountsForOrganizationPaginator { + options := DescribeAffectedAccountsForOrganizationPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeAffectedAccountsForOrganizationInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeAffectedAccountsForOrganization(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/health/api_op_DescribeAffectedEntities.go b/service/health/api_op_DescribeAffectedEntities.go index 78ff01340d6..145712466ae 100644 --- a/service/health/api_op_DescribeAffectedEntities.go +++ b/service/health/api_op_DescribeAffectedEntities.go @@ -4,6 +4,7 @@ package health import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/health/types" @@ -134,6 +135,84 @@ func addOperationDescribeAffectedEntitiesMiddlewares(stack *middleware.Stack, op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeAffectedEntitiesPaginator returns a new +// DescribeAffectedEntitiesPaginator +func NewDescribeAffectedEntitiesPaginator(client DescribeAffectedEntitiesAPIClient, params *DescribeAffectedEntitiesInput, optFns ...func(*DescribeAffectedEntitiesPaginatorOptions)) *DescribeAffectedEntitiesPaginator { + options := DescribeAffectedEntitiesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeAffectedEntitiesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeAffectedEntities(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/health/api_op_DescribeAffectedEntitiesForOrganization.go b/service/health/api_op_DescribeAffectedEntitiesForOrganization.go index 10783824220..51b20af1a70 100644 --- a/service/health/api_op_DescribeAffectedEntitiesForOrganization.go +++ b/service/health/api_op_DescribeAffectedEntitiesForOrganization.go @@ -4,6 +4,7 @@ package health import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/health/types" @@ -143,6 +144,84 @@ func addOperationDescribeAffectedEntitiesForOrganizationMiddlewares(stack *middl return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeAffectedEntitiesForOrganizationPaginator returns a new +// DescribeAffectedEntitiesForOrganizationPaginator +func NewDescribeAffectedEntitiesForOrganizationPaginator(client DescribeAffectedEntitiesForOrganizationAPIClient, params *DescribeAffectedEntitiesForOrganizationInput, optFns ...func(*DescribeAffectedEntitiesForOrganizationPaginatorOptions)) *DescribeAffectedEntitiesForOrganizationPaginator { + options := DescribeAffectedEntitiesForOrganizationPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeAffectedEntitiesForOrganizationInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeAffectedEntitiesForOrganization(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/health/api_op_DescribeEventAggregates.go b/service/health/api_op_DescribeEventAggregates.go index 3a98a1b0121..72715eab900 100644 --- a/service/health/api_op_DescribeEventAggregates.go +++ b/service/health/api_op_DescribeEventAggregates.go @@ -4,6 +4,7 @@ package health import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/health/types" @@ -128,6 +129,84 @@ func addOperationDescribeEventAggregatesMiddlewares(stack *middleware.Stack, opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeEventAggregatesPaginator returns a new +// DescribeEventAggregatesPaginator +func NewDescribeEventAggregatesPaginator(client DescribeEventAggregatesAPIClient, params *DescribeEventAggregatesInput, optFns ...func(*DescribeEventAggregatesPaginatorOptions)) *DescribeEventAggregatesPaginator { + options := DescribeEventAggregatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEventAggregatesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEventAggregates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/health/api_op_DescribeEventTypes.go b/service/health/api_op_DescribeEventTypes.go index 705c5addbd0..0e4ed2660cb 100644 --- a/service/health/api_op_DescribeEventTypes.go +++ b/service/health/api_op_DescribeEventTypes.go @@ -4,6 +4,7 @@ package health import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/health/types" @@ -127,6 +128,83 @@ func addOperationDescribeEventTypesMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeEventTypesPaginator returns a new DescribeEventTypesPaginator +func NewDescribeEventTypesPaginator(client DescribeEventTypesAPIClient, params *DescribeEventTypesInput, optFns ...func(*DescribeEventTypesPaginatorOptions)) *DescribeEventTypesPaginator { + options := DescribeEventTypesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEventTypesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEventTypes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/health/api_op_DescribeEvents.go b/service/health/api_op_DescribeEvents.go index b7d2d889fc4..c2b686087e3 100644 --- a/service/health/api_op_DescribeEvents.go +++ b/service/health/api_op_DescribeEvents.go @@ -4,6 +4,7 @@ package health import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/health/types" @@ -143,6 +144,82 @@ func addOperationDescribeEventsMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeEventsPaginator returns a new DescribeEventsPaginator +func NewDescribeEventsPaginator(client DescribeEventsAPIClient, params *DescribeEventsInput, optFns ...func(*DescribeEventsPaginatorOptions)) *DescribeEventsPaginator { + options := DescribeEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEventsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEvents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/health/api_op_DescribeEventsForOrganization.go b/service/health/api_op_DescribeEventsForOrganization.go index c85748d7579..4fe0b72438a 100644 --- a/service/health/api_op_DescribeEventsForOrganization.go +++ b/service/health/api_op_DescribeEventsForOrganization.go @@ -4,6 +4,7 @@ package health import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/health/types" @@ -150,6 +151,84 @@ func addOperationDescribeEventsForOrganizationMiddlewares(stack *middleware.Stac return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeEventsForOrganizationPaginator returns a new +// DescribeEventsForOrganizationPaginator +func NewDescribeEventsForOrganizationPaginator(client DescribeEventsForOrganizationAPIClient, params *DescribeEventsForOrganizationInput, optFns ...func(*DescribeEventsForOrganizationPaginatorOptions)) *DescribeEventsForOrganizationPaginator { + options := DescribeEventsForOrganizationPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEventsForOrganizationInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEventsForOrganization(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/health/go.mod b/service/health/go.mod index 5bf5e07427f..6250ab18cc8 100644 --- a/service/health/go.mod +++ b/service/health/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/health/go.sum b/service/health/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/health/go.sum +++ b/service/health/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index a691044545e..00000000000 --- a/service/health/paginators.go +++ /dev/null @@ -1,551 +0,0 @@ -// 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.mod b/service/honeycode/go.mod index 8d9478bf927..76ea3989e2e 100644 --- a/service/honeycode/go.mod +++ b/service/honeycode/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/honeycode/go.sum b/service/honeycode/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/honeycode/go.sum +++ b/service/honeycode/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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/api_op_GetAccountAuthorizationDetails.go b/service/iam/api_op_GetAccountAuthorizationDetails.go index c4062b62973..a37a425c3eb 100644 --- a/service/iam/api_op_GetAccountAuthorizationDetails.go +++ b/service/iam/api_op_GetAccountAuthorizationDetails.go @@ -4,6 +4,7 @@ package iam import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iam/types" @@ -149,6 +150,89 @@ func addOperationGetAccountAuthorizationDetailsMiddlewares(stack *middleware.Sta return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetAccountAuthorizationDetailsPaginator returns a new +// GetAccountAuthorizationDetailsPaginator +func NewGetAccountAuthorizationDetailsPaginator(client GetAccountAuthorizationDetailsAPIClient, params *GetAccountAuthorizationDetailsInput, optFns ...func(*GetAccountAuthorizationDetailsPaginatorOptions)) *GetAccountAuthorizationDetailsPaginator { + options := GetAccountAuthorizationDetailsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetAccountAuthorizationDetailsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetAccountAuthorizationDetails(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_GetGroup.go b/service/iam/api_op_GetGroup.go index 110e2586f22..2e0b111992d 100644 --- a/service/iam/api_op_GetGroup.go +++ b/service/iam/api_op_GetGroup.go @@ -4,6 +4,7 @@ package iam import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iam/types" @@ -143,6 +144,86 @@ func addOperationGetGroupMiddlewares(stack *middleware.Stack, options Options) ( return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetGroupPaginator returns a new GetGroupPaginator +func NewGetGroupPaginator(client GetGroupAPIClient, params *GetGroupInput, optFns ...func(*GetGroupPaginatorOptions)) *GetGroupPaginator { + options := GetGroupPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetGroupInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetGroup(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_ListAccessKeys.go b/service/iam/api_op_ListAccessKeys.go index 7e152c74867..09e5201cd66 100644 --- a/service/iam/api_op_ListAccessKeys.go +++ b/service/iam/api_op_ListAccessKeys.go @@ -4,6 +4,7 @@ package iam import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iam/types" @@ -141,6 +142,87 @@ func addOperationListAccessKeysMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAccessKeysPaginator returns a new ListAccessKeysPaginator +func NewListAccessKeysPaginator(client ListAccessKeysAPIClient, params *ListAccessKeysInput, optFns ...func(*ListAccessKeysPaginatorOptions)) *ListAccessKeysPaginator { + options := ListAccessKeysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAccessKeysInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAccessKeys(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_ListAccountAliases.go b/service/iam/api_op_ListAccountAliases.go index f4f935175e8..3a139aaf613 100644 --- a/service/iam/api_op_ListAccountAliases.go +++ b/service/iam/api_op_ListAccountAliases.go @@ -4,6 +4,7 @@ package iam import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -130,6 +131,88 @@ func addOperationListAccountAliasesMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAccountAliasesPaginator returns a new ListAccountAliasesPaginator +func NewListAccountAliasesPaginator(client ListAccountAliasesAPIClient, params *ListAccountAliasesInput, optFns ...func(*ListAccountAliasesPaginatorOptions)) *ListAccountAliasesPaginator { + options := ListAccountAliasesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAccountAliasesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAccountAliases(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_ListAttachedGroupPolicies.go b/service/iam/api_op_ListAttachedGroupPolicies.go index e97b963b611..3894cbde256 100644 --- a/service/iam/api_op_ListAttachedGroupPolicies.go +++ b/service/iam/api_op_ListAttachedGroupPolicies.go @@ -4,6 +4,7 @@ package iam import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iam/types" @@ -154,6 +155,89 @@ func addOperationListAttachedGroupPoliciesMiddlewares(stack *middleware.Stack, o return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAttachedGroupPoliciesPaginator returns a new +// ListAttachedGroupPoliciesPaginator +func NewListAttachedGroupPoliciesPaginator(client ListAttachedGroupPoliciesAPIClient, params *ListAttachedGroupPoliciesInput, optFns ...func(*ListAttachedGroupPoliciesPaginatorOptions)) *ListAttachedGroupPoliciesPaginator { + options := ListAttachedGroupPoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAttachedGroupPoliciesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAttachedGroupPolicies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_ListAttachedRolePolicies.go b/service/iam/api_op_ListAttachedRolePolicies.go index 47aa92b417e..5465c9629e0 100644 --- a/service/iam/api_op_ListAttachedRolePolicies.go +++ b/service/iam/api_op_ListAttachedRolePolicies.go @@ -4,6 +4,7 @@ package iam import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iam/types" @@ -154,6 +155,89 @@ func addOperationListAttachedRolePoliciesMiddlewares(stack *middleware.Stack, op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAttachedRolePoliciesPaginator returns a new +// ListAttachedRolePoliciesPaginator +func NewListAttachedRolePoliciesPaginator(client ListAttachedRolePoliciesAPIClient, params *ListAttachedRolePoliciesInput, optFns ...func(*ListAttachedRolePoliciesPaginatorOptions)) *ListAttachedRolePoliciesPaginator { + options := ListAttachedRolePoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAttachedRolePoliciesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAttachedRolePolicies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_ListAttachedUserPolicies.go b/service/iam/api_op_ListAttachedUserPolicies.go index 22bbc41c9d1..f27df1b80e9 100644 --- a/service/iam/api_op_ListAttachedUserPolicies.go +++ b/service/iam/api_op_ListAttachedUserPolicies.go @@ -4,6 +4,7 @@ package iam import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iam/types" @@ -154,6 +155,89 @@ func addOperationListAttachedUserPoliciesMiddlewares(stack *middleware.Stack, op return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAttachedUserPoliciesPaginator returns a new +// ListAttachedUserPoliciesPaginator +func NewListAttachedUserPoliciesPaginator(client ListAttachedUserPoliciesAPIClient, params *ListAttachedUserPoliciesInput, optFns ...func(*ListAttachedUserPoliciesPaginatorOptions)) *ListAttachedUserPoliciesPaginator { + options := ListAttachedUserPoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAttachedUserPoliciesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAttachedUserPolicies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_ListEntitiesForPolicy.go b/service/iam/api_op_ListEntitiesForPolicy.go index db54d190a27..9bf35467f73 100644 --- a/service/iam/api_op_ListEntitiesForPolicy.go +++ b/service/iam/api_op_ListEntitiesForPolicy.go @@ -4,6 +4,7 @@ package iam import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iam/types" @@ -170,6 +171,88 @@ func addOperationListEntitiesForPolicyMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListEntitiesForPolicyPaginator returns a new ListEntitiesForPolicyPaginator +func NewListEntitiesForPolicyPaginator(client ListEntitiesForPolicyAPIClient, params *ListEntitiesForPolicyInput, optFns ...func(*ListEntitiesForPolicyPaginatorOptions)) *ListEntitiesForPolicyPaginator { + options := ListEntitiesForPolicyPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListEntitiesForPolicyInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListEntitiesForPolicy(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_ListGroupPolicies.go b/service/iam/api_op_ListGroupPolicies.go index 0541a3a2d18..f69748df80b 100644 --- a/service/iam/api_op_ListGroupPolicies.go +++ b/service/iam/api_op_ListGroupPolicies.go @@ -4,6 +4,7 @@ package iam import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -146,6 +147,87 @@ func addOperationListGroupPoliciesMiddlewares(stack *middleware.Stack, options O return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListGroupPoliciesPaginator returns a new ListGroupPoliciesPaginator +func NewListGroupPoliciesPaginator(client ListGroupPoliciesAPIClient, params *ListGroupPoliciesInput, optFns ...func(*ListGroupPoliciesPaginatorOptions)) *ListGroupPoliciesPaginator { + options := ListGroupPoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListGroupPoliciesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListGroupPolicies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_ListGroups.go b/service/iam/api_op_ListGroups.go index 76c8540b34b..97a1ad9b539 100644 --- a/service/iam/api_op_ListGroups.go +++ b/service/iam/api_op_ListGroups.go @@ -4,6 +4,7 @@ package iam import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iam/types" @@ -138,6 +139,86 @@ func addOperationListGroupsMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListGroupsPaginator returns a new ListGroupsPaginator +func NewListGroupsPaginator(client ListGroupsAPIClient, params *ListGroupsInput, optFns ...func(*ListGroupsPaginatorOptions)) *ListGroupsPaginator { + options := ListGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_ListGroupsForUser.go b/service/iam/api_op_ListGroupsForUser.go index c79ab9c88c1..5a661ceedb6 100644 --- a/service/iam/api_op_ListGroupsForUser.go +++ b/service/iam/api_op_ListGroupsForUser.go @@ -4,6 +4,7 @@ package iam import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iam/types" @@ -138,6 +139,87 @@ func addOperationListGroupsForUserMiddlewares(stack *middleware.Stack, options O return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListGroupsForUserPaginator returns a new ListGroupsForUserPaginator +func NewListGroupsForUserPaginator(client ListGroupsForUserAPIClient, params *ListGroupsForUserInput, optFns ...func(*ListGroupsForUserPaginatorOptions)) *ListGroupsForUserPaginator { + options := ListGroupsForUserPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListGroupsForUserInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListGroupsForUser(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_ListInstanceProfiles.go b/service/iam/api_op_ListInstanceProfiles.go index 6b6aae75789..fde9325911c 100644 --- a/service/iam/api_op_ListInstanceProfiles.go +++ b/service/iam/api_op_ListInstanceProfiles.go @@ -4,6 +4,7 @@ package iam import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iam/types" @@ -141,6 +142,88 @@ func addOperationListInstanceProfilesMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListInstanceProfilesPaginator returns a new ListInstanceProfilesPaginator +func NewListInstanceProfilesPaginator(client ListInstanceProfilesAPIClient, params *ListInstanceProfilesInput, optFns ...func(*ListInstanceProfilesPaginatorOptions)) *ListInstanceProfilesPaginator { + options := ListInstanceProfilesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListInstanceProfilesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListInstanceProfiles(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_ListInstanceProfilesForRole.go b/service/iam/api_op_ListInstanceProfilesForRole.go index 0326299586b..35abb86f1b6 100644 --- a/service/iam/api_op_ListInstanceProfilesForRole.go +++ b/service/iam/api_op_ListInstanceProfilesForRole.go @@ -4,6 +4,7 @@ package iam import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iam/types" @@ -141,6 +142,89 @@ func addOperationListInstanceProfilesForRoleMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListInstanceProfilesForRolePaginator returns a new +// ListInstanceProfilesForRolePaginator +func NewListInstanceProfilesForRolePaginator(client ListInstanceProfilesForRoleAPIClient, params *ListInstanceProfilesForRoleInput, optFns ...func(*ListInstanceProfilesForRolePaginatorOptions)) *ListInstanceProfilesForRolePaginator { + options := ListInstanceProfilesForRolePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListInstanceProfilesForRoleInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListInstanceProfilesForRole(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_ListMFADevices.go b/service/iam/api_op_ListMFADevices.go index 0816077e6a4..4cf0156001f 100644 --- a/service/iam/api_op_ListMFADevices.go +++ b/service/iam/api_op_ListMFADevices.go @@ -4,6 +4,7 @@ package iam import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iam/types" @@ -136,6 +137,87 @@ func addOperationListMFADevicesMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListMFADevicesPaginator returns a new ListMFADevicesPaginator +func NewListMFADevicesPaginator(client ListMFADevicesAPIClient, params *ListMFADevicesInput, optFns ...func(*ListMFADevicesPaginatorOptions)) *ListMFADevicesPaginator { + options := ListMFADevicesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListMFADevicesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListMFADevices(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_ListPolicies.go b/service/iam/api_op_ListPolicies.go index 3bf726b7207..0aab3a7625b 100644 --- a/service/iam/api_op_ListPolicies.go +++ b/service/iam/api_op_ListPolicies.go @@ -4,6 +4,7 @@ package iam import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iam/types" @@ -161,6 +162,86 @@ func addOperationListPoliciesMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListPoliciesPaginator returns a new ListPoliciesPaginator +func NewListPoliciesPaginator(client ListPoliciesAPIClient, params *ListPoliciesInput, optFns ...func(*ListPoliciesPaginatorOptions)) *ListPoliciesPaginator { + options := ListPoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPoliciesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPolicies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_ListPolicyVersions.go b/service/iam/api_op_ListPolicyVersions.go index f8f3da06300..ebee2999bff 100644 --- a/service/iam/api_op_ListPolicyVersions.go +++ b/service/iam/api_op_ListPolicyVersions.go @@ -4,6 +4,7 @@ package iam import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iam/types" @@ -143,6 +144,88 @@ func addOperationListPolicyVersionsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListPolicyVersionsPaginator returns a new ListPolicyVersionsPaginator +func NewListPolicyVersionsPaginator(client ListPolicyVersionsAPIClient, params *ListPolicyVersionsInput, optFns ...func(*ListPolicyVersionsPaginatorOptions)) *ListPolicyVersionsPaginator { + options := ListPolicyVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPolicyVersionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPolicyVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_ListRolePolicies.go b/service/iam/api_op_ListRolePolicies.go index 5d2eed96f94..5ec4ac261d9 100644 --- a/service/iam/api_op_ListRolePolicies.go +++ b/service/iam/api_op_ListRolePolicies.go @@ -4,6 +4,7 @@ package iam import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -143,6 +144,87 @@ func addOperationListRolePoliciesMiddlewares(stack *middleware.Stack, options Op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListRolePoliciesPaginator returns a new ListRolePoliciesPaginator +func NewListRolePoliciesPaginator(client ListRolePoliciesAPIClient, params *ListRolePoliciesInput, optFns ...func(*ListRolePoliciesPaginatorOptions)) *ListRolePoliciesPaginator { + options := ListRolePoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRolePoliciesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRolePolicies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_ListRoles.go b/service/iam/api_op_ListRoles.go index b4060295f70..0102afa1f72 100644 --- a/service/iam/api_op_ListRoles.go +++ b/service/iam/api_op_ListRoles.go @@ -4,6 +4,7 @@ package iam import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iam/types" @@ -141,6 +142,86 @@ func addOperationListRolesMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListRolesPaginator returns a new ListRolesPaginator +func NewListRolesPaginator(client ListRolesAPIClient, params *ListRolesInput, optFns ...func(*ListRolesPaginatorOptions)) *ListRolesPaginator { + options := ListRolesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRolesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRoles(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_ListSSHPublicKeys.go b/service/iam/api_op_ListSSHPublicKeys.go index 73335e4f280..b22e60641ee 100644 --- a/service/iam/api_op_ListSSHPublicKeys.go +++ b/service/iam/api_op_ListSSHPublicKeys.go @@ -4,6 +4,7 @@ package iam import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iam/types" @@ -141,6 +142,87 @@ func addOperationListSSHPublicKeysMiddlewares(stack *middleware.Stack, options O return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListSSHPublicKeysPaginator returns a new ListSSHPublicKeysPaginator +func NewListSSHPublicKeysPaginator(client ListSSHPublicKeysAPIClient, params *ListSSHPublicKeysInput, optFns ...func(*ListSSHPublicKeysPaginatorOptions)) *ListSSHPublicKeysPaginator { + options := ListSSHPublicKeysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSSHPublicKeysInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSSHPublicKeys(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_ListServerCertificates.go b/service/iam/api_op_ListServerCertificates.go index d1fb48b2964..0acc99789f5 100644 --- a/service/iam/api_op_ListServerCertificates.go +++ b/service/iam/api_op_ListServerCertificates.go @@ -4,6 +4,7 @@ package iam import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iam/types" @@ -143,6 +144,88 @@ func addOperationListServerCertificatesMiddlewares(stack *middleware.Stack, opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListServerCertificatesPaginator returns a new ListServerCertificatesPaginator +func NewListServerCertificatesPaginator(client ListServerCertificatesAPIClient, params *ListServerCertificatesInput, optFns ...func(*ListServerCertificatesPaginatorOptions)) *ListServerCertificatesPaginator { + options := ListServerCertificatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListServerCertificatesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListServerCertificates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_ListSigningCertificates.go b/service/iam/api_op_ListSigningCertificates.go index dd2cb0fa022..880327f9476 100644 --- a/service/iam/api_op_ListSigningCertificates.go +++ b/service/iam/api_op_ListSigningCertificates.go @@ -4,6 +4,7 @@ package iam import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iam/types" @@ -140,6 +141,89 @@ func addOperationListSigningCertificatesMiddlewares(stack *middleware.Stack, opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListSigningCertificatesPaginator returns a new +// ListSigningCertificatesPaginator +func NewListSigningCertificatesPaginator(client ListSigningCertificatesAPIClient, params *ListSigningCertificatesInput, optFns ...func(*ListSigningCertificatesPaginatorOptions)) *ListSigningCertificatesPaginator { + options := ListSigningCertificatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSigningCertificatesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSigningCertificates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_ListUserPolicies.go b/service/iam/api_op_ListUserPolicies.go index 5b3958b5bea..dcd9bd962a7 100644 --- a/service/iam/api_op_ListUserPolicies.go +++ b/service/iam/api_op_ListUserPolicies.go @@ -4,6 +4,7 @@ package iam import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -143,6 +144,87 @@ func addOperationListUserPoliciesMiddlewares(stack *middleware.Stack, options Op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListUserPoliciesPaginator returns a new ListUserPoliciesPaginator +func NewListUserPoliciesPaginator(client ListUserPoliciesAPIClient, params *ListUserPoliciesInput, optFns ...func(*ListUserPoliciesPaginatorOptions)) *ListUserPoliciesPaginator { + options := ListUserPoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListUserPoliciesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListUserPolicies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_ListUsers.go b/service/iam/api_op_ListUsers.go index 5be1fb1100d..86080a398c2 100644 --- a/service/iam/api_op_ListUsers.go +++ b/service/iam/api_op_ListUsers.go @@ -4,6 +4,7 @@ package iam import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iam/types" @@ -140,6 +141,86 @@ func addOperationListUsersMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListUsersPaginator returns a new ListUsersPaginator +func NewListUsersPaginator(client ListUsersAPIClient, params *ListUsersInput, optFns ...func(*ListUsersPaginatorOptions)) *ListUsersPaginator { + options := ListUsersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListUsersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListUsers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_ListVirtualMFADevices.go b/service/iam/api_op_ListVirtualMFADevices.go index 7c91accfbfb..a1fbd12fd92 100644 --- a/service/iam/api_op_ListVirtualMFADevices.go +++ b/service/iam/api_op_ListVirtualMFADevices.go @@ -4,6 +4,7 @@ package iam import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iam/types" @@ -135,6 +136,88 @@ func addOperationListVirtualMFADevicesMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListVirtualMFADevicesPaginator returns a new ListVirtualMFADevicesPaginator +func NewListVirtualMFADevicesPaginator(client ListVirtualMFADevicesAPIClient, params *ListVirtualMFADevicesInput, optFns ...func(*ListVirtualMFADevicesPaginatorOptions)) *ListVirtualMFADevicesPaginator { + options := ListVirtualMFADevicesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListVirtualMFADevicesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListVirtualMFADevices(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_SimulateCustomPolicy.go b/service/iam/api_op_SimulateCustomPolicy.go index 43fcf748886..eefbc099254 100644 --- a/service/iam/api_op_SimulateCustomPolicy.go +++ b/service/iam/api_op_SimulateCustomPolicy.go @@ -4,6 +4,7 @@ package iam import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iam/types" @@ -289,6 +290,88 @@ func addOperationSimulateCustomPolicyMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewSimulateCustomPolicyPaginator returns a new SimulateCustomPolicyPaginator +func NewSimulateCustomPolicyPaginator(client SimulateCustomPolicyAPIClient, params *SimulateCustomPolicyInput, optFns ...func(*SimulateCustomPolicyPaginatorOptions)) *SimulateCustomPolicyPaginator { + options := SimulateCustomPolicyPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SimulateCustomPolicyInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSimulateCustomPolicy(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_SimulatePrincipalPolicy.go b/service/iam/api_op_SimulatePrincipalPolicy.go index b9ddca889c9..9ef84e90943 100644 --- a/service/iam/api_op_SimulatePrincipalPolicy.go +++ b/service/iam/api_op_SimulatePrincipalPolicy.go @@ -4,6 +4,7 @@ package iam import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iam/types" @@ -306,6 +307,89 @@ func addOperationSimulatePrincipalPolicyMiddlewares(stack *middleware.Stack, opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewSimulatePrincipalPolicyPaginator returns a new +// SimulatePrincipalPolicyPaginator +func NewSimulatePrincipalPolicyPaginator(client SimulatePrincipalPolicyAPIClient, params *SimulatePrincipalPolicyInput, optFns ...func(*SimulatePrincipalPolicyPaginatorOptions)) *SimulatePrincipalPolicyPaginator { + options := SimulatePrincipalPolicyPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SimulatePrincipalPolicyInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSimulatePrincipalPolicy(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/go.mod b/service/iam/go.mod index 7678467429c..ecc0ec95b65 100644 --- a/service/iam/go.mod +++ b/service/iam/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/iam/go.sum b/service/iam/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/iam/go.sum +++ b/service/iam/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 6e3e71dd370..00000000000 --- a/service/iam/paginators.go +++ /dev/null @@ -1,2130 +0,0 @@ -// 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/api_op_ListGroups.go b/service/identitystore/api_op_ListGroups.go index 0d0370e47a0..671013ccd14 100644 --- a/service/identitystore/api_op_ListGroups.go +++ b/service/identitystore/api_op_ListGroups.go @@ -4,6 +4,7 @@ package identitystore import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/identitystore/types" @@ -132,6 +133,82 @@ func addOperationListGroupsMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListGroupsPaginator returns a new ListGroupsPaginator +func NewListGroupsPaginator(client ListGroupsAPIClient, params *ListGroupsInput, optFns ...func(*ListGroupsPaginatorOptions)) *ListGroupsPaginator { + options := ListGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/identitystore/api_op_ListUsers.go b/service/identitystore/api_op_ListUsers.go index 3864679e1fd..7b9df136f89 100644 --- a/service/identitystore/api_op_ListUsers.go +++ b/service/identitystore/api_op_ListUsers.go @@ -4,6 +4,7 @@ package identitystore import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/identitystore/types" @@ -132,6 +133,82 @@ func addOperationListUsersMiddlewares(stack *middleware.Stack, options Options) return 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 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListUsersPaginator returns a new ListUsersPaginator +func NewListUsersPaginator(client ListUsersAPIClient, params *ListUsersInput, optFns ...func(*ListUsersPaginatorOptions)) *ListUsersPaginator { + options := ListUsersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListUsersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListUsers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/identitystore/go.mod b/service/identitystore/go.mod index 8abc9812db4..9603bc4970f 100644 --- a/service/identitystore/go.mod +++ b/service/identitystore/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/identitystore/go.sum b/service/identitystore/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/identitystore/go.sum +++ b/service/identitystore/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 2c3febe4300..00000000000 --- a/service/identitystore/paginators.go +++ /dev/null @@ -1,160 +0,0 @@ -// 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/api_op_ListComponentBuildVersions.go b/service/imagebuilder/api_op_ListComponentBuildVersions.go index 34509dd6c7b..5cea155cdc8 100644 --- a/service/imagebuilder/api_op_ListComponentBuildVersions.go +++ b/service/imagebuilder/api_op_ListComponentBuildVersions.go @@ -4,6 +4,7 @@ package imagebuilder import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/imagebuilder/types" @@ -120,6 +121,83 @@ func addOperationListComponentBuildVersionsMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListComponentBuildVersionsPaginator returns a new +// ListComponentBuildVersionsPaginator +func NewListComponentBuildVersionsPaginator(client ListComponentBuildVersionsAPIClient, params *ListComponentBuildVersionsInput, optFns ...func(*ListComponentBuildVersionsPaginatorOptions)) *ListComponentBuildVersionsPaginator { + options := ListComponentBuildVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListComponentBuildVersionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListComponentBuildVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/imagebuilder/api_op_ListComponents.go b/service/imagebuilder/api_op_ListComponents.go index 8bb9403c98e..e9a911e9ce4 100644 --- a/service/imagebuilder/api_op_ListComponents.go +++ b/service/imagebuilder/api_op_ListComponents.go @@ -4,6 +4,7 @@ package imagebuilder import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/imagebuilder/types" @@ -120,6 +121,81 @@ func addOperationListComponentsMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListComponentsPaginator returns a new ListComponentsPaginator +func NewListComponentsPaginator(client ListComponentsAPIClient, params *ListComponentsInput, optFns ...func(*ListComponentsPaginatorOptions)) *ListComponentsPaginator { + options := ListComponentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListComponentsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListComponents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/imagebuilder/api_op_ListDistributionConfigurations.go b/service/imagebuilder/api_op_ListDistributionConfigurations.go index 4a25581aff8..9615acd5791 100644 --- a/service/imagebuilder/api_op_ListDistributionConfigurations.go +++ b/service/imagebuilder/api_op_ListDistributionConfigurations.go @@ -4,6 +4,7 @@ package imagebuilder import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/imagebuilder/types" @@ -116,6 +117,83 @@ func addOperationListDistributionConfigurationsMiddlewares(stack *middleware.Sta return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDistributionConfigurationsPaginator returns a new +// ListDistributionConfigurationsPaginator +func NewListDistributionConfigurationsPaginator(client ListDistributionConfigurationsAPIClient, params *ListDistributionConfigurationsInput, optFns ...func(*ListDistributionConfigurationsPaginatorOptions)) *ListDistributionConfigurationsPaginator { + options := ListDistributionConfigurationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDistributionConfigurationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDistributionConfigurations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/imagebuilder/api_op_ListImageBuildVersions.go b/service/imagebuilder/api_op_ListImageBuildVersions.go index f57485555c8..afccb31668b 100644 --- a/service/imagebuilder/api_op_ListImageBuildVersions.go +++ b/service/imagebuilder/api_op_ListImageBuildVersions.go @@ -4,6 +4,7 @@ package imagebuilder import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/imagebuilder/types" @@ -123,6 +124,82 @@ func addOperationListImageBuildVersionsMiddlewares(stack *middleware.Stack, opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListImageBuildVersionsPaginator returns a new ListImageBuildVersionsPaginator +func NewListImageBuildVersionsPaginator(client ListImageBuildVersionsAPIClient, params *ListImageBuildVersionsInput, optFns ...func(*ListImageBuildVersionsPaginatorOptions)) *ListImageBuildVersionsPaginator { + options := ListImageBuildVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListImageBuildVersionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListImageBuildVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/imagebuilder/api_op_ListImagePipelineImages.go b/service/imagebuilder/api_op_ListImagePipelineImages.go index 7e2db166053..d9c17917e99 100644 --- a/service/imagebuilder/api_op_ListImagePipelineImages.go +++ b/service/imagebuilder/api_op_ListImagePipelineImages.go @@ -4,6 +4,7 @@ package imagebuilder import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/imagebuilder/types" @@ -123,6 +124,83 @@ func addOperationListImagePipelineImagesMiddlewares(stack *middleware.Stack, opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListImagePipelineImagesPaginator returns a new +// ListImagePipelineImagesPaginator +func NewListImagePipelineImagesPaginator(client ListImagePipelineImagesAPIClient, params *ListImagePipelineImagesInput, optFns ...func(*ListImagePipelineImagesPaginatorOptions)) *ListImagePipelineImagesPaginator { + options := ListImagePipelineImagesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListImagePipelineImagesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListImagePipelineImages(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/imagebuilder/api_op_ListImagePipelines.go b/service/imagebuilder/api_op_ListImagePipelines.go index 7b2a2cbc1b0..b1860b94af7 100644 --- a/service/imagebuilder/api_op_ListImagePipelines.go +++ b/service/imagebuilder/api_op_ListImagePipelines.go @@ -4,6 +4,7 @@ package imagebuilder import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/imagebuilder/types" @@ -114,6 +115,82 @@ func addOperationListImagePipelinesMiddlewares(stack *middleware.Stack, options return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListImagePipelinesPaginator returns a new ListImagePipelinesPaginator +func NewListImagePipelinesPaginator(client ListImagePipelinesAPIClient, params *ListImagePipelinesInput, optFns ...func(*ListImagePipelinesPaginatorOptions)) *ListImagePipelinesPaginator { + options := ListImagePipelinesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListImagePipelinesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListImagePipelines(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/imagebuilder/api_op_ListImageRecipes.go b/service/imagebuilder/api_op_ListImageRecipes.go index 8b75a783714..ce05eb2a28f 100644 --- a/service/imagebuilder/api_op_ListImageRecipes.go +++ b/service/imagebuilder/api_op_ListImageRecipes.go @@ -4,6 +4,7 @@ package imagebuilder import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/imagebuilder/types" @@ -120,6 +121,81 @@ func addOperationListImageRecipesMiddlewares(stack *middleware.Stack, options Op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListImageRecipesPaginator returns a new ListImageRecipesPaginator +func NewListImageRecipesPaginator(client ListImageRecipesAPIClient, params *ListImageRecipesInput, optFns ...func(*ListImageRecipesPaginatorOptions)) *ListImageRecipesPaginator { + options := ListImageRecipesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListImageRecipesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListImageRecipes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/imagebuilder/api_op_ListImages.go b/service/imagebuilder/api_op_ListImages.go index d5f05e7f136..1276722dbdf 100644 --- a/service/imagebuilder/api_op_ListImages.go +++ b/service/imagebuilder/api_op_ListImages.go @@ -4,6 +4,7 @@ package imagebuilder import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/imagebuilder/types" @@ -120,6 +121,80 @@ func addOperationListImagesMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListImagesPaginator returns a new ListImagesPaginator +func NewListImagesPaginator(client ListImagesAPIClient, params *ListImagesInput, optFns ...func(*ListImagesPaginatorOptions)) *ListImagesPaginator { + options := ListImagesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListImagesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListImages(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/imagebuilder/api_op_ListInfrastructureConfigurations.go b/service/imagebuilder/api_op_ListInfrastructureConfigurations.go index 318ebeb1e3a..fc277dcdef9 100644 --- a/service/imagebuilder/api_op_ListInfrastructureConfigurations.go +++ b/service/imagebuilder/api_op_ListInfrastructureConfigurations.go @@ -4,6 +4,7 @@ package imagebuilder import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/imagebuilder/types" @@ -114,6 +115,83 @@ func addOperationListInfrastructureConfigurationsMiddlewares(stack *middleware.S return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListInfrastructureConfigurationsPaginator returns a new +// ListInfrastructureConfigurationsPaginator +func NewListInfrastructureConfigurationsPaginator(client ListInfrastructureConfigurationsAPIClient, params *ListInfrastructureConfigurationsInput, optFns ...func(*ListInfrastructureConfigurationsPaginatorOptions)) *ListInfrastructureConfigurationsPaginator { + options := ListInfrastructureConfigurationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListInfrastructureConfigurationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListInfrastructureConfigurations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/imagebuilder/go.mod b/service/imagebuilder/go.mod index 11edbb99e74..d7c63f67792 100644 --- a/service/imagebuilder/go.mod +++ b/service/imagebuilder/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/imagebuilder/go.sum b/service/imagebuilder/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/imagebuilder/go.sum +++ b/service/imagebuilder/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 2177b094fe2..00000000000 --- a/service/imagebuilder/paginators.go +++ /dev/null @@ -1,692 +0,0 @@ -// 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/api_op_GetExclusionsPreview.go b/service/inspector/api_op_GetExclusionsPreview.go index 6ccaf8a0537..949a9b82e2b 100644 --- a/service/inspector/api_op_GetExclusionsPreview.go +++ b/service/inspector/api_op_GetExclusionsPreview.go @@ -4,6 +4,7 @@ package inspector import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/inspector/types" @@ -137,6 +138,83 @@ func addOperationGetExclusionsPreviewMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetExclusionsPreviewPaginator returns a new GetExclusionsPreviewPaginator +func NewGetExclusionsPreviewPaginator(client GetExclusionsPreviewAPIClient, params *GetExclusionsPreviewInput, optFns ...func(*GetExclusionsPreviewPaginatorOptions)) *GetExclusionsPreviewPaginator { + options := GetExclusionsPreviewPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetExclusionsPreviewInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetExclusionsPreview(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/inspector/api_op_ListAssessmentRunAgents.go b/service/inspector/api_op_ListAssessmentRunAgents.go index 5f09e0c5c7f..6508ad9518e 100644 --- a/service/inspector/api_op_ListAssessmentRunAgents.go +++ b/service/inspector/api_op_ListAssessmentRunAgents.go @@ -4,6 +4,7 @@ package inspector import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/inspector/types" @@ -129,6 +130,84 @@ func addOperationListAssessmentRunAgentsMiddlewares(stack *middleware.Stack, opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAssessmentRunAgentsPaginator returns a new +// ListAssessmentRunAgentsPaginator +func NewListAssessmentRunAgentsPaginator(client ListAssessmentRunAgentsAPIClient, params *ListAssessmentRunAgentsInput, optFns ...func(*ListAssessmentRunAgentsPaginatorOptions)) *ListAssessmentRunAgentsPaginator { + options := ListAssessmentRunAgentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAssessmentRunAgentsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAssessmentRunAgents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/inspector/api_op_ListAssessmentRuns.go b/service/inspector/api_op_ListAssessmentRuns.go index bd3cb387104..239cffc9d56 100644 --- a/service/inspector/api_op_ListAssessmentRuns.go +++ b/service/inspector/api_op_ListAssessmentRuns.go @@ -4,6 +4,7 @@ package inspector import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/inspector/types" @@ -126,6 +127,83 @@ func addOperationListAssessmentRunsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAssessmentRunsPaginator returns a new ListAssessmentRunsPaginator +func NewListAssessmentRunsPaginator(client ListAssessmentRunsAPIClient, params *ListAssessmentRunsInput, optFns ...func(*ListAssessmentRunsPaginatorOptions)) *ListAssessmentRunsPaginator { + options := ListAssessmentRunsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAssessmentRunsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAssessmentRuns(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/inspector/api_op_ListAssessmentTargets.go b/service/inspector/api_op_ListAssessmentTargets.go index c77038026c9..46275a63b3a 100644 --- a/service/inspector/api_op_ListAssessmentTargets.go +++ b/service/inspector/api_op_ListAssessmentTargets.go @@ -4,6 +4,7 @@ package inspector import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/inspector/types" @@ -123,6 +124,83 @@ func addOperationListAssessmentTargetsMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAssessmentTargetsPaginator returns a new ListAssessmentTargetsPaginator +func NewListAssessmentTargetsPaginator(client ListAssessmentTargetsAPIClient, params *ListAssessmentTargetsInput, optFns ...func(*ListAssessmentTargetsPaginatorOptions)) *ListAssessmentTargetsPaginator { + options := ListAssessmentTargetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAssessmentTargetsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAssessmentTargets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/inspector/api_op_ListAssessmentTemplates.go b/service/inspector/api_op_ListAssessmentTemplates.go index 0d8071b8426..0c33b7d2bfd 100644 --- a/service/inspector/api_op_ListAssessmentTemplates.go +++ b/service/inspector/api_op_ListAssessmentTemplates.go @@ -4,6 +4,7 @@ package inspector import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/inspector/types" @@ -125,6 +126,84 @@ func addOperationListAssessmentTemplatesMiddlewares(stack *middleware.Stack, opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAssessmentTemplatesPaginator returns a new +// ListAssessmentTemplatesPaginator +func NewListAssessmentTemplatesPaginator(client ListAssessmentTemplatesAPIClient, params *ListAssessmentTemplatesInput, optFns ...func(*ListAssessmentTemplatesPaginatorOptions)) *ListAssessmentTemplatesPaginator { + options := ListAssessmentTemplatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAssessmentTemplatesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAssessmentTemplates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/inspector/api_op_ListEventSubscriptions.go b/service/inspector/api_op_ListEventSubscriptions.go index 6acc54aa431..a25b035f017 100644 --- a/service/inspector/api_op_ListEventSubscriptions.go +++ b/service/inspector/api_op_ListEventSubscriptions.go @@ -4,6 +4,7 @@ package inspector import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/inspector/types" @@ -120,6 +121,83 @@ func addOperationListEventSubscriptionsMiddlewares(stack *middleware.Stack, opti return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListEventSubscriptionsPaginator returns a new ListEventSubscriptionsPaginator +func NewListEventSubscriptionsPaginator(client ListEventSubscriptionsAPIClient, params *ListEventSubscriptionsInput, optFns ...func(*ListEventSubscriptionsPaginatorOptions)) *ListEventSubscriptionsPaginator { + options := ListEventSubscriptionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListEventSubscriptionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListEventSubscriptions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/inspector/api_op_ListExclusions.go b/service/inspector/api_op_ListExclusions.go index e23d82c4a0f..298721ad676 100644 --- a/service/inspector/api_op_ListExclusions.go +++ b/service/inspector/api_op_ListExclusions.go @@ -4,6 +4,7 @@ package inspector import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -122,6 +123,82 @@ func addOperationListExclusionsMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListExclusionsPaginator returns a new ListExclusionsPaginator +func NewListExclusionsPaginator(client ListExclusionsAPIClient, params *ListExclusionsInput, optFns ...func(*ListExclusionsPaginatorOptions)) *ListExclusionsPaginator { + options := ListExclusionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListExclusionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListExclusions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/inspector/api_op_ListFindings.go b/service/inspector/api_op_ListFindings.go index 1517b4eb1cb..251ce7cbd4b 100644 --- a/service/inspector/api_op_ListFindings.go +++ b/service/inspector/api_op_ListFindings.go @@ -4,6 +4,7 @@ package inspector import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/inspector/types" @@ -128,6 +129,81 @@ func addOperationListFindingsMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListFindingsPaginator returns a new ListFindingsPaginator +func NewListFindingsPaginator(client ListFindingsAPIClient, params *ListFindingsInput, optFns ...func(*ListFindingsPaginatorOptions)) *ListFindingsPaginator { + options := ListFindingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListFindingsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListFindings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/inspector/api_op_ListRulesPackages.go b/service/inspector/api_op_ListRulesPackages.go index 36d09934dd5..5b43f12b678 100644 --- a/service/inspector/api_op_ListRulesPackages.go +++ b/service/inspector/api_op_ListRulesPackages.go @@ -4,6 +4,7 @@ package inspector import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -113,6 +114,82 @@ func addOperationListRulesPackagesMiddlewares(stack *middleware.Stack, options O return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListRulesPackagesPaginator returns a new ListRulesPackagesPaginator +func NewListRulesPackagesPaginator(client ListRulesPackagesAPIClient, params *ListRulesPackagesInput, optFns ...func(*ListRulesPackagesPaginatorOptions)) *ListRulesPackagesPaginator { + options := ListRulesPackagesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRulesPackagesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRulesPackages(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/inspector/api_op_PreviewAgents.go b/service/inspector/api_op_PreviewAgents.go index 9b40c1b0b90..9486925b1fb 100644 --- a/service/inspector/api_op_PreviewAgents.go +++ b/service/inspector/api_op_PreviewAgents.go @@ -4,6 +4,7 @@ package inspector import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/inspector/types" @@ -123,6 +124,81 @@ func addOperationPreviewAgentsMiddlewares(stack *middleware.Stack, options Optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewPreviewAgentsPaginator returns a new PreviewAgentsPaginator +func NewPreviewAgentsPaginator(client PreviewAgentsAPIClient, params *PreviewAgentsInput, optFns ...func(*PreviewAgentsPaginatorOptions)) *PreviewAgentsPaginator { + options := PreviewAgentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &PreviewAgentsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opPreviewAgents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/inspector/go.mod b/service/inspector/go.mod index 2a44cb92b18..aecbda270fb 100644 --- a/service/inspector/go.mod +++ b/service/inspector/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/inspector/go.sum b/service/inspector/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/inspector/go.sum +++ b/service/inspector/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 294bf41fc47..00000000000 --- a/service/inspector/paginators.go +++ /dev/null @@ -1,774 +0,0 @@ -// 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/benchmark/go.mod b/service/internal/benchmark/go.mod index f1c4ad6bb20..db4f3fd7fea 100644 --- a/service/internal/benchmark/go.mod +++ b/service/internal/benchmark/go.mod @@ -7,7 +7,7 @@ require ( github.com/aws/aws-sdk-go-v2 v0.29.0 github.com/aws/aws-sdk-go-v2/service/dynamodb v0.29.0 github.com/aws/aws-sdk-go-v2/service/lexruntimeservice v0.29.0 - github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../../ diff --git a/service/internal/benchmark/go.sum b/service/internal/benchmark/go.sum index 9fe0b721617..0a9d6ef2b31 100644 --- a/service/internal/benchmark/go.sum +++ b/service/internal/benchmark/go.sum @@ -3,6 +3,8 @@ github.com/aws/aws-sdk-go v1.34.33/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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.mod b/service/internal/integrationtest/go.mod index 6f88785d562..c382d7e9392 100644 --- a/service/internal/integrationtest/go.mod +++ b/service/internal/integrationtest/go.mod @@ -85,7 +85,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/wafregional v0.29.0 github.com/aws/aws-sdk-go-v2/service/wafv2 v0.29.0 github.com/aws/aws-sdk-go-v2/service/workspaces v0.29.0 - github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) go 1.15 diff --git a/service/internal/integrationtest/go.sum b/service/internal/integrationtest/go.sum index 15f421e87a4..4dfebebf331 100644 --- a/service/internal/integrationtest/go.sum +++ b/service/internal/integrationtest/go.sum @@ -1,6 +1,8 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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/api_op_ListActiveViolations.go b/service/iot/api_op_ListActiveViolations.go index c272d1770da..18486ee4959 100644 --- a/service/iot/api_op_ListActiveViolations.go +++ b/service/iot/api_op_ListActiveViolations.go @@ -4,6 +4,7 @@ package iot import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iot/types" @@ -113,6 +114,82 @@ func addOperationListActiveViolationsMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListActiveViolationsPaginator returns a new ListActiveViolationsPaginator +func NewListActiveViolationsPaginator(client ListActiveViolationsAPIClient, params *ListActiveViolationsInput, optFns ...func(*ListActiveViolationsPaginatorOptions)) *ListActiveViolationsPaginator { + options := ListActiveViolationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListActiveViolationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListActiveViolations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListAttachedPolicies.go b/service/iot/api_op_ListAttachedPolicies.go index 1c3853d7f6b..9ccda02701b 100644 --- a/service/iot/api_op_ListAttachedPolicies.go +++ b/service/iot/api_op_ListAttachedPolicies.go @@ -4,6 +4,7 @@ package iot import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iot/types" @@ -120,6 +121,82 @@ func addOperationListAttachedPoliciesMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAttachedPoliciesPaginator returns a new ListAttachedPoliciesPaginator +func NewListAttachedPoliciesPaginator(client ListAttachedPoliciesAPIClient, params *ListAttachedPoliciesInput, optFns ...func(*ListAttachedPoliciesPaginatorOptions)) *ListAttachedPoliciesPaginator { + options := ListAttachedPoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAttachedPoliciesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAttachedPolicies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListAuditFindings.go b/service/iot/api_op_ListAuditFindings.go index 5bac85f59bc..b8e5c292f6e 100644 --- a/service/iot/api_op_ListAuditFindings.go +++ b/service/iot/api_op_ListAuditFindings.go @@ -4,6 +4,7 @@ package iot import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iot/types" @@ -131,6 +132,81 @@ func addOperationListAuditFindingsMiddlewares(stack *middleware.Stack, options O return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAuditFindingsPaginator returns a new ListAuditFindingsPaginator +func NewListAuditFindingsPaginator(client ListAuditFindingsAPIClient, params *ListAuditFindingsInput, optFns ...func(*ListAuditFindingsPaginatorOptions)) *ListAuditFindingsPaginator { + options := ListAuditFindingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAuditFindingsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAuditFindings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListAuditMitigationActionsExecutions.go b/service/iot/api_op_ListAuditMitigationActionsExecutions.go index 71e0950b185..4e52666a128 100644 --- a/service/iot/api_op_ListAuditMitigationActionsExecutions.go +++ b/service/iot/api_op_ListAuditMitigationActionsExecutions.go @@ -4,6 +4,7 @@ package iot import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iot/types" @@ -124,6 +125,83 @@ func addOperationListAuditMitigationActionsExecutionsMiddlewares(stack *middlewa return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAuditMitigationActionsExecutionsPaginator returns a new +// ListAuditMitigationActionsExecutionsPaginator +func NewListAuditMitigationActionsExecutionsPaginator(client ListAuditMitigationActionsExecutionsAPIClient, params *ListAuditMitigationActionsExecutionsInput, optFns ...func(*ListAuditMitigationActionsExecutionsPaginatorOptions)) *ListAuditMitigationActionsExecutionsPaginator { + options := ListAuditMitigationActionsExecutionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAuditMitigationActionsExecutionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAuditMitigationActionsExecutions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListAuditMitigationActionsTasks.go b/service/iot/api_op_ListAuditMitigationActionsTasks.go index 03eb9e9a406..22bb5050da2 100644 --- a/service/iot/api_op_ListAuditMitigationActionsTasks.go +++ b/service/iot/api_op_ListAuditMitigationActionsTasks.go @@ -4,6 +4,7 @@ package iot import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iot/types" @@ -132,6 +133,83 @@ func addOperationListAuditMitigationActionsTasksMiddlewares(stack *middleware.St return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAuditMitigationActionsTasksPaginator returns a new +// ListAuditMitigationActionsTasksPaginator +func NewListAuditMitigationActionsTasksPaginator(client ListAuditMitigationActionsTasksAPIClient, params *ListAuditMitigationActionsTasksInput, optFns ...func(*ListAuditMitigationActionsTasksPaginatorOptions)) *ListAuditMitigationActionsTasksPaginator { + options := ListAuditMitigationActionsTasksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAuditMitigationActionsTasksInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAuditMitigationActionsTasks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListAuditSuppressions.go b/service/iot/api_op_ListAuditSuppressions.go index a13b16aef8a..a2c2c48f4f9 100644 --- a/service/iot/api_op_ListAuditSuppressions.go +++ b/service/iot/api_op_ListAuditSuppressions.go @@ -4,6 +4,7 @@ package iot import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iot/types" @@ -119,6 +120,82 @@ func addOperationListAuditSuppressionsMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAuditSuppressionsPaginator returns a new ListAuditSuppressionsPaginator +func NewListAuditSuppressionsPaginator(client ListAuditSuppressionsAPIClient, params *ListAuditSuppressionsInput, optFns ...func(*ListAuditSuppressionsPaginatorOptions)) *ListAuditSuppressionsPaginator { + options := ListAuditSuppressionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAuditSuppressionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAuditSuppressions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListAuditTasks.go b/service/iot/api_op_ListAuditTasks.go index cf000f5813a..8d7fa49efee 100644 --- a/service/iot/api_op_ListAuditTasks.go +++ b/service/iot/api_op_ListAuditTasks.go @@ -4,6 +4,7 @@ package iot import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iot/types" @@ -131,6 +132,81 @@ func addOperationListAuditTasksMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAuditTasksPaginator returns a new ListAuditTasksPaginator +func NewListAuditTasksPaginator(client ListAuditTasksAPIClient, params *ListAuditTasksInput, optFns ...func(*ListAuditTasksPaginatorOptions)) *ListAuditTasksPaginator { + options := ListAuditTasksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAuditTasksInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAuditTasks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListAuthorizers.go b/service/iot/api_op_ListAuthorizers.go index 193e0ebdbcf..0711438db53 100644 --- a/service/iot/api_op_ListAuthorizers.go +++ b/service/iot/api_op_ListAuthorizers.go @@ -4,6 +4,7 @@ package iot import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iot/types" @@ -111,6 +112,81 @@ func addOperationListAuthorizersMiddlewares(stack *middleware.Stack, options Opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAuthorizersPaginator returns a new ListAuthorizersPaginator +func NewListAuthorizersPaginator(client ListAuthorizersAPIClient, params *ListAuthorizersInput, optFns ...func(*ListAuthorizersPaginatorOptions)) *ListAuthorizersPaginator { + options := ListAuthorizersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAuthorizersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAuthorizers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListBillingGroups.go b/service/iot/api_op_ListBillingGroups.go index 2448a7ee3ca..b36511eaf51 100644 --- a/service/iot/api_op_ListBillingGroups.go +++ b/service/iot/api_op_ListBillingGroups.go @@ -4,6 +4,7 @@ package iot import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iot/types" @@ -109,6 +110,81 @@ func addOperationListBillingGroupsMiddlewares(stack *middleware.Stack, options O return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListBillingGroupsPaginator returns a new ListBillingGroupsPaginator +func NewListBillingGroupsPaginator(client ListBillingGroupsAPIClient, params *ListBillingGroupsInput, optFns ...func(*ListBillingGroupsPaginatorOptions)) *ListBillingGroupsPaginator { + options := ListBillingGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListBillingGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListBillingGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListCACertificates.go b/service/iot/api_op_ListCACertificates.go index b2243c4f9fd..a87e1b2a2ea 100644 --- a/service/iot/api_op_ListCACertificates.go +++ b/service/iot/api_op_ListCACertificates.go @@ -4,6 +4,7 @@ package iot import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iot/types" @@ -112,6 +113,82 @@ func addOperationListCACertificatesMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListCACertificatesPaginator returns a new ListCACertificatesPaginator +func NewListCACertificatesPaginator(client ListCACertificatesAPIClient, params *ListCACertificatesInput, optFns ...func(*ListCACertificatesPaginatorOptions)) *ListCACertificatesPaginator { + options := ListCACertificatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListCACertificatesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListCACertificates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListCertificates.go b/service/iot/api_op_ListCertificates.go index 32535e000e2..22ee90eeadc 100644 --- a/service/iot/api_op_ListCertificates.go +++ b/service/iot/api_op_ListCertificates.go @@ -4,6 +4,7 @@ package iot import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iot/types" @@ -114,6 +115,81 @@ func addOperationListCertificatesMiddlewares(stack *middleware.Stack, options Op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListCertificatesPaginator returns a new ListCertificatesPaginator +func NewListCertificatesPaginator(client ListCertificatesAPIClient, params *ListCertificatesInput, optFns ...func(*ListCertificatesPaginatorOptions)) *ListCertificatesPaginator { + options := ListCertificatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListCertificatesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListCertificates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListCertificatesByCA.go b/service/iot/api_op_ListCertificatesByCA.go index 18a02f901e8..5c31a4b5405 100644 --- a/service/iot/api_op_ListCertificatesByCA.go +++ b/service/iot/api_op_ListCertificatesByCA.go @@ -4,6 +4,7 @@ package iot import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iot/types" @@ -121,6 +122,82 @@ func addOperationListCertificatesByCAMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListCertificatesByCAPaginator returns a new ListCertificatesByCAPaginator +func NewListCertificatesByCAPaginator(client ListCertificatesByCAAPIClient, params *ListCertificatesByCAInput, optFns ...func(*ListCertificatesByCAPaginatorOptions)) *ListCertificatesByCAPaginator { + options := ListCertificatesByCAPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListCertificatesByCAInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListCertificatesByCA(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListDimensions.go b/service/iot/api_op_ListDimensions.go index 4c0ecc50218..c206074f845 100644 --- a/service/iot/api_op_ListDimensions.go +++ b/service/iot/api_op_ListDimensions.go @@ -4,6 +4,7 @@ package iot import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -106,6 +107,81 @@ func addOperationListDimensionsMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDimensionsPaginator returns a new ListDimensionsPaginator +func NewListDimensionsPaginator(client ListDimensionsAPIClient, params *ListDimensionsInput, optFns ...func(*ListDimensionsPaginatorOptions)) *ListDimensionsPaginator { + options := ListDimensionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDimensionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDimensions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListDomainConfigurations.go b/service/iot/api_op_ListDomainConfigurations.go index 12a5fe14329..d999b9196ec 100644 --- a/service/iot/api_op_ListDomainConfigurations.go +++ b/service/iot/api_op_ListDomainConfigurations.go @@ -4,6 +4,7 @@ package iot import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iot/types" @@ -111,6 +112,83 @@ func addOperationListDomainConfigurationsMiddlewares(stack *middleware.Stack, op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDomainConfigurationsPaginator returns a new +// ListDomainConfigurationsPaginator +func NewListDomainConfigurationsPaginator(client ListDomainConfigurationsAPIClient, params *ListDomainConfigurationsInput, optFns ...func(*ListDomainConfigurationsPaginatorOptions)) *ListDomainConfigurationsPaginator { + options := ListDomainConfigurationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDomainConfigurationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDomainConfigurations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListIndices.go b/service/iot/api_op_ListIndices.go index bfe4077b1e3..1237bcaa365 100644 --- a/service/iot/api_op_ListIndices.go +++ b/service/iot/api_op_ListIndices.go @@ -4,6 +4,7 @@ package iot import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -106,6 +107,80 @@ func addOperationListIndicesMiddlewares(stack *middleware.Stack, options Options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListIndicesPaginator returns a new ListIndicesPaginator +func NewListIndicesPaginator(client ListIndicesAPIClient, params *ListIndicesInput, optFns ...func(*ListIndicesPaginatorOptions)) *ListIndicesPaginator { + options := ListIndicesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListIndicesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListIndices(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListJobExecutionsForJob.go b/service/iot/api_op_ListJobExecutionsForJob.go index cad6ca09c27..1efd32302df 100644 --- a/service/iot/api_op_ListJobExecutionsForJob.go +++ b/service/iot/api_op_ListJobExecutionsForJob.go @@ -4,6 +4,7 @@ package iot import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iot/types" @@ -117,6 +118,83 @@ func addOperationListJobExecutionsForJobMiddlewares(stack *middleware.Stack, opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListJobExecutionsForJobPaginator returns a new +// ListJobExecutionsForJobPaginator +func NewListJobExecutionsForJobPaginator(client ListJobExecutionsForJobAPIClient, params *ListJobExecutionsForJobInput, optFns ...func(*ListJobExecutionsForJobPaginatorOptions)) *ListJobExecutionsForJobPaginator { + options := ListJobExecutionsForJobPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListJobExecutionsForJobInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListJobExecutionsForJob(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListJobExecutionsForThing.go b/service/iot/api_op_ListJobExecutionsForThing.go index 6f722cb9014..bef6a71f8cc 100644 --- a/service/iot/api_op_ListJobExecutionsForThing.go +++ b/service/iot/api_op_ListJobExecutionsForThing.go @@ -4,6 +4,7 @@ package iot import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iot/types" @@ -124,6 +125,83 @@ func addOperationListJobExecutionsForThingMiddlewares(stack *middleware.Stack, o return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListJobExecutionsForThingPaginator returns a new +// ListJobExecutionsForThingPaginator +func NewListJobExecutionsForThingPaginator(client ListJobExecutionsForThingAPIClient, params *ListJobExecutionsForThingInput, optFns ...func(*ListJobExecutionsForThingPaginatorOptions)) *ListJobExecutionsForThingPaginator { + options := ListJobExecutionsForThingPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListJobExecutionsForThingInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListJobExecutionsForThing(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListJobs.go b/service/iot/api_op_ListJobs.go index df6dcadddb7..7501fe9599a 100644 --- a/service/iot/api_op_ListJobs.go +++ b/service/iot/api_op_ListJobs.go @@ -4,6 +4,7 @@ package iot import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iot/types" @@ -130,6 +131,80 @@ func addOperationListJobsMiddlewares(stack *middleware.Stack, options Options) ( return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListJobsPaginator returns a new ListJobsPaginator +func NewListJobsPaginator(client ListJobsAPIClient, params *ListJobsInput, optFns ...func(*ListJobsPaginatorOptions)) *ListJobsPaginator { + options := ListJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListJobsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListMitigationActions.go b/service/iot/api_op_ListMitigationActions.go index dd096dc8d23..5302f96bf2d 100644 --- a/service/iot/api_op_ListMitigationActions.go +++ b/service/iot/api_op_ListMitigationActions.go @@ -4,6 +4,7 @@ package iot import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iot/types" @@ -109,6 +110,82 @@ func addOperationListMitigationActionsMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListMitigationActionsPaginator returns a new ListMitigationActionsPaginator +func NewListMitigationActionsPaginator(client ListMitigationActionsAPIClient, params *ListMitigationActionsInput, optFns ...func(*ListMitigationActionsPaginatorOptions)) *ListMitigationActionsPaginator { + options := ListMitigationActionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListMitigationActionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListMitigationActions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListOTAUpdates.go b/service/iot/api_op_ListOTAUpdates.go index d79ec251b38..ec38d6d2df6 100644 --- a/service/iot/api_op_ListOTAUpdates.go +++ b/service/iot/api_op_ListOTAUpdates.go @@ -4,6 +4,7 @@ package iot import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iot/types" @@ -108,6 +109,81 @@ func addOperationListOTAUpdatesMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListOTAUpdatesPaginator returns a new ListOTAUpdatesPaginator +func NewListOTAUpdatesPaginator(client ListOTAUpdatesAPIClient, params *ListOTAUpdatesInput, optFns ...func(*ListOTAUpdatesPaginatorOptions)) *ListOTAUpdatesPaginator { + options := ListOTAUpdatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListOTAUpdatesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListOTAUpdates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListOutgoingCertificates.go b/service/iot/api_op_ListOutgoingCertificates.go index 765ae4b2765..c7c67be4f9a 100644 --- a/service/iot/api_op_ListOutgoingCertificates.go +++ b/service/iot/api_op_ListOutgoingCertificates.go @@ -4,6 +4,7 @@ package iot import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iot/types" @@ -111,6 +112,83 @@ func addOperationListOutgoingCertificatesMiddlewares(stack *middleware.Stack, op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListOutgoingCertificatesPaginator returns a new +// ListOutgoingCertificatesPaginator +func NewListOutgoingCertificatesPaginator(client ListOutgoingCertificatesAPIClient, params *ListOutgoingCertificatesInput, optFns ...func(*ListOutgoingCertificatesPaginatorOptions)) *ListOutgoingCertificatesPaginator { + options := ListOutgoingCertificatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListOutgoingCertificatesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListOutgoingCertificates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListPolicies.go b/service/iot/api_op_ListPolicies.go index 2b2e3bec81a..d0168e45af3 100644 --- a/service/iot/api_op_ListPolicies.go +++ b/service/iot/api_op_ListPolicies.go @@ -4,6 +4,7 @@ package iot import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iot/types" @@ -112,6 +113,80 @@ func addOperationListPoliciesMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListPoliciesPaginator returns a new ListPoliciesPaginator +func NewListPoliciesPaginator(client ListPoliciesAPIClient, params *ListPoliciesInput, optFns ...func(*ListPoliciesPaginatorOptions)) *ListPoliciesPaginator { + options := ListPoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPoliciesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPolicies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListPolicyPrincipals.go b/service/iot/api_op_ListPolicyPrincipals.go index cf355427b73..104ca392187 100644 --- a/service/iot/api_op_ListPolicyPrincipals.go +++ b/service/iot/api_op_ListPolicyPrincipals.go @@ -4,6 +4,7 @@ package iot import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -120,6 +121,82 @@ func addOperationListPolicyPrincipalsMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListPolicyPrincipalsPaginator returns a new ListPolicyPrincipalsPaginator +func NewListPolicyPrincipalsPaginator(client ListPolicyPrincipalsAPIClient, params *ListPolicyPrincipalsInput, optFns ...func(*ListPolicyPrincipalsPaginatorOptions)) *ListPolicyPrincipalsPaginator { + options := ListPolicyPrincipalsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPolicyPrincipalsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPolicyPrincipals(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListPrincipalPolicies.go b/service/iot/api_op_ListPrincipalPolicies.go index dfe8c6e3d44..12cc90d67f2 100644 --- a/service/iot/api_op_ListPrincipalPolicies.go +++ b/service/iot/api_op_ListPrincipalPolicies.go @@ -4,6 +4,7 @@ package iot import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iot/types" @@ -125,6 +126,82 @@ func addOperationListPrincipalPoliciesMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListPrincipalPoliciesPaginator returns a new ListPrincipalPoliciesPaginator +func NewListPrincipalPoliciesPaginator(client ListPrincipalPoliciesAPIClient, params *ListPrincipalPoliciesInput, optFns ...func(*ListPrincipalPoliciesPaginatorOptions)) *ListPrincipalPoliciesPaginator { + options := ListPrincipalPoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPrincipalPoliciesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPrincipalPolicies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListPrincipalThings.go b/service/iot/api_op_ListPrincipalThings.go index a137f788c09..c7e27b697ca 100644 --- a/service/iot/api_op_ListPrincipalThings.go +++ b/service/iot/api_op_ListPrincipalThings.go @@ -4,6 +4,7 @@ package iot import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -117,6 +118,82 @@ func addOperationListPrincipalThingsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListPrincipalThingsPaginator returns a new ListPrincipalThingsPaginator +func NewListPrincipalThingsPaginator(client ListPrincipalThingsAPIClient, params *ListPrincipalThingsInput, optFns ...func(*ListPrincipalThingsPaginatorOptions)) *ListPrincipalThingsPaginator { + options := ListPrincipalThingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPrincipalThingsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPrincipalThings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListProvisioningTemplateVersions.go b/service/iot/api_op_ListProvisioningTemplateVersions.go index be36233c3e1..2d3a80763a4 100644 --- a/service/iot/api_op_ListProvisioningTemplateVersions.go +++ b/service/iot/api_op_ListProvisioningTemplateVersions.go @@ -4,6 +4,7 @@ package iot import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iot/types" @@ -113,6 +114,83 @@ func addOperationListProvisioningTemplateVersionsMiddlewares(stack *middleware.S return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListProvisioningTemplateVersionsPaginator returns a new +// ListProvisioningTemplateVersionsPaginator +func NewListProvisioningTemplateVersionsPaginator(client ListProvisioningTemplateVersionsAPIClient, params *ListProvisioningTemplateVersionsInput, optFns ...func(*ListProvisioningTemplateVersionsPaginatorOptions)) *ListProvisioningTemplateVersionsPaginator { + options := ListProvisioningTemplateVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListProvisioningTemplateVersionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListProvisioningTemplateVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListProvisioningTemplates.go b/service/iot/api_op_ListProvisioningTemplates.go index 805d5b50150..932cda01691 100644 --- a/service/iot/api_op_ListProvisioningTemplates.go +++ b/service/iot/api_op_ListProvisioningTemplates.go @@ -4,6 +4,7 @@ package iot import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iot/types" @@ -105,6 +106,83 @@ func addOperationListProvisioningTemplatesMiddlewares(stack *middleware.Stack, o return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListProvisioningTemplatesPaginator returns a new +// ListProvisioningTemplatesPaginator +func NewListProvisioningTemplatesPaginator(client ListProvisioningTemplatesAPIClient, params *ListProvisioningTemplatesInput, optFns ...func(*ListProvisioningTemplatesPaginatorOptions)) *ListProvisioningTemplatesPaginator { + options := ListProvisioningTemplatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListProvisioningTemplatesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListProvisioningTemplates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListRoleAliases.go b/service/iot/api_op_ListRoleAliases.go index 7b585cb6365..f36fea0bd4f 100644 --- a/service/iot/api_op_ListRoleAliases.go +++ b/service/iot/api_op_ListRoleAliases.go @@ -4,6 +4,7 @@ package iot import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -107,6 +108,81 @@ func addOperationListRoleAliasesMiddlewares(stack *middleware.Stack, options Opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListRoleAliasesPaginator returns a new ListRoleAliasesPaginator +func NewListRoleAliasesPaginator(client ListRoleAliasesAPIClient, params *ListRoleAliasesInput, optFns ...func(*ListRoleAliasesPaginatorOptions)) *ListRoleAliasesPaginator { + options := ListRoleAliasesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRoleAliasesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRoleAliases(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListScheduledAudits.go b/service/iot/api_op_ListScheduledAudits.go index f6afea22eef..f81b3b9cfb3 100644 --- a/service/iot/api_op_ListScheduledAudits.go +++ b/service/iot/api_op_ListScheduledAudits.go @@ -4,6 +4,7 @@ package iot import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iot/types" @@ -106,6 +107,82 @@ func addOperationListScheduledAuditsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListScheduledAuditsPaginator returns a new ListScheduledAuditsPaginator +func NewListScheduledAuditsPaginator(client ListScheduledAuditsAPIClient, params *ListScheduledAuditsInput, optFns ...func(*ListScheduledAuditsPaginatorOptions)) *ListScheduledAuditsPaginator { + options := ListScheduledAuditsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListScheduledAuditsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListScheduledAudits(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListSecurityProfiles.go b/service/iot/api_op_ListSecurityProfiles.go index 9091a98b691..8079b918add 100644 --- a/service/iot/api_op_ListSecurityProfiles.go +++ b/service/iot/api_op_ListSecurityProfiles.go @@ -4,6 +4,7 @@ package iot import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iot/types" @@ -112,6 +113,82 @@ func addOperationListSecurityProfilesMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListSecurityProfilesPaginator returns a new ListSecurityProfilesPaginator +func NewListSecurityProfilesPaginator(client ListSecurityProfilesAPIClient, params *ListSecurityProfilesInput, optFns ...func(*ListSecurityProfilesPaginatorOptions)) *ListSecurityProfilesPaginator { + options := ListSecurityProfilesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSecurityProfilesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSecurityProfiles(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListSecurityProfilesForTarget.go b/service/iot/api_op_ListSecurityProfilesForTarget.go index 59ca8a52e01..60c40e27e96 100644 --- a/service/iot/api_op_ListSecurityProfilesForTarget.go +++ b/service/iot/api_op_ListSecurityProfilesForTarget.go @@ -4,6 +4,7 @@ package iot import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iot/types" @@ -118,6 +119,83 @@ func addOperationListSecurityProfilesForTargetMiddlewares(stack *middleware.Stac return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListSecurityProfilesForTargetPaginator returns a new +// ListSecurityProfilesForTargetPaginator +func NewListSecurityProfilesForTargetPaginator(client ListSecurityProfilesForTargetAPIClient, params *ListSecurityProfilesForTargetInput, optFns ...func(*ListSecurityProfilesForTargetPaginatorOptions)) *ListSecurityProfilesForTargetPaginator { + options := ListSecurityProfilesForTargetPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSecurityProfilesForTargetInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSecurityProfilesForTarget(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListStreams.go b/service/iot/api_op_ListStreams.go index 2f1fc466def..772293e888a 100644 --- a/service/iot/api_op_ListStreams.go +++ b/service/iot/api_op_ListStreams.go @@ -4,6 +4,7 @@ package iot import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iot/types" @@ -108,6 +109,80 @@ func addOperationListStreamsMiddlewares(stack *middleware.Stack, options Options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListStreamsPaginator returns a new ListStreamsPaginator +func NewListStreamsPaginator(client ListStreamsAPIClient, params *ListStreamsInput, optFns ...func(*ListStreamsPaginatorOptions)) *ListStreamsPaginator { + options := ListStreamsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListStreamsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListStreams(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListTagsForResource.go b/service/iot/api_op_ListTagsForResource.go index 5077f86717d..bc56b370967 100644 --- a/service/iot/api_op_ListTagsForResource.go +++ b/service/iot/api_op_ListTagsForResource.go @@ -4,6 +4,7 @@ package iot import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iot/types" @@ -111,6 +112,78 @@ func addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator +func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator { + options := ListTagsForResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTagsForResourceInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListTargetsForPolicy.go b/service/iot/api_op_ListTargetsForPolicy.go index 14938b25d53..a265c56161c 100644 --- a/service/iot/api_op_ListTargetsForPolicy.go +++ b/service/iot/api_op_ListTargetsForPolicy.go @@ -4,6 +4,7 @@ package iot import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -112,6 +113,82 @@ func addOperationListTargetsForPolicyMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTargetsForPolicyPaginator returns a new ListTargetsForPolicyPaginator +func NewListTargetsForPolicyPaginator(client ListTargetsForPolicyAPIClient, params *ListTargetsForPolicyInput, optFns ...func(*ListTargetsForPolicyPaginatorOptions)) *ListTargetsForPolicyPaginator { + options := ListTargetsForPolicyPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTargetsForPolicyInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTargetsForPolicy(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListTargetsForSecurityProfile.go b/service/iot/api_op_ListTargetsForSecurityProfile.go index 6dedaea4452..c81320825a7 100644 --- a/service/iot/api_op_ListTargetsForSecurityProfile.go +++ b/service/iot/api_op_ListTargetsForSecurityProfile.go @@ -4,6 +4,7 @@ package iot import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iot/types" @@ -115,6 +116,83 @@ func addOperationListTargetsForSecurityProfileMiddlewares(stack *middleware.Stac return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTargetsForSecurityProfilePaginator returns a new +// ListTargetsForSecurityProfilePaginator +func NewListTargetsForSecurityProfilePaginator(client ListTargetsForSecurityProfileAPIClient, params *ListTargetsForSecurityProfileInput, optFns ...func(*ListTargetsForSecurityProfilePaginatorOptions)) *ListTargetsForSecurityProfilePaginator { + options := ListTargetsForSecurityProfilePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTargetsForSecurityProfileInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTargetsForSecurityProfile(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListThingGroups.go b/service/iot/api_op_ListThingGroups.go index 317b3297789..49f95df0bfb 100644 --- a/service/iot/api_op_ListThingGroups.go +++ b/service/iot/api_op_ListThingGroups.go @@ -4,6 +4,7 @@ package iot import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iot/types" @@ -115,6 +116,81 @@ func addOperationListThingGroupsMiddlewares(stack *middleware.Stack, options Opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListThingGroupsPaginator returns a new ListThingGroupsPaginator +func NewListThingGroupsPaginator(client ListThingGroupsAPIClient, params *ListThingGroupsInput, optFns ...func(*ListThingGroupsPaginatorOptions)) *ListThingGroupsPaginator { + options := ListThingGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListThingGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListThingGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListThingGroupsForThing.go b/service/iot/api_op_ListThingGroupsForThing.go index 3009f83ab23..d570530d045 100644 --- a/service/iot/api_op_ListThingGroupsForThing.go +++ b/service/iot/api_op_ListThingGroupsForThing.go @@ -4,6 +4,7 @@ package iot import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iot/types" @@ -114,6 +115,83 @@ func addOperationListThingGroupsForThingMiddlewares(stack *middleware.Stack, opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListThingGroupsForThingPaginator returns a new +// ListThingGroupsForThingPaginator +func NewListThingGroupsForThingPaginator(client ListThingGroupsForThingAPIClient, params *ListThingGroupsForThingInput, optFns ...func(*ListThingGroupsForThingPaginatorOptions)) *ListThingGroupsForThingPaginator { + options := ListThingGroupsForThingPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListThingGroupsForThingInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListThingGroupsForThing(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListThingRegistrationTaskReports.go b/service/iot/api_op_ListThingRegistrationTaskReports.go index be96b31333c..69471d34754 100644 --- a/service/iot/api_op_ListThingRegistrationTaskReports.go +++ b/service/iot/api_op_ListThingRegistrationTaskReports.go @@ -4,6 +4,7 @@ package iot import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iot/types" @@ -122,6 +123,83 @@ func addOperationListThingRegistrationTaskReportsMiddlewares(stack *middleware.S return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListThingRegistrationTaskReportsPaginator returns a new +// ListThingRegistrationTaskReportsPaginator +func NewListThingRegistrationTaskReportsPaginator(client ListThingRegistrationTaskReportsAPIClient, params *ListThingRegistrationTaskReportsInput, optFns ...func(*ListThingRegistrationTaskReportsPaginatorOptions)) *ListThingRegistrationTaskReportsPaginator { + options := ListThingRegistrationTaskReportsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListThingRegistrationTaskReportsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListThingRegistrationTaskReports(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListThingRegistrationTasks.go b/service/iot/api_op_ListThingRegistrationTasks.go index d58d5404f2b..b9ff90af326 100644 --- a/service/iot/api_op_ListThingRegistrationTasks.go +++ b/service/iot/api_op_ListThingRegistrationTasks.go @@ -4,6 +4,7 @@ package iot import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iot/types" @@ -109,6 +110,83 @@ func addOperationListThingRegistrationTasksMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListThingRegistrationTasksPaginator returns a new +// ListThingRegistrationTasksPaginator +func NewListThingRegistrationTasksPaginator(client ListThingRegistrationTasksAPIClient, params *ListThingRegistrationTasksInput, optFns ...func(*ListThingRegistrationTasksPaginatorOptions)) *ListThingRegistrationTasksPaginator { + options := ListThingRegistrationTasksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListThingRegistrationTasksInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListThingRegistrationTasks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListThingTypes.go b/service/iot/api_op_ListThingTypes.go index 84be6fe200b..b6de266bbe8 100644 --- a/service/iot/api_op_ListThingTypes.go +++ b/service/iot/api_op_ListThingTypes.go @@ -4,6 +4,7 @@ package iot import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iot/types" @@ -111,6 +112,81 @@ func addOperationListThingTypesMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListThingTypesPaginator returns a new ListThingTypesPaginator +func NewListThingTypesPaginator(client ListThingTypesAPIClient, params *ListThingTypesInput, optFns ...func(*ListThingTypesPaginatorOptions)) *ListThingTypesPaginator { + options := ListThingTypesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListThingTypesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListThingTypes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListThings.go b/service/iot/api_op_ListThings.go index 4ed6314221d..0ed24dc44b7 100644 --- a/service/iot/api_op_ListThings.go +++ b/service/iot/api_op_ListThings.go @@ -4,6 +4,7 @@ package iot import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iot/types" @@ -123,6 +124,80 @@ func addOperationListThingsMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListThingsPaginator returns a new ListThingsPaginator +func NewListThingsPaginator(client ListThingsAPIClient, params *ListThingsInput, optFns ...func(*ListThingsPaginatorOptions)) *ListThingsPaginator { + options := ListThingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListThingsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListThings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListThingsInBillingGroup.go b/service/iot/api_op_ListThingsInBillingGroup.go index f492c150efa..d23488b202a 100644 --- a/service/iot/api_op_ListThingsInBillingGroup.go +++ b/service/iot/api_op_ListThingsInBillingGroup.go @@ -4,6 +4,7 @@ package iot import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -113,6 +114,83 @@ func addOperationListThingsInBillingGroupMiddlewares(stack *middleware.Stack, op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListThingsInBillingGroupPaginator returns a new +// ListThingsInBillingGroupPaginator +func NewListThingsInBillingGroupPaginator(client ListThingsInBillingGroupAPIClient, params *ListThingsInBillingGroupInput, optFns ...func(*ListThingsInBillingGroupPaginatorOptions)) *ListThingsInBillingGroupPaginator { + options := ListThingsInBillingGroupPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListThingsInBillingGroupInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListThingsInBillingGroup(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListThingsInThingGroup.go b/service/iot/api_op_ListThingsInThingGroup.go index f511eb6ec1e..263747ec66b 100644 --- a/service/iot/api_op_ListThingsInThingGroup.go +++ b/service/iot/api_op_ListThingsInThingGroup.go @@ -4,6 +4,7 @@ package iot import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -116,6 +117,82 @@ func addOperationListThingsInThingGroupMiddlewares(stack *middleware.Stack, opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListThingsInThingGroupPaginator returns a new ListThingsInThingGroupPaginator +func NewListThingsInThingGroupPaginator(client ListThingsInThingGroupAPIClient, params *ListThingsInThingGroupInput, optFns ...func(*ListThingsInThingGroupPaginatorOptions)) *ListThingsInThingGroupPaginator { + options := ListThingsInThingGroupPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListThingsInThingGroupInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListThingsInThingGroup(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListTopicRuleDestinations.go b/service/iot/api_op_ListTopicRuleDestinations.go index 0f4be633588..00439883144 100644 --- a/service/iot/api_op_ListTopicRuleDestinations.go +++ b/service/iot/api_op_ListTopicRuleDestinations.go @@ -4,6 +4,7 @@ package iot import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iot/types" @@ -105,6 +106,83 @@ func addOperationListTopicRuleDestinationsMiddlewares(stack *middleware.Stack, o return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTopicRuleDestinationsPaginator returns a new +// ListTopicRuleDestinationsPaginator +func NewListTopicRuleDestinationsPaginator(client ListTopicRuleDestinationsAPIClient, params *ListTopicRuleDestinationsInput, optFns ...func(*ListTopicRuleDestinationsPaginatorOptions)) *ListTopicRuleDestinationsPaginator { + options := ListTopicRuleDestinationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTopicRuleDestinationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTopicRuleDestinations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListTopicRules.go b/service/iot/api_op_ListTopicRules.go index 25bfcdecb75..295092456ab 100644 --- a/service/iot/api_op_ListTopicRules.go +++ b/service/iot/api_op_ListTopicRules.go @@ -4,6 +4,7 @@ package iot import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iot/types" @@ -113,6 +114,81 @@ func addOperationListTopicRulesMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTopicRulesPaginator returns a new ListTopicRulesPaginator +func NewListTopicRulesPaginator(client ListTopicRulesAPIClient, params *ListTopicRulesInput, optFns ...func(*ListTopicRulesPaginatorOptions)) *ListTopicRulesPaginator { + options := ListTopicRulesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTopicRulesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTopicRules(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListV2LoggingLevels.go b/service/iot/api_op_ListV2LoggingLevels.go index 7448148d0d4..33dbb4a0c6e 100644 --- a/service/iot/api_op_ListV2LoggingLevels.go +++ b/service/iot/api_op_ListV2LoggingLevels.go @@ -4,6 +4,7 @@ package iot import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iot/types" @@ -110,6 +111,82 @@ func addOperationListV2LoggingLevelsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListV2LoggingLevelsPaginator returns a new ListV2LoggingLevelsPaginator +func NewListV2LoggingLevelsPaginator(client ListV2LoggingLevelsAPIClient, params *ListV2LoggingLevelsInput, optFns ...func(*ListV2LoggingLevelsPaginatorOptions)) *ListV2LoggingLevelsPaginator { + options := ListV2LoggingLevelsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListV2LoggingLevelsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListV2LoggingLevels(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListViolationEvents.go b/service/iot/api_op_ListViolationEvents.go index 4a1446bd12e..1c9e734b146 100644 --- a/service/iot/api_op_ListViolationEvents.go +++ b/service/iot/api_op_ListViolationEvents.go @@ -4,6 +4,7 @@ package iot import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iot/types" @@ -131,6 +132,82 @@ func addOperationListViolationEventsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListViolationEventsPaginator returns a new ListViolationEventsPaginator +func NewListViolationEventsPaginator(client ListViolationEventsAPIClient, params *ListViolationEventsInput, optFns ...func(*ListViolationEventsPaginatorOptions)) *ListViolationEventsPaginator { + options := ListViolationEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListViolationEventsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListViolationEvents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/go.mod b/service/iot/go.mod index 0d5db54092a..7079723de51 100644 --- a/service/iot/go.mod +++ b/service/iot/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/iot/go.sum b/service/iot/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/iot/go.sum +++ b/service/iot/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 744cf20b5d0..00000000000 --- a/service/iot/paginators.go +++ /dev/null @@ -1,3570 +0,0 @@ -// 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.mod b/service/iot1clickdevicesservice/go.mod index 937f3a5d246..2ed60d25f7a 100644 --- a/service/iot1clickdevicesservice/go.mod +++ b/service/iot1clickdevicesservice/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/iot1clickdevicesservice/go.sum b/service/iot1clickdevicesservice/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/iot1clickdevicesservice/go.sum +++ b/service/iot1clickdevicesservice/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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/api_op_ListPlacements.go b/service/iot1clickprojects/api_op_ListPlacements.go index 126b555a0fa..18a1f0dc217 100644 --- a/service/iot1clickprojects/api_op_ListPlacements.go +++ b/service/iot1clickprojects/api_op_ListPlacements.go @@ -4,6 +4,7 @@ package iot1clickprojects import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iot1clickprojects/types" @@ -117,6 +118,82 @@ func addOperationListPlacementsMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListPlacementsPaginator returns a new ListPlacementsPaginator +func NewListPlacementsPaginator(client ListPlacementsAPIClient, params *ListPlacementsInput, optFns ...func(*ListPlacementsPaginatorOptions)) *ListPlacementsPaginator { + options := ListPlacementsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPlacementsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPlacements(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot1clickprojects/api_op_ListProjects.go b/service/iot1clickprojects/api_op_ListProjects.go index 61fc62b366c..a1a4f5efc94 100644 --- a/service/iot1clickprojects/api_op_ListProjects.go +++ b/service/iot1clickprojects/api_op_ListProjects.go @@ -4,6 +4,7 @@ package iot1clickprojects import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iot1clickprojects/types" @@ -110,6 +111,81 @@ func addOperationListProjectsMiddlewares(stack *middleware.Stack, options Option return 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 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListProjectsPaginator returns a new ListProjectsPaginator +func NewListProjectsPaginator(client ListProjectsAPIClient, params *ListProjectsInput, optFns ...func(*ListProjectsPaginatorOptions)) *ListProjectsPaginator { + options := ListProjectsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListProjectsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListProjects(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot1clickprojects/go.mod b/service/iot1clickprojects/go.mod index cf6a64999cc..72b467a41a4 100644 --- a/service/iot1clickprojects/go.mod +++ b/service/iot1clickprojects/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/iot1clickprojects/go.sum b/service/iot1clickprojects/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/iot1clickprojects/go.sum +++ b/service/iot1clickprojects/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 47bd5d34500..00000000000 --- a/service/iot1clickprojects/paginators.go +++ /dev/null @@ -1,159 +0,0 @@ -// 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/api_op_ListChannels.go b/service/iotanalytics/api_op_ListChannels.go index 5a1cad868e5..03353ada8b5 100644 --- a/service/iotanalytics/api_op_ListChannels.go +++ b/service/iotanalytics/api_op_ListChannels.go @@ -4,6 +4,7 @@ package iotanalytics import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iotanalytics/types" @@ -107,6 +108,81 @@ func addOperationListChannelsMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListChannelsPaginator returns a new ListChannelsPaginator +func NewListChannelsPaginator(client ListChannelsAPIClient, params *ListChannelsInput, optFns ...func(*ListChannelsPaginatorOptions)) *ListChannelsPaginator { + options := ListChannelsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListChannelsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListChannels(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iotanalytics/api_op_ListDatasetContents.go b/service/iotanalytics/api_op_ListDatasetContents.go index 0aa71c498de..0e3de878e43 100644 --- a/service/iotanalytics/api_op_ListDatasetContents.go +++ b/service/iotanalytics/api_op_ListDatasetContents.go @@ -4,6 +4,7 @@ package iotanalytics import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iotanalytics/types" @@ -125,6 +126,82 @@ func addOperationListDatasetContentsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDatasetContentsPaginator returns a new ListDatasetContentsPaginator +func NewListDatasetContentsPaginator(client ListDatasetContentsAPIClient, params *ListDatasetContentsInput, optFns ...func(*ListDatasetContentsPaginatorOptions)) *ListDatasetContentsPaginator { + options := ListDatasetContentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDatasetContentsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDatasetContents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iotanalytics/api_op_ListDatasets.go b/service/iotanalytics/api_op_ListDatasets.go index cef59b6216a..882008ee014 100644 --- a/service/iotanalytics/api_op_ListDatasets.go +++ b/service/iotanalytics/api_op_ListDatasets.go @@ -4,6 +4,7 @@ package iotanalytics import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iotanalytics/types" @@ -107,6 +108,81 @@ func addOperationListDatasetsMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDatasetsPaginator returns a new ListDatasetsPaginator +func NewListDatasetsPaginator(client ListDatasetsAPIClient, params *ListDatasetsInput, optFns ...func(*ListDatasetsPaginatorOptions)) *ListDatasetsPaginator { + options := ListDatasetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDatasetsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDatasets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iotanalytics/api_op_ListDatastores.go b/service/iotanalytics/api_op_ListDatastores.go index 86f3dc6ae29..98cc47a352a 100644 --- a/service/iotanalytics/api_op_ListDatastores.go +++ b/service/iotanalytics/api_op_ListDatastores.go @@ -4,6 +4,7 @@ package iotanalytics import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iotanalytics/types" @@ -107,6 +108,82 @@ func addOperationListDatastoresMiddlewares(stack *middleware.Stack, options Opti return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDatastoresPaginator returns a new ListDatastoresPaginator +func NewListDatastoresPaginator(client ListDatastoresAPIClient, params *ListDatastoresInput, optFns ...func(*ListDatastoresPaginatorOptions)) *ListDatastoresPaginator { + options := ListDatastoresPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDatastoresInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDatastores(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iotanalytics/api_op_ListPipelines.go b/service/iotanalytics/api_op_ListPipelines.go index f2d1bffd523..4e531659231 100644 --- a/service/iotanalytics/api_op_ListPipelines.go +++ b/service/iotanalytics/api_op_ListPipelines.go @@ -4,6 +4,7 @@ package iotanalytics import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iotanalytics/types" @@ -107,6 +108,81 @@ func addOperationListPipelinesMiddlewares(stack *middleware.Stack, options Optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListPipelinesPaginator returns a new ListPipelinesPaginator +func NewListPipelinesPaginator(client ListPipelinesAPIClient, params *ListPipelinesInput, optFns ...func(*ListPipelinesPaginatorOptions)) *ListPipelinesPaginator { + options := ListPipelinesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPipelinesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPipelines(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iotanalytics/go.mod b/service/iotanalytics/go.mod index 7a614351e8d..2fa958f594e 100644 --- a/service/iotanalytics/go.mod +++ b/service/iotanalytics/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/iotanalytics/go.sum b/service/iotanalytics/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/iotanalytics/go.sum +++ b/service/iotanalytics/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index a7137ce830f..00000000000 --- a/service/iotanalytics/paginators.go +++ /dev/null @@ -1,385 +0,0 @@ -// 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.mod b/service/iotdataplane/go.mod index a3a260b593d..0647e28bd76 100644 --- a/service/iotdataplane/go.mod +++ b/service/iotdataplane/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/iotdataplane/go.sum b/service/iotdataplane/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/iotdataplane/go.sum +++ b/service/iotdataplane/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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.mod b/service/iotevents/go.mod index 4a9b5ca0e44..8a381595f21 100644 --- a/service/iotevents/go.mod +++ b/service/iotevents/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/iotevents/go.sum b/service/iotevents/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/iotevents/go.sum +++ b/service/iotevents/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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.mod b/service/ioteventsdata/go.mod index b694a5d0700..b448367f994 100644 --- a/service/ioteventsdata/go.mod +++ b/service/ioteventsdata/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/ioteventsdata/go.sum b/service/ioteventsdata/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/ioteventsdata/go.sum +++ b/service/ioteventsdata/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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.mod b/service/iotjobsdataplane/go.mod index a71875573e1..52c94d61e28 100644 --- a/service/iotjobsdataplane/go.mod +++ b/service/iotjobsdataplane/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/iotjobsdataplane/go.sum b/service/iotjobsdataplane/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/iotjobsdataplane/go.sum +++ b/service/iotjobsdataplane/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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/api_op_ListTunnels.go b/service/iotsecuretunneling/api_op_ListTunnels.go index 7feb0374b2a..88644b33ce9 100644 --- a/service/iotsecuretunneling/api_op_ListTunnels.go +++ b/service/iotsecuretunneling/api_op_ListTunnels.go @@ -4,6 +4,7 @@ package iotsecuretunneling import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iotsecuretunneling/types" @@ -109,6 +110,80 @@ func addOperationListTunnelsMiddlewares(stack *middleware.Stack, options Options return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTunnelsPaginator returns a new ListTunnelsPaginator +func NewListTunnelsPaginator(client ListTunnelsAPIClient, params *ListTunnelsInput, optFns ...func(*ListTunnelsPaginatorOptions)) *ListTunnelsPaginator { + options := ListTunnelsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTunnelsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTunnels(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iotsecuretunneling/go.mod b/service/iotsecuretunneling/go.mod index ff7eb9090c2..bf3dac6e977 100644 --- a/service/iotsecuretunneling/go.mod +++ b/service/iotsecuretunneling/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/iotsecuretunneling/go.sum b/service/iotsecuretunneling/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/iotsecuretunneling/go.sum +++ b/service/iotsecuretunneling/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 12293e88b10..00000000000 --- a/service/iotsecuretunneling/paginators.go +++ /dev/null @@ -1,82 +0,0 @@ -// 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/api_op_AssociateAssets.go b/service/iotsitewise/api_op_AssociateAssets.go index a3552dc197f..b9f9f46dc4d 100644 --- a/service/iotsitewise/api_op_AssociateAssets.go +++ b/service/iotsitewise/api_op_AssociateAssets.go @@ -138,7 +138,7 @@ func (*endpointPrefix_opAssociateAssetsMiddleware) ID() string { func (m *endpointPrefix_opAssociateAssetsMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -147,12 +147,12 @@ func (m *endpointPrefix_opAssociateAssetsMiddleware) HandleSerialize(ctx context return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "model." + req.URL.Host = "model." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opAssociateAssetsMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opAssociateAssetsMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opAssociateAssetsMiddleware{}, `OperationSerializer`, middleware.After) } type idempotencyToken_initializeOpAssociateAssets struct { diff --git a/service/iotsitewise/api_op_BatchAssociateProjectAssets.go b/service/iotsitewise/api_op_BatchAssociateProjectAssets.go index 530dc1cf941..088d3c5de9c 100644 --- a/service/iotsitewise/api_op_BatchAssociateProjectAssets.go +++ b/service/iotsitewise/api_op_BatchAssociateProjectAssets.go @@ -131,7 +131,7 @@ func (*endpointPrefix_opBatchAssociateProjectAssetsMiddleware) ID() string { func (m *endpointPrefix_opBatchAssociateProjectAssetsMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -140,12 +140,12 @@ func (m *endpointPrefix_opBatchAssociateProjectAssetsMiddleware) HandleSerialize return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "monitor." + req.URL.Host = "monitor." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opBatchAssociateProjectAssetsMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opBatchAssociateProjectAssetsMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opBatchAssociateProjectAssetsMiddleware{}, `OperationSerializer`, middleware.After) } type idempotencyToken_initializeOpBatchAssociateProjectAssets struct { diff --git a/service/iotsitewise/api_op_BatchDisassociateProjectAssets.go b/service/iotsitewise/api_op_BatchDisassociateProjectAssets.go index b07e24a835e..329663e7b7e 100644 --- a/service/iotsitewise/api_op_BatchDisassociateProjectAssets.go +++ b/service/iotsitewise/api_op_BatchDisassociateProjectAssets.go @@ -132,7 +132,7 @@ func (*endpointPrefix_opBatchDisassociateProjectAssetsMiddleware) ID() string { func (m *endpointPrefix_opBatchDisassociateProjectAssetsMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -141,12 +141,12 @@ func (m *endpointPrefix_opBatchDisassociateProjectAssetsMiddleware) HandleSerial return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "monitor." + req.URL.Host = "monitor." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opBatchDisassociateProjectAssetsMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opBatchDisassociateProjectAssetsMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opBatchDisassociateProjectAssetsMiddleware{}, `OperationSerializer`, middleware.After) } type idempotencyToken_initializeOpBatchDisassociateProjectAssets struct { diff --git a/service/iotsitewise/api_op_BatchPutAssetPropertyValue.go b/service/iotsitewise/api_op_BatchPutAssetPropertyValue.go index 66c56c2cc3f..4a0ed7331a7 100644 --- a/service/iotsitewise/api_op_BatchPutAssetPropertyValue.go +++ b/service/iotsitewise/api_op_BatchPutAssetPropertyValue.go @@ -148,7 +148,7 @@ func (*endpointPrefix_opBatchPutAssetPropertyValueMiddleware) ID() string { func (m *endpointPrefix_opBatchPutAssetPropertyValueMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -157,12 +157,12 @@ func (m *endpointPrefix_opBatchPutAssetPropertyValueMiddleware) HandleSerialize( return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "data." + req.URL.Host = "data." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opBatchPutAssetPropertyValueMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opBatchPutAssetPropertyValueMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opBatchPutAssetPropertyValueMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opBatchPutAssetPropertyValue(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/iotsitewise/api_op_CreateAccessPolicy.go b/service/iotsitewise/api_op_CreateAccessPolicy.go index e4d4d8a6daa..95322d97c48 100644 --- a/service/iotsitewise/api_op_CreateAccessPolicy.go +++ b/service/iotsitewise/api_op_CreateAccessPolicy.go @@ -157,7 +157,7 @@ func (*endpointPrefix_opCreateAccessPolicyMiddleware) ID() string { func (m *endpointPrefix_opCreateAccessPolicyMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -166,12 +166,12 @@ func (m *endpointPrefix_opCreateAccessPolicyMiddleware) HandleSerialize(ctx cont return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "monitor." + req.URL.Host = "monitor." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opCreateAccessPolicyMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opCreateAccessPolicyMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opCreateAccessPolicyMiddleware{}, `OperationSerializer`, middleware.After) } type idempotencyToken_initializeOpCreateAccessPolicy struct { diff --git a/service/iotsitewise/api_op_CreateAsset.go b/service/iotsitewise/api_op_CreateAsset.go index 88d6c779ca1..f6bb5a73bb7 100644 --- a/service/iotsitewise/api_op_CreateAsset.go +++ b/service/iotsitewise/api_op_CreateAsset.go @@ -157,7 +157,7 @@ func (*endpointPrefix_opCreateAssetMiddleware) ID() string { func (m *endpointPrefix_opCreateAssetMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -166,12 +166,12 @@ func (m *endpointPrefix_opCreateAssetMiddleware) HandleSerialize(ctx context.Con return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "model." + req.URL.Host = "model." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opCreateAssetMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opCreateAssetMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opCreateAssetMiddleware{}, `OperationSerializer`, middleware.After) } type idempotencyToken_initializeOpCreateAsset struct { diff --git a/service/iotsitewise/api_op_CreateAssetModel.go b/service/iotsitewise/api_op_CreateAssetModel.go index 2d89679e4e8..5caaf43b946 100644 --- a/service/iotsitewise/api_op_CreateAssetModel.go +++ b/service/iotsitewise/api_op_CreateAssetModel.go @@ -177,7 +177,7 @@ func (*endpointPrefix_opCreateAssetModelMiddleware) ID() string { func (m *endpointPrefix_opCreateAssetModelMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -186,12 +186,12 @@ func (m *endpointPrefix_opCreateAssetModelMiddleware) HandleSerialize(ctx contex return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "model." + req.URL.Host = "model." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opCreateAssetModelMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opCreateAssetModelMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opCreateAssetModelMiddleware{}, `OperationSerializer`, middleware.After) } type idempotencyToken_initializeOpCreateAssetModel struct { diff --git a/service/iotsitewise/api_op_CreateDashboard.go b/service/iotsitewise/api_op_CreateDashboard.go index f5f9fe0dd0a..20fb8daf903 100644 --- a/service/iotsitewise/api_op_CreateDashboard.go +++ b/service/iotsitewise/api_op_CreateDashboard.go @@ -157,7 +157,7 @@ func (*endpointPrefix_opCreateDashboardMiddleware) ID() string { func (m *endpointPrefix_opCreateDashboardMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -166,12 +166,12 @@ func (m *endpointPrefix_opCreateDashboardMiddleware) HandleSerialize(ctx context return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "monitor." + req.URL.Host = "monitor." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opCreateDashboardMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opCreateDashboardMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opCreateDashboardMiddleware{}, `OperationSerializer`, middleware.After) } type idempotencyToken_initializeOpCreateDashboard struct { diff --git a/service/iotsitewise/api_op_CreateGateway.go b/service/iotsitewise/api_op_CreateGateway.go index cacd1a321d9..b36d8592d6a 100644 --- a/service/iotsitewise/api_op_CreateGateway.go +++ b/service/iotsitewise/api_op_CreateGateway.go @@ -144,7 +144,7 @@ func (*endpointPrefix_opCreateGatewayMiddleware) ID() string { func (m *endpointPrefix_opCreateGatewayMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -153,12 +153,12 @@ func (m *endpointPrefix_opCreateGatewayMiddleware) HandleSerialize(ctx context.C return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "edge." + req.URL.Host = "edge." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opCreateGatewayMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opCreateGatewayMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opCreateGatewayMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opCreateGateway(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/iotsitewise/api_op_CreatePortal.go b/service/iotsitewise/api_op_CreatePortal.go index ae0bee6f209..ec88e9a80b8 100644 --- a/service/iotsitewise/api_op_CreatePortal.go +++ b/service/iotsitewise/api_op_CreatePortal.go @@ -211,7 +211,7 @@ func (*endpointPrefix_opCreatePortalMiddleware) ID() string { func (m *endpointPrefix_opCreatePortalMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -220,12 +220,12 @@ func (m *endpointPrefix_opCreatePortalMiddleware) HandleSerialize(ctx context.Co return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "monitor." + req.URL.Host = "monitor." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opCreatePortalMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opCreatePortalMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opCreatePortalMiddleware{}, `OperationSerializer`, middleware.After) } type idempotencyToken_initializeOpCreatePortal struct { diff --git a/service/iotsitewise/api_op_CreatePresignedPortalUrl.go b/service/iotsitewise/api_op_CreatePresignedPortalUrl.go index 12b2cce18d6..fd40baddf41 100644 --- a/service/iotsitewise/api_op_CreatePresignedPortalUrl.go +++ b/service/iotsitewise/api_op_CreatePresignedPortalUrl.go @@ -129,7 +129,7 @@ func (*endpointPrefix_opCreatePresignedPortalUrlMiddleware) ID() string { func (m *endpointPrefix_opCreatePresignedPortalUrlMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -138,12 +138,12 @@ func (m *endpointPrefix_opCreatePresignedPortalUrlMiddleware) HandleSerialize(ct return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "monitor." + req.URL.Host = "monitor." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opCreatePresignedPortalUrlMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opCreatePresignedPortalUrlMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opCreatePresignedPortalUrlMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opCreatePresignedPortalUrl(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/iotsitewise/api_op_CreateProject.go b/service/iotsitewise/api_op_CreateProject.go index 6de75a39fef..8c2d560a916 100644 --- a/service/iotsitewise/api_op_CreateProject.go +++ b/service/iotsitewise/api_op_CreateProject.go @@ -149,7 +149,7 @@ func (*endpointPrefix_opCreateProjectMiddleware) ID() string { func (m *endpointPrefix_opCreateProjectMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -158,12 +158,12 @@ func (m *endpointPrefix_opCreateProjectMiddleware) HandleSerialize(ctx context.C return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "monitor." + req.URL.Host = "monitor." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opCreateProjectMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opCreateProjectMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opCreateProjectMiddleware{}, `OperationSerializer`, middleware.After) } type idempotencyToken_initializeOpCreateProject struct { diff --git a/service/iotsitewise/api_op_DeleteAccessPolicy.go b/service/iotsitewise/api_op_DeleteAccessPolicy.go index 2caae7d579c..ccedb5448fa 100644 --- a/service/iotsitewise/api_op_DeleteAccessPolicy.go +++ b/service/iotsitewise/api_op_DeleteAccessPolicy.go @@ -123,7 +123,7 @@ func (*endpointPrefix_opDeleteAccessPolicyMiddleware) ID() string { func (m *endpointPrefix_opDeleteAccessPolicyMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -132,12 +132,12 @@ func (m *endpointPrefix_opDeleteAccessPolicyMiddleware) HandleSerialize(ctx cont return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "monitor." + req.URL.Host = "monitor." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opDeleteAccessPolicyMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opDeleteAccessPolicyMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opDeleteAccessPolicyMiddleware{}, `OperationSerializer`, middleware.After) } type idempotencyToken_initializeOpDeleteAccessPolicy struct { diff --git a/service/iotsitewise/api_op_DeleteAsset.go b/service/iotsitewise/api_op_DeleteAsset.go index 78d11542cf6..5a4f519321c 100644 --- a/service/iotsitewise/api_op_DeleteAsset.go +++ b/service/iotsitewise/api_op_DeleteAsset.go @@ -134,7 +134,7 @@ func (*endpointPrefix_opDeleteAssetMiddleware) ID() string { func (m *endpointPrefix_opDeleteAssetMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -143,12 +143,12 @@ func (m *endpointPrefix_opDeleteAssetMiddleware) HandleSerialize(ctx context.Con return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "model." + req.URL.Host = "model." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opDeleteAssetMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opDeleteAssetMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opDeleteAssetMiddleware{}, `OperationSerializer`, middleware.After) } type idempotencyToken_initializeOpDeleteAsset struct { diff --git a/service/iotsitewise/api_op_DeleteAssetModel.go b/service/iotsitewise/api_op_DeleteAssetModel.go index 77b0ef0ec13..86a86a7031a 100644 --- a/service/iotsitewise/api_op_DeleteAssetModel.go +++ b/service/iotsitewise/api_op_DeleteAssetModel.go @@ -135,7 +135,7 @@ func (*endpointPrefix_opDeleteAssetModelMiddleware) ID() string { func (m *endpointPrefix_opDeleteAssetModelMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -144,12 +144,12 @@ func (m *endpointPrefix_opDeleteAssetModelMiddleware) HandleSerialize(ctx contex return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "model." + req.URL.Host = "model." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opDeleteAssetModelMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opDeleteAssetModelMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opDeleteAssetModelMiddleware{}, `OperationSerializer`, middleware.After) } type idempotencyToken_initializeOpDeleteAssetModel struct { diff --git a/service/iotsitewise/api_op_DeleteDashboard.go b/service/iotsitewise/api_op_DeleteDashboard.go index e5723728772..9bd1c8505c7 100644 --- a/service/iotsitewise/api_op_DeleteDashboard.go +++ b/service/iotsitewise/api_op_DeleteDashboard.go @@ -121,7 +121,7 @@ func (*endpointPrefix_opDeleteDashboardMiddleware) ID() string { func (m *endpointPrefix_opDeleteDashboardMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -130,12 +130,12 @@ func (m *endpointPrefix_opDeleteDashboardMiddleware) HandleSerialize(ctx context return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "monitor." + req.URL.Host = "monitor." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opDeleteDashboardMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opDeleteDashboardMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opDeleteDashboardMiddleware{}, `OperationSerializer`, middleware.After) } type idempotencyToken_initializeOpDeleteDashboard struct { diff --git a/service/iotsitewise/api_op_DeleteGateway.go b/service/iotsitewise/api_op_DeleteGateway.go index 64fbcab9118..c3b9f7cfed7 100644 --- a/service/iotsitewise/api_op_DeleteGateway.go +++ b/service/iotsitewise/api_op_DeleteGateway.go @@ -114,7 +114,7 @@ func (*endpointPrefix_opDeleteGatewayMiddleware) ID() string { func (m *endpointPrefix_opDeleteGatewayMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -123,12 +123,12 @@ func (m *endpointPrefix_opDeleteGatewayMiddleware) HandleSerialize(ctx context.C return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "edge." + req.URL.Host = "edge." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opDeleteGatewayMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opDeleteGatewayMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opDeleteGatewayMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opDeleteGateway(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/iotsitewise/api_op_DeletePortal.go b/service/iotsitewise/api_op_DeletePortal.go index e95158d4df3..4796808ef41 100644 --- a/service/iotsitewise/api_op_DeletePortal.go +++ b/service/iotsitewise/api_op_DeletePortal.go @@ -129,7 +129,7 @@ func (*endpointPrefix_opDeletePortalMiddleware) ID() string { func (m *endpointPrefix_opDeletePortalMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -138,12 +138,12 @@ func (m *endpointPrefix_opDeletePortalMiddleware) HandleSerialize(ctx context.Co return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "monitor." + req.URL.Host = "monitor." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opDeletePortalMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opDeletePortalMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opDeletePortalMiddleware{}, `OperationSerializer`, middleware.After) } type idempotencyToken_initializeOpDeletePortal struct { diff --git a/service/iotsitewise/api_op_DeleteProject.go b/service/iotsitewise/api_op_DeleteProject.go index 80df522a602..865518e7742 100644 --- a/service/iotsitewise/api_op_DeleteProject.go +++ b/service/iotsitewise/api_op_DeleteProject.go @@ -121,7 +121,7 @@ func (*endpointPrefix_opDeleteProjectMiddleware) ID() string { func (m *endpointPrefix_opDeleteProjectMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -130,12 +130,12 @@ func (m *endpointPrefix_opDeleteProjectMiddleware) HandleSerialize(ctx context.C return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "monitor." + req.URL.Host = "monitor." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opDeleteProjectMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opDeleteProjectMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opDeleteProjectMiddleware{}, `OperationSerializer`, middleware.After) } type idempotencyToken_initializeOpDeleteProject struct { diff --git a/service/iotsitewise/api_op_DescribeAccessPolicy.go b/service/iotsitewise/api_op_DescribeAccessPolicy.go index c043a7c5acb..e7d0c998bc5 100644 --- a/service/iotsitewise/api_op_DescribeAccessPolicy.go +++ b/service/iotsitewise/api_op_DescribeAccessPolicy.go @@ -158,7 +158,7 @@ func (*endpointPrefix_opDescribeAccessPolicyMiddleware) ID() string { func (m *endpointPrefix_opDescribeAccessPolicyMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -167,12 +167,12 @@ func (m *endpointPrefix_opDescribeAccessPolicyMiddleware) HandleSerialize(ctx co return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "monitor." + req.URL.Host = "monitor." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opDescribeAccessPolicyMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opDescribeAccessPolicyMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opDescribeAccessPolicyMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opDescribeAccessPolicy(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/iotsitewise/api_op_DescribeAsset.go b/service/iotsitewise/api_op_DescribeAsset.go index 87d216387c4..844c04c836d 100644 --- a/service/iotsitewise/api_op_DescribeAsset.go +++ b/service/iotsitewise/api_op_DescribeAsset.go @@ -165,7 +165,7 @@ func (*endpointPrefix_opDescribeAssetMiddleware) ID() string { func (m *endpointPrefix_opDescribeAssetMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -174,12 +174,12 @@ func (m *endpointPrefix_opDescribeAssetMiddleware) HandleSerialize(ctx context.C return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "model." + req.URL.Host = "model." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opDescribeAssetMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opDescribeAssetMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opDescribeAssetMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opDescribeAsset(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/iotsitewise/api_op_DescribeAssetModel.go b/service/iotsitewise/api_op_DescribeAssetModel.go index c574574d4ad..d657e1a9b7c 100644 --- a/service/iotsitewise/api_op_DescribeAssetModel.go +++ b/service/iotsitewise/api_op_DescribeAssetModel.go @@ -167,7 +167,7 @@ func (*endpointPrefix_opDescribeAssetModelMiddleware) ID() string { func (m *endpointPrefix_opDescribeAssetModelMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -176,12 +176,12 @@ func (m *endpointPrefix_opDescribeAssetModelMiddleware) HandleSerialize(ctx cont return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "model." + req.URL.Host = "model." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opDescribeAssetModelMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opDescribeAssetModelMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opDescribeAssetModelMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opDescribeAssetModel(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/iotsitewise/api_op_DescribeAssetProperty.go b/service/iotsitewise/api_op_DescribeAssetProperty.go index dfd385c20e7..9fb41200051 100644 --- a/service/iotsitewise/api_op_DescribeAssetProperty.go +++ b/service/iotsitewise/api_op_DescribeAssetProperty.go @@ -146,7 +146,7 @@ func (*endpointPrefix_opDescribeAssetPropertyMiddleware) ID() string { func (m *endpointPrefix_opDescribeAssetPropertyMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -155,12 +155,12 @@ func (m *endpointPrefix_opDescribeAssetPropertyMiddleware) HandleSerialize(ctx c return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "model." + req.URL.Host = "model." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opDescribeAssetPropertyMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opDescribeAssetPropertyMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opDescribeAssetPropertyMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opDescribeAssetProperty(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/iotsitewise/api_op_DescribeDashboard.go b/service/iotsitewise/api_op_DescribeDashboard.go index 34ea6ffa8be..ddc622785fc 100644 --- a/service/iotsitewise/api_op_DescribeDashboard.go +++ b/service/iotsitewise/api_op_DescribeDashboard.go @@ -159,7 +159,7 @@ func (*endpointPrefix_opDescribeDashboardMiddleware) ID() string { func (m *endpointPrefix_opDescribeDashboardMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -168,12 +168,12 @@ func (m *endpointPrefix_opDescribeDashboardMiddleware) HandleSerialize(ctx conte return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "monitor." + req.URL.Host = "monitor." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opDescribeDashboardMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opDescribeDashboardMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opDescribeDashboardMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opDescribeDashboard(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/iotsitewise/api_op_DescribeGateway.go b/service/iotsitewise/api_op_DescribeGateway.go index 3028dad0aa6..174d6d75947 100644 --- a/service/iotsitewise/api_op_DescribeGateway.go +++ b/service/iotsitewise/api_op_DescribeGateway.go @@ -156,7 +156,7 @@ func (*endpointPrefix_opDescribeGatewayMiddleware) ID() string { func (m *endpointPrefix_opDescribeGatewayMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -165,12 +165,12 @@ func (m *endpointPrefix_opDescribeGatewayMiddleware) HandleSerialize(ctx context return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "edge." + req.URL.Host = "edge." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opDescribeGatewayMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opDescribeGatewayMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opDescribeGatewayMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opDescribeGateway(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/iotsitewise/api_op_DescribeGatewayCapabilityConfiguration.go b/service/iotsitewise/api_op_DescribeGatewayCapabilityConfiguration.go index 00a5756b3d7..5c8798707f2 100644 --- a/service/iotsitewise/api_op_DescribeGatewayCapabilityConfiguration.go +++ b/service/iotsitewise/api_op_DescribeGatewayCapabilityConfiguration.go @@ -162,7 +162,7 @@ func (*endpointPrefix_opDescribeGatewayCapabilityConfigurationMiddleware) ID() s func (m *endpointPrefix_opDescribeGatewayCapabilityConfigurationMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -171,12 +171,12 @@ func (m *endpointPrefix_opDescribeGatewayCapabilityConfigurationMiddleware) Hand return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "edge." + req.URL.Host = "edge." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opDescribeGatewayCapabilityConfigurationMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opDescribeGatewayCapabilityConfigurationMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opDescribeGatewayCapabilityConfigurationMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opDescribeGatewayCapabilityConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/iotsitewise/api_op_DescribeLoggingOptions.go b/service/iotsitewise/api_op_DescribeLoggingOptions.go index 39e1d89b845..38e2c28a4e5 100644 --- a/service/iotsitewise/api_op_DescribeLoggingOptions.go +++ b/service/iotsitewise/api_op_DescribeLoggingOptions.go @@ -112,7 +112,7 @@ func (*endpointPrefix_opDescribeLoggingOptionsMiddleware) ID() string { func (m *endpointPrefix_opDescribeLoggingOptionsMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -121,12 +121,12 @@ func (m *endpointPrefix_opDescribeLoggingOptionsMiddleware) HandleSerialize(ctx return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "model." + req.URL.Host = "model." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opDescribeLoggingOptionsMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opDescribeLoggingOptionsMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opDescribeLoggingOptionsMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opDescribeLoggingOptions(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/iotsitewise/api_op_DescribePortal.go b/service/iotsitewise/api_op_DescribePortal.go index f70d1679de6..e28bbd39b92 100644 --- a/service/iotsitewise/api_op_DescribePortal.go +++ b/service/iotsitewise/api_op_DescribePortal.go @@ -189,7 +189,7 @@ func (*endpointPrefix_opDescribePortalMiddleware) ID() string { func (m *endpointPrefix_opDescribePortalMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -198,12 +198,12 @@ func (m *endpointPrefix_opDescribePortalMiddleware) HandleSerialize(ctx context. return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "monitor." + req.URL.Host = "monitor." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opDescribePortalMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opDescribePortalMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opDescribePortalMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opDescribePortal(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/iotsitewise/api_op_DescribeProject.go b/service/iotsitewise/api_op_DescribeProject.go index 23b73cb8770..4f6d6d1df2f 100644 --- a/service/iotsitewise/api_op_DescribeProject.go +++ b/service/iotsitewise/api_op_DescribeProject.go @@ -151,7 +151,7 @@ func (*endpointPrefix_opDescribeProjectMiddleware) ID() string { func (m *endpointPrefix_opDescribeProjectMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -160,12 +160,12 @@ func (m *endpointPrefix_opDescribeProjectMiddleware) HandleSerialize(ctx context return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "monitor." + req.URL.Host = "monitor." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opDescribeProjectMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opDescribeProjectMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opDescribeProjectMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opDescribeProject(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/iotsitewise/api_op_DisassociateAssets.go b/service/iotsitewise/api_op_DisassociateAssets.go index c1a6f8f8188..7bb9b75825a 100644 --- a/service/iotsitewise/api_op_DisassociateAssets.go +++ b/service/iotsitewise/api_op_DisassociateAssets.go @@ -137,7 +137,7 @@ func (*endpointPrefix_opDisassociateAssetsMiddleware) ID() string { func (m *endpointPrefix_opDisassociateAssetsMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -146,12 +146,12 @@ func (m *endpointPrefix_opDisassociateAssetsMiddleware) HandleSerialize(ctx cont return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "model." + req.URL.Host = "model." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opDisassociateAssetsMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opDisassociateAssetsMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opDisassociateAssetsMiddleware{}, `OperationSerializer`, middleware.After) } type idempotencyToken_initializeOpDisassociateAssets struct { diff --git a/service/iotsitewise/api_op_GetAssetPropertyAggregates.go b/service/iotsitewise/api_op_GetAssetPropertyAggregates.go index 19ce9d98721..54704fab4ea 100644 --- a/service/iotsitewise/api_op_GetAssetPropertyAggregates.go +++ b/service/iotsitewise/api_op_GetAssetPropertyAggregates.go @@ -179,7 +179,7 @@ func (*endpointPrefix_opGetAssetPropertyAggregatesMiddleware) ID() string { func (m *endpointPrefix_opGetAssetPropertyAggregatesMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -188,12 +188,89 @@ func (m *endpointPrefix_opGetAssetPropertyAggregatesMiddleware) HandleSerialize( return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "data." + req.URL.Host = "data." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opGetAssetPropertyAggregatesMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opGetAssetPropertyAggregatesMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opGetAssetPropertyAggregatesMiddleware{}, `OperationSerializer`, middleware.After) +} + +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetAssetPropertyAggregatesPaginator returns a new +// GetAssetPropertyAggregatesPaginator +func NewGetAssetPropertyAggregatesPaginator(client GetAssetPropertyAggregatesAPIClient, params *GetAssetPropertyAggregatesInput, optFns ...func(*GetAssetPropertyAggregatesPaginatorOptions)) *GetAssetPropertyAggregatesPaginator { + options := GetAssetPropertyAggregatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetAssetPropertyAggregatesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil } func newServiceMetadataMiddleware_opGetAssetPropertyAggregates(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/iotsitewise/api_op_GetAssetPropertyValue.go b/service/iotsitewise/api_op_GetAssetPropertyValue.go index 100166cf83e..3f821e9dbce 100644 --- a/service/iotsitewise/api_op_GetAssetPropertyValue.go +++ b/service/iotsitewise/api_op_GetAssetPropertyValue.go @@ -135,7 +135,7 @@ func (*endpointPrefix_opGetAssetPropertyValueMiddleware) ID() string { func (m *endpointPrefix_opGetAssetPropertyValueMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -144,12 +144,12 @@ func (m *endpointPrefix_opGetAssetPropertyValueMiddleware) HandleSerialize(ctx c return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "data." + req.URL.Host = "data." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opGetAssetPropertyValueMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opGetAssetPropertyValueMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opGetAssetPropertyValueMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opGetAssetPropertyValue(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/iotsitewise/api_op_GetAssetPropertyValueHistory.go b/service/iotsitewise/api_op_GetAssetPropertyValueHistory.go index b3625f2a054..1bd05888345 100644 --- a/service/iotsitewise/api_op_GetAssetPropertyValueHistory.go +++ b/service/iotsitewise/api_op_GetAssetPropertyValueHistory.go @@ -162,7 +162,7 @@ func (*endpointPrefix_opGetAssetPropertyValueHistoryMiddleware) ID() string { func (m *endpointPrefix_opGetAssetPropertyValueHistoryMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -171,12 +171,89 @@ func (m *endpointPrefix_opGetAssetPropertyValueHistoryMiddleware) HandleSerializ return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "data." + req.URL.Host = "data." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opGetAssetPropertyValueHistoryMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opGetAssetPropertyValueHistoryMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opGetAssetPropertyValueHistoryMiddleware{}, `OperationSerializer`, middleware.After) +} + +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetAssetPropertyValueHistoryPaginator returns a new +// GetAssetPropertyValueHistoryPaginator +func NewGetAssetPropertyValueHistoryPaginator(client GetAssetPropertyValueHistoryAPIClient, params *GetAssetPropertyValueHistoryInput, optFns ...func(*GetAssetPropertyValueHistoryPaginatorOptions)) *GetAssetPropertyValueHistoryPaginator { + options := GetAssetPropertyValueHistoryPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetAssetPropertyValueHistoryInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil } func newServiceMetadataMiddleware_opGetAssetPropertyValueHistory(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/iotsitewise/api_op_ListAccessPolicies.go b/service/iotsitewise/api_op_ListAccessPolicies.go index 92c32b0f32f..b73dea01e2f 100644 --- a/service/iotsitewise/api_op_ListAccessPolicies.go +++ b/service/iotsitewise/api_op_ListAccessPolicies.go @@ -145,7 +145,7 @@ func (*endpointPrefix_opListAccessPoliciesMiddleware) ID() string { func (m *endpointPrefix_opListAccessPoliciesMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -154,12 +154,88 @@ func (m *endpointPrefix_opListAccessPoliciesMiddleware) HandleSerialize(ctx cont return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "monitor." + req.URL.Host = "monitor." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opListAccessPoliciesMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opListAccessPoliciesMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opListAccessPoliciesMiddleware{}, `OperationSerializer`, middleware.After) +} + +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAccessPoliciesPaginator returns a new ListAccessPoliciesPaginator +func NewListAccessPoliciesPaginator(client ListAccessPoliciesAPIClient, params *ListAccessPoliciesInput, optFns ...func(*ListAccessPoliciesPaginatorOptions)) *ListAccessPoliciesPaginator { + options := ListAccessPoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAccessPoliciesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil } func newServiceMetadataMiddleware_opListAccessPolicies(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/iotsitewise/api_op_ListAssetModels.go b/service/iotsitewise/api_op_ListAssetModels.go index f7b46b19039..ad53521435e 100644 --- a/service/iotsitewise/api_op_ListAssetModels.go +++ b/service/iotsitewise/api_op_ListAssetModels.go @@ -122,7 +122,7 @@ func (*endpointPrefix_opListAssetModelsMiddleware) ID() string { func (m *endpointPrefix_opListAssetModelsMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -131,12 +131,87 @@ func (m *endpointPrefix_opListAssetModelsMiddleware) HandleSerialize(ctx context return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "model." + req.URL.Host = "model." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opListAssetModelsMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opListAssetModelsMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opListAssetModelsMiddleware{}, `OperationSerializer`, middleware.After) +} + +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAssetModelsPaginator returns a new ListAssetModelsPaginator +func NewListAssetModelsPaginator(client ListAssetModelsAPIClient, params *ListAssetModelsInput, optFns ...func(*ListAssetModelsPaginatorOptions)) *ListAssetModelsPaginator { + options := ListAssetModelsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAssetModelsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil } func newServiceMetadataMiddleware_opListAssetModels(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/iotsitewise/api_op_ListAssets.go b/service/iotsitewise/api_op_ListAssets.go index bdaf5e5c362..56e8d0f0a21 100644 --- a/service/iotsitewise/api_op_ListAssets.go +++ b/service/iotsitewise/api_op_ListAssets.go @@ -150,7 +150,7 @@ func (*endpointPrefix_opListAssetsMiddleware) ID() string { func (m *endpointPrefix_opListAssetsMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -159,12 +159,86 @@ func (m *endpointPrefix_opListAssetsMiddleware) HandleSerialize(ctx context.Cont return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "model." + req.URL.Host = "model." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opListAssetsMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opListAssetsMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opListAssetsMiddleware{}, `OperationSerializer`, middleware.After) +} + +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAssetsPaginator returns a new ListAssetsPaginator +func NewListAssetsPaginator(client ListAssetsAPIClient, params *ListAssetsInput, optFns ...func(*ListAssetsPaginatorOptions)) *ListAssetsPaginator { + options := ListAssetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAssetsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil } func newServiceMetadataMiddleware_opListAssets(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/iotsitewise/api_op_ListAssociatedAssets.go b/service/iotsitewise/api_op_ListAssociatedAssets.go index 3c134b60f06..af1edf3630b 100644 --- a/service/iotsitewise/api_op_ListAssociatedAssets.go +++ b/service/iotsitewise/api_op_ListAssociatedAssets.go @@ -159,7 +159,7 @@ func (*endpointPrefix_opListAssociatedAssetsMiddleware) ID() string { func (m *endpointPrefix_opListAssociatedAssetsMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -168,12 +168,88 @@ func (m *endpointPrefix_opListAssociatedAssetsMiddleware) HandleSerialize(ctx co return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "model." + req.URL.Host = "model." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opListAssociatedAssetsMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opListAssociatedAssetsMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opListAssociatedAssetsMiddleware{}, `OperationSerializer`, middleware.After) +} + +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAssociatedAssetsPaginator returns a new ListAssociatedAssetsPaginator +func NewListAssociatedAssetsPaginator(client ListAssociatedAssetsAPIClient, params *ListAssociatedAssetsInput, optFns ...func(*ListAssociatedAssetsPaginatorOptions)) *ListAssociatedAssetsPaginator { + options := ListAssociatedAssetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAssociatedAssetsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil } func newServiceMetadataMiddleware_opListAssociatedAssets(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/iotsitewise/api_op_ListDashboards.go b/service/iotsitewise/api_op_ListDashboards.go index 41b55e2ea29..9f533acc02c 100644 --- a/service/iotsitewise/api_op_ListDashboards.go +++ b/service/iotsitewise/api_op_ListDashboards.go @@ -131,7 +131,7 @@ func (*endpointPrefix_opListDashboardsMiddleware) ID() string { func (m *endpointPrefix_opListDashboardsMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -140,12 +140,87 @@ func (m *endpointPrefix_opListDashboardsMiddleware) HandleSerialize(ctx context. return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "monitor." + req.URL.Host = "monitor." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opListDashboardsMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opListDashboardsMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opListDashboardsMiddleware{}, `OperationSerializer`, middleware.After) +} + +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDashboardsPaginator returns a new ListDashboardsPaginator +func NewListDashboardsPaginator(client ListDashboardsAPIClient, params *ListDashboardsInput, optFns ...func(*ListDashboardsPaginatorOptions)) *ListDashboardsPaginator { + options := ListDashboardsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDashboardsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil } func newServiceMetadataMiddleware_opListDashboards(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/iotsitewise/api_op_ListGateways.go b/service/iotsitewise/api_op_ListGateways.go index d3c99bab252..76994b469bf 100644 --- a/service/iotsitewise/api_op_ListGateways.go +++ b/service/iotsitewise/api_op_ListGateways.go @@ -122,7 +122,7 @@ func (*endpointPrefix_opListGatewaysMiddleware) ID() string { func (m *endpointPrefix_opListGatewaysMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -131,12 +131,86 @@ func (m *endpointPrefix_opListGatewaysMiddleware) HandleSerialize(ctx context.Co return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "edge." + req.URL.Host = "edge." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opListGatewaysMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opListGatewaysMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opListGatewaysMiddleware{}, `OperationSerializer`, middleware.After) +} + +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListGatewaysPaginator returns a new ListGatewaysPaginator +func NewListGatewaysPaginator(client ListGatewaysAPIClient, params *ListGatewaysInput, optFns ...func(*ListGatewaysPaginatorOptions)) *ListGatewaysPaginator { + options := ListGatewaysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListGatewaysInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil } func newServiceMetadataMiddleware_opListGateways(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/iotsitewise/api_op_ListPortals.go b/service/iotsitewise/api_op_ListPortals.go index 820c26abfe9..01233f77f3f 100644 --- a/service/iotsitewise/api_op_ListPortals.go +++ b/service/iotsitewise/api_op_ListPortals.go @@ -120,7 +120,7 @@ func (*endpointPrefix_opListPortalsMiddleware) ID() string { func (m *endpointPrefix_opListPortalsMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -129,12 +129,86 @@ func (m *endpointPrefix_opListPortalsMiddleware) HandleSerialize(ctx context.Con return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "monitor." + req.URL.Host = "monitor." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opListPortalsMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opListPortalsMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opListPortalsMiddleware{}, `OperationSerializer`, middleware.After) +} + +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListPortalsPaginator returns a new ListPortalsPaginator +func NewListPortalsPaginator(client ListPortalsAPIClient, params *ListPortalsInput, optFns ...func(*ListPortalsPaginatorOptions)) *ListPortalsPaginator { + options := ListPortalsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPortalsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil } func newServiceMetadataMiddleware_opListPortals(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/iotsitewise/api_op_ListProjectAssets.go b/service/iotsitewise/api_op_ListProjectAssets.go index cbbda67334e..3c8eb1591a1 100644 --- a/service/iotsitewise/api_op_ListProjectAssets.go +++ b/service/iotsitewise/api_op_ListProjectAssets.go @@ -130,7 +130,7 @@ func (*endpointPrefix_opListProjectAssetsMiddleware) ID() string { func (m *endpointPrefix_opListProjectAssetsMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -139,12 +139,87 @@ func (m *endpointPrefix_opListProjectAssetsMiddleware) HandleSerialize(ctx conte return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "monitor." + req.URL.Host = "monitor." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opListProjectAssetsMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opListProjectAssetsMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opListProjectAssetsMiddleware{}, `OperationSerializer`, middleware.After) +} + +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListProjectAssetsPaginator returns a new ListProjectAssetsPaginator +func NewListProjectAssetsPaginator(client ListProjectAssetsAPIClient, params *ListProjectAssetsInput, optFns ...func(*ListProjectAssetsPaginatorOptions)) *ListProjectAssetsPaginator { + options := ListProjectAssetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListProjectAssetsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil } func newServiceMetadataMiddleware_opListProjectAssets(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/iotsitewise/api_op_ListProjects.go b/service/iotsitewise/api_op_ListProjects.go index 915a340a25d..4c25d8806f1 100644 --- a/service/iotsitewise/api_op_ListProjects.go +++ b/service/iotsitewise/api_op_ListProjects.go @@ -130,7 +130,7 @@ func (*endpointPrefix_opListProjectsMiddleware) ID() string { func (m *endpointPrefix_opListProjectsMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -139,12 +139,86 @@ func (m *endpointPrefix_opListProjectsMiddleware) HandleSerialize(ctx context.Co return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "monitor." + req.URL.Host = "monitor." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opListProjectsMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opListProjectsMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opListProjectsMiddleware{}, `OperationSerializer`, middleware.After) +} + +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListProjectsPaginator returns a new ListProjectsPaginator +func NewListProjectsPaginator(client ListProjectsAPIClient, params *ListProjectsInput, optFns ...func(*ListProjectsPaginatorOptions)) *ListProjectsPaginator { + options := ListProjectsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListProjectsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil } func newServiceMetadataMiddleware_opListProjects(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/iotsitewise/api_op_PutLoggingOptions.go b/service/iotsitewise/api_op_PutLoggingOptions.go index 35a4a11b57b..e8d8ffd29c2 100644 --- a/service/iotsitewise/api_op_PutLoggingOptions.go +++ b/service/iotsitewise/api_op_PutLoggingOptions.go @@ -114,7 +114,7 @@ func (*endpointPrefix_opPutLoggingOptionsMiddleware) ID() string { func (m *endpointPrefix_opPutLoggingOptionsMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -123,12 +123,12 @@ func (m *endpointPrefix_opPutLoggingOptionsMiddleware) HandleSerialize(ctx conte return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "model." + req.URL.Host = "model." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opPutLoggingOptionsMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opPutLoggingOptionsMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opPutLoggingOptionsMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opPutLoggingOptions(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/iotsitewise/api_op_UpdateAccessPolicy.go b/service/iotsitewise/api_op_UpdateAccessPolicy.go index 72d04f5fe0f..8581d301563 100644 --- a/service/iotsitewise/api_op_UpdateAccessPolicy.go +++ b/service/iotsitewise/api_op_UpdateAccessPolicy.go @@ -141,7 +141,7 @@ func (*endpointPrefix_opUpdateAccessPolicyMiddleware) ID() string { func (m *endpointPrefix_opUpdateAccessPolicyMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -150,12 +150,12 @@ func (m *endpointPrefix_opUpdateAccessPolicyMiddleware) HandleSerialize(ctx cont return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "monitor." + req.URL.Host = "monitor." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opUpdateAccessPolicyMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opUpdateAccessPolicyMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opUpdateAccessPolicyMiddleware{}, `OperationSerializer`, middleware.After) } type idempotencyToken_initializeOpUpdateAccessPolicy struct { diff --git a/service/iotsitewise/api_op_UpdateAsset.go b/service/iotsitewise/api_op_UpdateAsset.go index d5e0c2f39d9..ca0a201c758 100644 --- a/service/iotsitewise/api_op_UpdateAsset.go +++ b/service/iotsitewise/api_op_UpdateAsset.go @@ -136,7 +136,7 @@ func (*endpointPrefix_opUpdateAssetMiddleware) ID() string { func (m *endpointPrefix_opUpdateAssetMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -145,12 +145,12 @@ func (m *endpointPrefix_opUpdateAssetMiddleware) HandleSerialize(ctx context.Con return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "model." + req.URL.Host = "model." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opUpdateAssetMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opUpdateAssetMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opUpdateAssetMiddleware{}, `OperationSerializer`, middleware.After) } type idempotencyToken_initializeOpUpdateAsset struct { diff --git a/service/iotsitewise/api_op_UpdateAssetModel.go b/service/iotsitewise/api_op_UpdateAssetModel.go index 313611bd034..0a81379a4ca 100644 --- a/service/iotsitewise/api_op_UpdateAssetModel.go +++ b/service/iotsitewise/api_op_UpdateAssetModel.go @@ -168,7 +168,7 @@ func (*endpointPrefix_opUpdateAssetModelMiddleware) ID() string { func (m *endpointPrefix_opUpdateAssetModelMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -177,12 +177,12 @@ func (m *endpointPrefix_opUpdateAssetModelMiddleware) HandleSerialize(ctx contex return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "model." + req.URL.Host = "model." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opUpdateAssetModelMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opUpdateAssetModelMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opUpdateAssetModelMiddleware{}, `OperationSerializer`, middleware.After) } type idempotencyToken_initializeOpUpdateAssetModel struct { diff --git a/service/iotsitewise/api_op_UpdateAssetProperty.go b/service/iotsitewise/api_op_UpdateAssetProperty.go index 62a63ed7411..733b9e9f887 100644 --- a/service/iotsitewise/api_op_UpdateAssetProperty.go +++ b/service/iotsitewise/api_op_UpdateAssetProperty.go @@ -149,7 +149,7 @@ func (*endpointPrefix_opUpdateAssetPropertyMiddleware) ID() string { func (m *endpointPrefix_opUpdateAssetPropertyMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -158,12 +158,12 @@ func (m *endpointPrefix_opUpdateAssetPropertyMiddleware) HandleSerialize(ctx con return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "model." + req.URL.Host = "model." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opUpdateAssetPropertyMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opUpdateAssetPropertyMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opUpdateAssetPropertyMiddleware{}, `OperationSerializer`, middleware.After) } type idempotencyToken_initializeOpUpdateAssetProperty struct { diff --git a/service/iotsitewise/api_op_UpdateDashboard.go b/service/iotsitewise/api_op_UpdateDashboard.go index 14bca9e7ad3..1c3923f3112 100644 --- a/service/iotsitewise/api_op_UpdateDashboard.go +++ b/service/iotsitewise/api_op_UpdateDashboard.go @@ -137,7 +137,7 @@ func (*endpointPrefix_opUpdateDashboardMiddleware) ID() string { func (m *endpointPrefix_opUpdateDashboardMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -146,12 +146,12 @@ func (m *endpointPrefix_opUpdateDashboardMiddleware) HandleSerialize(ctx context return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "monitor." + req.URL.Host = "monitor." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opUpdateDashboardMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opUpdateDashboardMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opUpdateDashboardMiddleware{}, `OperationSerializer`, middleware.After) } type idempotencyToken_initializeOpUpdateDashboard struct { diff --git a/service/iotsitewise/api_op_UpdateGateway.go b/service/iotsitewise/api_op_UpdateGateway.go index fbb3d44a03e..21e007854cb 100644 --- a/service/iotsitewise/api_op_UpdateGateway.go +++ b/service/iotsitewise/api_op_UpdateGateway.go @@ -118,7 +118,7 @@ func (*endpointPrefix_opUpdateGatewayMiddleware) ID() string { func (m *endpointPrefix_opUpdateGatewayMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -127,12 +127,12 @@ func (m *endpointPrefix_opUpdateGatewayMiddleware) HandleSerialize(ctx context.C return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "edge." + req.URL.Host = "edge." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opUpdateGatewayMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opUpdateGatewayMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opUpdateGatewayMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opUpdateGateway(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/iotsitewise/api_op_UpdateGatewayCapabilityConfiguration.go b/service/iotsitewise/api_op_UpdateGatewayCapabilityConfiguration.go index 306384de75d..d46345c5d0f 100644 --- a/service/iotsitewise/api_op_UpdateGatewayCapabilityConfiguration.go +++ b/service/iotsitewise/api_op_UpdateGatewayCapabilityConfiguration.go @@ -161,7 +161,7 @@ func (*endpointPrefix_opUpdateGatewayCapabilityConfigurationMiddleware) ID() str func (m *endpointPrefix_opUpdateGatewayCapabilityConfigurationMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -170,12 +170,12 @@ func (m *endpointPrefix_opUpdateGatewayCapabilityConfigurationMiddleware) Handle return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "edge." + req.URL.Host = "edge." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opUpdateGatewayCapabilityConfigurationMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opUpdateGatewayCapabilityConfigurationMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opUpdateGatewayCapabilityConfigurationMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opUpdateGatewayCapabilityConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/iotsitewise/api_op_UpdatePortal.go b/service/iotsitewise/api_op_UpdatePortal.go index 926eabfd0d3..c55fa8d85a1 100644 --- a/service/iotsitewise/api_op_UpdatePortal.go +++ b/service/iotsitewise/api_op_UpdatePortal.go @@ -162,7 +162,7 @@ func (*endpointPrefix_opUpdatePortalMiddleware) ID() string { func (m *endpointPrefix_opUpdatePortalMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -171,12 +171,12 @@ func (m *endpointPrefix_opUpdatePortalMiddleware) HandleSerialize(ctx context.Co return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "monitor." + req.URL.Host = "monitor." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opUpdatePortalMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opUpdatePortalMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opUpdatePortalMiddleware{}, `OperationSerializer`, middleware.After) } type idempotencyToken_initializeOpUpdatePortal struct { diff --git a/service/iotsitewise/api_op_UpdateProject.go b/service/iotsitewise/api_op_UpdateProject.go index 8bce53fe839..ee2c1304f4b 100644 --- a/service/iotsitewise/api_op_UpdateProject.go +++ b/service/iotsitewise/api_op_UpdateProject.go @@ -129,7 +129,7 @@ func (*endpointPrefix_opUpdateProjectMiddleware) ID() string { func (m *endpointPrefix_opUpdateProjectMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -138,12 +138,12 @@ func (m *endpointPrefix_opUpdateProjectMiddleware) HandleSerialize(ctx context.C return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "monitor." + req.URL.Host = "monitor." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opUpdateProjectMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opUpdateProjectMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opUpdateProjectMiddleware{}, `OperationSerializer`, middleware.After) } type idempotencyToken_initializeOpUpdateProject struct { diff --git a/service/iotsitewise/go.mod b/service/iotsitewise/go.mod index 4ae6bde30ab..6e3c19d4d83 100644 --- a/service/iotsitewise/go.mod +++ b/service/iotsitewise/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/iotsitewise/go.sum b/service/iotsitewise/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/iotsitewise/go.sum +++ b/service/iotsitewise/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index e0e9281350e..00000000000 --- a/service/iotsitewise/paginators.go +++ /dev/null @@ -1,835 +0,0 @@ -// 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/api_op_GetFlowTemplateRevisions.go b/service/iotthingsgraph/api_op_GetFlowTemplateRevisions.go index b7d974269b7..c1425c722e5 100644 --- a/service/iotthingsgraph/api_op_GetFlowTemplateRevisions.go +++ b/service/iotthingsgraph/api_op_GetFlowTemplateRevisions.go @@ -4,6 +4,7 @@ package iotthingsgraph import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iotthingsgraph/types" @@ -118,6 +119,83 @@ func addOperationGetFlowTemplateRevisionsMiddlewares(stack *middleware.Stack, op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetFlowTemplateRevisionsPaginator returns a new +// GetFlowTemplateRevisionsPaginator +func NewGetFlowTemplateRevisionsPaginator(client GetFlowTemplateRevisionsAPIClient, params *GetFlowTemplateRevisionsInput, optFns ...func(*GetFlowTemplateRevisionsPaginatorOptions)) *GetFlowTemplateRevisionsPaginator { + options := GetFlowTemplateRevisionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetFlowTemplateRevisionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetFlowTemplateRevisions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iotthingsgraph/api_op_GetSystemTemplateRevisions.go b/service/iotthingsgraph/api_op_GetSystemTemplateRevisions.go index 5e32e14d0b9..8926824128f 100644 --- a/service/iotthingsgraph/api_op_GetSystemTemplateRevisions.go +++ b/service/iotthingsgraph/api_op_GetSystemTemplateRevisions.go @@ -4,6 +4,7 @@ package iotthingsgraph import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iotthingsgraph/types" @@ -119,6 +120,83 @@ func addOperationGetSystemTemplateRevisionsMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetSystemTemplateRevisionsPaginator returns a new +// GetSystemTemplateRevisionsPaginator +func NewGetSystemTemplateRevisionsPaginator(client GetSystemTemplateRevisionsAPIClient, params *GetSystemTemplateRevisionsInput, optFns ...func(*GetSystemTemplateRevisionsPaginatorOptions)) *GetSystemTemplateRevisionsPaginator { + options := GetSystemTemplateRevisionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetSystemTemplateRevisionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetSystemTemplateRevisions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iotthingsgraph/api_op_ListFlowExecutionMessages.go b/service/iotthingsgraph/api_op_ListFlowExecutionMessages.go index b810910a202..4589aba66f7 100644 --- a/service/iotthingsgraph/api_op_ListFlowExecutionMessages.go +++ b/service/iotthingsgraph/api_op_ListFlowExecutionMessages.go @@ -4,6 +4,7 @@ package iotthingsgraph import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iotthingsgraph/types" @@ -116,6 +117,83 @@ func addOperationListFlowExecutionMessagesMiddlewares(stack *middleware.Stack, o return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListFlowExecutionMessagesPaginator returns a new +// ListFlowExecutionMessagesPaginator +func NewListFlowExecutionMessagesPaginator(client ListFlowExecutionMessagesAPIClient, params *ListFlowExecutionMessagesInput, optFns ...func(*ListFlowExecutionMessagesPaginatorOptions)) *ListFlowExecutionMessagesPaginator { + options := ListFlowExecutionMessagesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListFlowExecutionMessagesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListFlowExecutionMessages(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iotthingsgraph/api_op_ListTagsForResource.go b/service/iotthingsgraph/api_op_ListTagsForResource.go index 913ed1700b8..75608c49b0e 100644 --- a/service/iotthingsgraph/api_op_ListTagsForResource.go +++ b/service/iotthingsgraph/api_op_ListTagsForResource.go @@ -4,6 +4,7 @@ package iotthingsgraph import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iotthingsgraph/types" @@ -113,6 +114,82 @@ func addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator +func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator { + options := ListTagsForResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTagsForResourceInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iotthingsgraph/api_op_SearchEntities.go b/service/iotthingsgraph/api_op_SearchEntities.go index 8cc46fc7b36..de4fd0f8c80 100644 --- a/service/iotthingsgraph/api_op_SearchEntities.go +++ b/service/iotthingsgraph/api_op_SearchEntities.go @@ -4,6 +4,7 @@ package iotthingsgraph import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iotthingsgraph/types" @@ -127,6 +128,81 @@ func addOperationSearchEntitiesMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewSearchEntitiesPaginator returns a new SearchEntitiesPaginator +func NewSearchEntitiesPaginator(client SearchEntitiesAPIClient, params *SearchEntitiesInput, optFns ...func(*SearchEntitiesPaginatorOptions)) *SearchEntitiesPaginator { + options := SearchEntitiesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchEntitiesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearchEntities(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iotthingsgraph/api_op_SearchFlowExecutions.go b/service/iotthingsgraph/api_op_SearchFlowExecutions.go index 2d23b3cb318..adfccdfe962 100644 --- a/service/iotthingsgraph/api_op_SearchFlowExecutions.go +++ b/service/iotthingsgraph/api_op_SearchFlowExecutions.go @@ -4,6 +4,7 @@ package iotthingsgraph import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iotthingsgraph/types" @@ -125,6 +126,82 @@ func addOperationSearchFlowExecutionsMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewSearchFlowExecutionsPaginator returns a new SearchFlowExecutionsPaginator +func NewSearchFlowExecutionsPaginator(client SearchFlowExecutionsAPIClient, params *SearchFlowExecutionsInput, optFns ...func(*SearchFlowExecutionsPaginatorOptions)) *SearchFlowExecutionsPaginator { + options := SearchFlowExecutionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchFlowExecutionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearchFlowExecutions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iotthingsgraph/api_op_SearchFlowTemplates.go b/service/iotthingsgraph/api_op_SearchFlowTemplates.go index 9a128d98cc4..9a605cc0dea 100644 --- a/service/iotthingsgraph/api_op_SearchFlowTemplates.go +++ b/service/iotthingsgraph/api_op_SearchFlowTemplates.go @@ -4,6 +4,7 @@ package iotthingsgraph import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iotthingsgraph/types" @@ -114,6 +115,82 @@ func addOperationSearchFlowTemplatesMiddlewares(stack *middleware.Stack, options return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewSearchFlowTemplatesPaginator returns a new SearchFlowTemplatesPaginator +func NewSearchFlowTemplatesPaginator(client SearchFlowTemplatesAPIClient, params *SearchFlowTemplatesInput, optFns ...func(*SearchFlowTemplatesPaginatorOptions)) *SearchFlowTemplatesPaginator { + options := SearchFlowTemplatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchFlowTemplatesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearchFlowTemplates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iotthingsgraph/api_op_SearchSystemInstances.go b/service/iotthingsgraph/api_op_SearchSystemInstances.go index 0e4cef43b0b..794e57076d2 100644 --- a/service/iotthingsgraph/api_op_SearchSystemInstances.go +++ b/service/iotthingsgraph/api_op_SearchSystemInstances.go @@ -4,6 +4,7 @@ package iotthingsgraph import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iotthingsgraph/types" @@ -112,6 +113,82 @@ func addOperationSearchSystemInstancesMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewSearchSystemInstancesPaginator returns a new SearchSystemInstancesPaginator +func NewSearchSystemInstancesPaginator(client SearchSystemInstancesAPIClient, params *SearchSystemInstancesInput, optFns ...func(*SearchSystemInstancesPaginatorOptions)) *SearchSystemInstancesPaginator { + options := SearchSystemInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchSystemInstancesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearchSystemInstances(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iotthingsgraph/api_op_SearchSystemTemplates.go b/service/iotthingsgraph/api_op_SearchSystemTemplates.go index fefd9b5a327..cff8a9bf918 100644 --- a/service/iotthingsgraph/api_op_SearchSystemTemplates.go +++ b/service/iotthingsgraph/api_op_SearchSystemTemplates.go @@ -4,6 +4,7 @@ package iotthingsgraph import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iotthingsgraph/types" @@ -116,6 +117,82 @@ func addOperationSearchSystemTemplatesMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewSearchSystemTemplatesPaginator returns a new SearchSystemTemplatesPaginator +func NewSearchSystemTemplatesPaginator(client SearchSystemTemplatesAPIClient, params *SearchSystemTemplatesInput, optFns ...func(*SearchSystemTemplatesPaginatorOptions)) *SearchSystemTemplatesPaginator { + options := SearchSystemTemplatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchSystemTemplatesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearchSystemTemplates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iotthingsgraph/api_op_SearchThings.go b/service/iotthingsgraph/api_op_SearchThings.go index b2a0dc0b285..0b6728727d2 100644 --- a/service/iotthingsgraph/api_op_SearchThings.go +++ b/service/iotthingsgraph/api_op_SearchThings.go @@ -4,6 +4,7 @@ package iotthingsgraph import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iotthingsgraph/types" @@ -124,6 +125,80 @@ func addOperationSearchThingsMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewSearchThingsPaginator returns a new SearchThingsPaginator +func NewSearchThingsPaginator(client SearchThingsAPIClient, params *SearchThingsInput, optFns ...func(*SearchThingsPaginatorOptions)) *SearchThingsPaginator { + options := SearchThingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchThingsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearchThings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iotthingsgraph/go.mod b/service/iotthingsgraph/go.mod index 4c7ad3e4256..d6fbcb44150 100644 --- a/service/iotthingsgraph/go.mod +++ b/service/iotthingsgraph/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/iotthingsgraph/go.sum b/service/iotthingsgraph/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/iotthingsgraph/go.sum +++ b/service/iotthingsgraph/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index f92aff904e2..00000000000 --- a/service/iotthingsgraph/paginators.go +++ /dev/null @@ -1,768 +0,0 @@ -// 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/api_op_ListChannels.go b/service/ivs/api_op_ListChannels.go index 6b5908463e8..5d97f2b48f3 100644 --- a/service/ivs/api_op_ListChannels.go +++ b/service/ivs/api_op_ListChannels.go @@ -4,6 +4,7 @@ package ivs import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ivs/types" @@ -114,6 +115,80 @@ func addOperationListChannelsMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListChannelsPaginator returns a new ListChannelsPaginator +func NewListChannelsPaginator(client ListChannelsAPIClient, params *ListChannelsInput, optFns ...func(*ListChannelsPaginatorOptions)) *ListChannelsPaginator { + options := ListChannelsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListChannelsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListChannels(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ivs/api_op_ListPlaybackKeyPairs.go b/service/ivs/api_op_ListPlaybackKeyPairs.go index 4b56b01350b..1f5b4ae72e8 100644 --- a/service/ivs/api_op_ListPlaybackKeyPairs.go +++ b/service/ivs/api_op_ListPlaybackKeyPairs.go @@ -4,6 +4,7 @@ package ivs import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ivs/types" @@ -109,6 +110,83 @@ func addOperationListPlaybackKeyPairsMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListPlaybackKeyPairsPaginator returns a new ListPlaybackKeyPairsPaginator +func NewListPlaybackKeyPairsPaginator(client ListPlaybackKeyPairsAPIClient, params *ListPlaybackKeyPairsInput, optFns ...func(*ListPlaybackKeyPairsPaginatorOptions)) *ListPlaybackKeyPairsPaginator { + options := ListPlaybackKeyPairsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPlaybackKeyPairsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPlaybackKeyPairs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ivs/api_op_ListStreamKeys.go b/service/ivs/api_op_ListStreamKeys.go index 59c53f7d522..30974b0ed02 100644 --- a/service/ivs/api_op_ListStreamKeys.go +++ b/service/ivs/api_op_ListStreamKeys.go @@ -4,6 +4,7 @@ package ivs import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ivs/types" @@ -117,6 +118,81 @@ func addOperationListStreamKeysMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListStreamKeysPaginator returns a new ListStreamKeysPaginator +func NewListStreamKeysPaginator(client ListStreamKeysAPIClient, params *ListStreamKeysInput, optFns ...func(*ListStreamKeysPaginatorOptions)) *ListStreamKeysPaginator { + options := ListStreamKeysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListStreamKeysInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListStreamKeys(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ivs/api_op_ListStreams.go b/service/ivs/api_op_ListStreams.go index 7b9bd0a20f2..10c4f01f326 100644 --- a/service/ivs/api_op_ListStreams.go +++ b/service/ivs/api_op_ListStreams.go @@ -4,6 +4,7 @@ package ivs import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ivs/types" @@ -110,6 +111,80 @@ func addOperationListStreamsMiddlewares(stack *middleware.Stack, options Options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListStreamsPaginator returns a new ListStreamsPaginator +func NewListStreamsPaginator(client ListStreamsAPIClient, params *ListStreamsInput, optFns ...func(*ListStreamsPaginatorOptions)) *ListStreamsPaginator { + options := ListStreamsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListStreamsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListStreams(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ivs/api_op_ListTagsForResource.go b/service/ivs/api_op_ListTagsForResource.go index f0fc8e91536..395b56808a5 100644 --- a/service/ivs/api_op_ListTagsForResource.go +++ b/service/ivs/api_op_ListTagsForResource.go @@ -4,6 +4,7 @@ package ivs import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -112,6 +113,82 @@ func addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options return 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 { + // Maximum number of tags to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator +func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator { + options := ListTagsForResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTagsForResourceInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ivs/go.mod b/service/ivs/go.mod index 7e28d796fe3..49b3d3af460 100644 --- a/service/ivs/go.mod +++ b/service/ivs/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/ivs/go.sum b/service/ivs/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/ivs/go.sum +++ b/service/ivs/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index d6c964f89a3..00000000000 --- a/service/ivs/paginators.go +++ /dev/null @@ -1,384 +0,0 @@ -// 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/api_op_ListClusterOperations.go b/service/kafka/api_op_ListClusterOperations.go index 5caf98ad98f..7c50a69e38a 100644 --- a/service/kafka/api_op_ListClusterOperations.go +++ b/service/kafka/api_op_ListClusterOperations.go @@ -4,6 +4,7 @@ package kafka import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/kafka/types" @@ -119,6 +120,83 @@ func addOperationListClusterOperationsMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListClusterOperationsPaginator returns a new ListClusterOperationsPaginator +func NewListClusterOperationsPaginator(client ListClusterOperationsAPIClient, params *ListClusterOperationsInput, optFns ...func(*ListClusterOperationsPaginatorOptions)) *ListClusterOperationsPaginator { + options := ListClusterOperationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListClusterOperationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListClusterOperations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/kafka/api_op_ListClusters.go b/service/kafka/api_op_ListClusters.go index 7288a4394ab..39a88183600 100644 --- a/service/kafka/api_op_ListClusters.go +++ b/service/kafka/api_op_ListClusters.go @@ -4,6 +4,7 @@ package kafka import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/kafka/types" @@ -114,6 +115,81 @@ func addOperationListClustersMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListClustersPaginator returns a new ListClustersPaginator +func NewListClustersPaginator(client ListClustersAPIClient, params *ListClustersInput, optFns ...func(*ListClustersPaginatorOptions)) *ListClustersPaginator { + options := ListClustersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListClustersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListClusters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/kafka/api_op_ListConfigurationRevisions.go b/service/kafka/api_op_ListConfigurationRevisions.go index 2420e2c5c6e..0715401a0dd 100644 --- a/service/kafka/api_op_ListConfigurationRevisions.go +++ b/service/kafka/api_op_ListConfigurationRevisions.go @@ -4,6 +4,7 @@ package kafka import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/kafka/types" @@ -117,6 +118,84 @@ func addOperationListConfigurationRevisionsMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListConfigurationRevisionsPaginator returns a new +// ListConfigurationRevisionsPaginator +func NewListConfigurationRevisionsPaginator(client ListConfigurationRevisionsAPIClient, params *ListConfigurationRevisionsInput, optFns ...func(*ListConfigurationRevisionsPaginatorOptions)) *ListConfigurationRevisionsPaginator { + options := ListConfigurationRevisionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListConfigurationRevisionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListConfigurationRevisions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/kafka/api_op_ListConfigurations.go b/service/kafka/api_op_ListConfigurations.go index 6064e13f221..f4dee1d51cf 100644 --- a/service/kafka/api_op_ListConfigurations.go +++ b/service/kafka/api_op_ListConfigurations.go @@ -4,6 +4,7 @@ package kafka import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/kafka/types" @@ -110,6 +111,83 @@ func addOperationListConfigurationsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListConfigurationsPaginator returns a new ListConfigurationsPaginator +func NewListConfigurationsPaginator(client ListConfigurationsAPIClient, params *ListConfigurationsInput, optFns ...func(*ListConfigurationsPaginatorOptions)) *ListConfigurationsPaginator { + options := ListConfigurationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListConfigurationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListConfigurations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/kafka/api_op_ListKafkaVersions.go b/service/kafka/api_op_ListKafkaVersions.go index 3141de03b4f..9a0a427b6c6 100644 --- a/service/kafka/api_op_ListKafkaVersions.go +++ b/service/kafka/api_op_ListKafkaVersions.go @@ -4,6 +4,7 @@ package kafka import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/kafka/types" @@ -105,6 +106,82 @@ func addOperationListKafkaVersionsMiddlewares(stack *middleware.Stack, options O return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListKafkaVersionsPaginator returns a new ListKafkaVersionsPaginator +func NewListKafkaVersionsPaginator(client ListKafkaVersionsAPIClient, params *ListKafkaVersionsInput, optFns ...func(*ListKafkaVersionsPaginatorOptions)) *ListKafkaVersionsPaginator { + options := ListKafkaVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListKafkaVersionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListKafkaVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/kafka/api_op_ListNodes.go b/service/kafka/api_op_ListNodes.go index 516c7130f31..788b89c50b8 100644 --- a/service/kafka/api_op_ListNodes.go +++ b/service/kafka/api_op_ListNodes.go @@ -4,6 +4,7 @@ package kafka import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/kafka/types" @@ -118,6 +119,81 @@ func addOperationListNodesMiddlewares(stack *middleware.Stack, options Options) return 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 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListNodesPaginator returns a new ListNodesPaginator +func NewListNodesPaginator(client ListNodesAPIClient, params *ListNodesInput, optFns ...func(*ListNodesPaginatorOptions)) *ListNodesPaginator { + options := ListNodesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListNodesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListNodes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/kafka/api_op_ListScramSecrets.go b/service/kafka/api_op_ListScramSecrets.go index 396cdd5b3c4..aa23d9be3de 100644 --- a/service/kafka/api_op_ListScramSecrets.go +++ b/service/kafka/api_op_ListScramSecrets.go @@ -4,6 +4,7 @@ package kafka import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -112,6 +113,81 @@ func addOperationListScramSecretsMiddlewares(stack *middleware.Stack, options Op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListScramSecretsPaginator returns a new ListScramSecretsPaginator +func NewListScramSecretsPaginator(client ListScramSecretsAPIClient, params *ListScramSecretsInput, optFns ...func(*ListScramSecretsPaginatorOptions)) *ListScramSecretsPaginator { + options := ListScramSecretsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListScramSecretsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListScramSecrets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/kafka/go.mod b/service/kafka/go.mod index 1cb4ab3b8a1..453ad7b7cc5 100644 --- a/service/kafka/go.mod +++ b/service/kafka/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/kafka/go.sum b/service/kafka/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/kafka/go.sum +++ b/service/kafka/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 23e54e82a97..00000000000 --- a/service/kafka/paginators.go +++ /dev/null @@ -1,541 +0,0 @@ -// 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/api_op_ListDataSourceSyncJobs.go b/service/kendra/api_op_ListDataSourceSyncJobs.go index cef63ea0c57..ccde959425c 100644 --- a/service/kendra/api_op_ListDataSourceSyncJobs.go +++ b/service/kendra/api_op_ListDataSourceSyncJobs.go @@ -4,6 +4,7 @@ package kendra import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/kendra/types" @@ -132,6 +133,83 @@ func addOperationListDataSourceSyncJobsMiddlewares(stack *middleware.Stack, opti return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDataSourceSyncJobsPaginator returns a new ListDataSourceSyncJobsPaginator +func NewListDataSourceSyncJobsPaginator(client ListDataSourceSyncJobsAPIClient, params *ListDataSourceSyncJobsInput, optFns ...func(*ListDataSourceSyncJobsPaginatorOptions)) *ListDataSourceSyncJobsPaginator { + options := ListDataSourceSyncJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDataSourceSyncJobsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDataSourceSyncJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/kendra/api_op_ListDataSources.go b/service/kendra/api_op_ListDataSources.go index 6f16fedff7b..85a8be32897 100644 --- a/service/kendra/api_op_ListDataSources.go +++ b/service/kendra/api_op_ListDataSources.go @@ -4,6 +4,7 @@ package kendra import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/kendra/types" @@ -117,6 +118,81 @@ func addOperationListDataSourcesMiddlewares(stack *middleware.Stack, options Opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDataSourcesPaginator returns a new ListDataSourcesPaginator +func NewListDataSourcesPaginator(client ListDataSourcesAPIClient, params *ListDataSourcesInput, optFns ...func(*ListDataSourcesPaginatorOptions)) *ListDataSourcesPaginator { + options := ListDataSourcesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDataSourcesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDataSources(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/kendra/api_op_ListIndices.go b/service/kendra/api_op_ListIndices.go index 6826dad6c79..81fc25aef15 100644 --- a/service/kendra/api_op_ListIndices.go +++ b/service/kendra/api_op_ListIndices.go @@ -4,6 +4,7 @@ package kendra import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/kendra/types" @@ -109,6 +110,80 @@ func addOperationListIndicesMiddlewares(stack *middleware.Stack, options Options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListIndicesPaginator returns a new ListIndicesPaginator +func NewListIndicesPaginator(client ListIndicesAPIClient, params *ListIndicesInput, optFns ...func(*ListIndicesPaginatorOptions)) *ListIndicesPaginator { + options := ListIndicesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListIndicesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListIndices(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/kendra/go.mod b/service/kendra/go.mod index dec2d0b8ab6..df37cbbab06 100644 --- a/service/kendra/go.mod +++ b/service/kendra/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/kendra/go.sum b/service/kendra/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/kendra/go.sum +++ b/service/kendra/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 353a832596a..00000000000 --- a/service/kendra/paginators.go +++ /dev/null @@ -1,234 +0,0 @@ -// 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/api_op_ListStreamConsumers.go b/service/kinesis/api_op_ListStreamConsumers.go index 4b730e42d04..c2721eded27 100644 --- a/service/kinesis/api_op_ListStreamConsumers.go +++ b/service/kinesis/api_op_ListStreamConsumers.go @@ -4,6 +4,7 @@ package kinesis import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/kinesis/types" @@ -153,6 +154,83 @@ func addOperationListStreamConsumersMiddlewares(stack *middleware.Stack, options return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListStreamConsumersPaginator returns a new ListStreamConsumersPaginator +func NewListStreamConsumersPaginator(client ListStreamConsumersAPIClient, params *ListStreamConsumersInput, optFns ...func(*ListStreamConsumersPaginatorOptions)) *ListStreamConsumersPaginator { + options := ListStreamConsumersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListStreamConsumersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListStreamConsumers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/kinesis/go.mod b/service/kinesis/go.mod index 2ab6af87371..be298fe5139 100644 --- a/service/kinesis/go.mod +++ b/service/kinesis/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/kinesis/go.sum b/service/kinesis/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/kinesis/go.sum +++ b/service/kinesis/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index abf69ce2157..00000000000 --- a/service/kinesis/paginators.go +++ /dev/null @@ -1,85 +0,0 @@ -// 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.mod b/service/kinesisanalytics/go.mod index d42d0fde131..27fb842826e 100644 --- a/service/kinesisanalytics/go.mod +++ b/service/kinesisanalytics/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/kinesisanalytics/go.sum b/service/kinesisanalytics/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/kinesisanalytics/go.sum +++ b/service/kinesisanalytics/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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.mod b/service/kinesisanalyticsv2/go.mod index 0390a0552fa..e2375bdc651 100644 --- a/service/kinesisanalyticsv2/go.mod +++ b/service/kinesisanalyticsv2/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/kinesisanalyticsv2/go.sum b/service/kinesisanalyticsv2/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/kinesisanalyticsv2/go.sum +++ b/service/kinesisanalyticsv2/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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/api_op_ListSignalingChannels.go b/service/kinesisvideo/api_op_ListSignalingChannels.go index 1c13d12d5d1..d3434ab824a 100644 --- a/service/kinesisvideo/api_op_ListSignalingChannels.go +++ b/service/kinesisvideo/api_op_ListSignalingChannels.go @@ -4,6 +4,7 @@ package kinesisvideo import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/kinesisvideo/types" @@ -113,6 +114,82 @@ func addOperationListSignalingChannelsMiddlewares(stack *middleware.Stack, optio return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListSignalingChannelsPaginator returns a new ListSignalingChannelsPaginator +func NewListSignalingChannelsPaginator(client ListSignalingChannelsAPIClient, params *ListSignalingChannelsInput, optFns ...func(*ListSignalingChannelsPaginatorOptions)) *ListSignalingChannelsPaginator { + options := ListSignalingChannelsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSignalingChannelsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSignalingChannels(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/kinesisvideo/api_op_ListStreams.go b/service/kinesisvideo/api_op_ListStreams.go index 8c66f9b7b3e..797f349688e 100644 --- a/service/kinesisvideo/api_op_ListStreams.go +++ b/service/kinesisvideo/api_op_ListStreams.go @@ -4,6 +4,7 @@ package kinesisvideo import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/kinesisvideo/types" @@ -114,6 +115,80 @@ func addOperationListStreamsMiddlewares(stack *middleware.Stack, options Options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListStreamsPaginator returns a new ListStreamsPaginator +func NewListStreamsPaginator(client ListStreamsAPIClient, params *ListStreamsInput, optFns ...func(*ListStreamsPaginatorOptions)) *ListStreamsPaginator { + options := ListStreamsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListStreamsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListStreams(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/kinesisvideo/go.mod b/service/kinesisvideo/go.mod index 5c0990288d6..b944c26ee64 100644 --- a/service/kinesisvideo/go.mod +++ b/service/kinesisvideo/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/kinesisvideo/go.sum b/service/kinesisvideo/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/kinesisvideo/go.sum +++ b/service/kinesisvideo/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 05c6b8fd802..00000000000 --- a/service/kinesisvideo/paginators.go +++ /dev/null @@ -1,158 +0,0 @@ -// 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.mod b/service/kinesisvideoarchivedmedia/go.mod index 813c84d16c0..3242d91f8b0 100644 --- a/service/kinesisvideoarchivedmedia/go.mod +++ b/service/kinesisvideoarchivedmedia/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/kinesisvideoarchivedmedia/go.sum b/service/kinesisvideoarchivedmedia/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/kinesisvideoarchivedmedia/go.sum +++ b/service/kinesisvideoarchivedmedia/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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.mod b/service/kinesisvideomedia/go.mod index 8573111193c..48e911d9edd 100644 --- a/service/kinesisvideomedia/go.mod +++ b/service/kinesisvideomedia/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/kinesisvideomedia/go.sum b/service/kinesisvideomedia/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/kinesisvideomedia/go.sum +++ b/service/kinesisvideomedia/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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.mod b/service/kinesisvideosignaling/go.mod index 15756e3c7d3..3738da8329e 100644 --- a/service/kinesisvideosignaling/go.mod +++ b/service/kinesisvideosignaling/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/kinesisvideosignaling/go.sum b/service/kinesisvideosignaling/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/kinesisvideosignaling/go.sum +++ b/service/kinesisvideosignaling/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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/api_op_ListAliases.go b/service/kms/api_op_ListAliases.go index 03998f7d869..cd1d4684c45 100644 --- a/service/kms/api_op_ListAliases.go +++ b/service/kms/api_op_ListAliases.go @@ -4,6 +4,7 @@ package kms import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/kms/types" @@ -137,6 +138,84 @@ func addOperationListAliasesMiddlewares(stack *middleware.Stack, options Options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAliasesPaginator returns a new ListAliasesPaginator +func NewListAliasesPaginator(client ListAliasesAPIClient, params *ListAliasesInput, optFns ...func(*ListAliasesPaginatorOptions)) *ListAliasesPaginator { + options := ListAliasesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAliasesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAliases(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/kms/api_op_ListGrants.go b/service/kms/api_op_ListGrants.go index 49722367671..2cfefaeda0f 100644 --- a/service/kms/api_op_ListGrants.go +++ b/service/kms/api_op_ListGrants.go @@ -4,6 +4,7 @@ package kms import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/kms/types" @@ -144,6 +145,84 @@ func addOperationListGrantsMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListGrantsPaginator returns a new ListGrantsPaginator +func NewListGrantsPaginator(client ListGrantsAPIClient, params *ListGrantsInput, optFns ...func(*ListGrantsPaginatorOptions)) *ListGrantsPaginator { + options := ListGrantsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListGrantsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListGrants(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/kms/api_op_ListKeyPolicies.go b/service/kms/api_op_ListKeyPolicies.go index d34db82b00d..a0866427acd 100644 --- a/service/kms/api_op_ListKeyPolicies.go +++ b/service/kms/api_op_ListKeyPolicies.go @@ -4,6 +4,7 @@ package kms import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -138,6 +139,85 @@ func addOperationListKeyPoliciesMiddlewares(stack *middleware.Stack, options Opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListKeyPoliciesPaginator returns a new ListKeyPoliciesPaginator +func NewListKeyPoliciesPaginator(client ListKeyPoliciesAPIClient, params *ListKeyPoliciesInput, optFns ...func(*ListKeyPoliciesPaginatorOptions)) *ListKeyPoliciesPaginator { + options := ListKeyPoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListKeyPoliciesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListKeyPolicies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/kms/api_op_ListKeys.go b/service/kms/api_op_ListKeys.go index 309c9883eee..a757df31286 100644 --- a/service/kms/api_op_ListKeys.go +++ b/service/kms/api_op_ListKeys.go @@ -4,6 +4,7 @@ package kms import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/kms/types" @@ -119,6 +120,84 @@ func addOperationListKeysMiddlewares(stack *middleware.Stack, options Options) ( return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListKeysPaginator returns a new ListKeysPaginator +func NewListKeysPaginator(client ListKeysAPIClient, params *ListKeysInput, optFns ...func(*ListKeysPaginatorOptions)) *ListKeysPaginator { + options := ListKeysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListKeysInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListKeys(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/kms/go.mod b/service/kms/go.mod index 7a5a21c71d2..8ffd5b4e161 100644 --- a/service/kms/go.mod +++ b/service/kms/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/kms/go.sum b/service/kms/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/kms/go.sum +++ b/service/kms/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index d34bb61ef28..00000000000 --- a/service/kms/paginators.go +++ /dev/null @@ -1,321 +0,0 @@ -// 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/api_op_GetEffectivePermissionsForPath.go b/service/lakeformation/api_op_GetEffectivePermissionsForPath.go index e7a4a76c02e..e74562d2745 100644 --- a/service/lakeformation/api_op_GetEffectivePermissionsForPath.go +++ b/service/lakeformation/api_op_GetEffectivePermissionsForPath.go @@ -4,6 +4,7 @@ package lakeformation import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/lakeformation/types" @@ -123,6 +124,83 @@ func addOperationGetEffectivePermissionsForPathMiddlewares(stack *middleware.Sta return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetEffectivePermissionsForPathPaginator returns a new +// GetEffectivePermissionsForPathPaginator +func NewGetEffectivePermissionsForPathPaginator(client GetEffectivePermissionsForPathAPIClient, params *GetEffectivePermissionsForPathInput, optFns ...func(*GetEffectivePermissionsForPathPaginatorOptions)) *GetEffectivePermissionsForPathPaginator { + options := GetEffectivePermissionsForPathPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetEffectivePermissionsForPathInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetEffectivePermissionsForPath(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/lakeformation/api_op_ListPermissions.go b/service/lakeformation/api_op_ListPermissions.go index 01242943211..b8dadb73770 100644 --- a/service/lakeformation/api_op_ListPermissions.go +++ b/service/lakeformation/api_op_ListPermissions.go @@ -4,6 +4,7 @@ package lakeformation import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/lakeformation/types" @@ -133,6 +134,81 @@ func addOperationListPermissionsMiddlewares(stack *middleware.Stack, options Opt return 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 { + // The maximum number of results to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListPermissionsPaginator returns a new ListPermissionsPaginator +func NewListPermissionsPaginator(client ListPermissionsAPIClient, params *ListPermissionsInput, optFns ...func(*ListPermissionsPaginatorOptions)) *ListPermissionsPaginator { + options := ListPermissionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPermissionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPermissions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/lakeformation/api_op_ListResources.go b/service/lakeformation/api_op_ListResources.go index 3ca9ae71015..819281984dd 100644 --- a/service/lakeformation/api_op_ListResources.go +++ b/service/lakeformation/api_op_ListResources.go @@ -4,6 +4,7 @@ package lakeformation import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/lakeformation/types" @@ -109,6 +110,80 @@ func addOperationListResourcesMiddlewares(stack *middleware.Stack, options Optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListResourcesPaginator returns a new ListResourcesPaginator +func NewListResourcesPaginator(client ListResourcesAPIClient, params *ListResourcesInput, optFns ...func(*ListResourcesPaginatorOptions)) *ListResourcesPaginator { + options := ListResourcesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListResourcesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListResources(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/lakeformation/go.mod b/service/lakeformation/go.mod index 3bd9029a6e4..6b5b4a7dd6f 100644 --- a/service/lakeformation/go.mod +++ b/service/lakeformation/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/lakeformation/go.sum b/service/lakeformation/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/lakeformation/go.sum +++ b/service/lakeformation/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 2ae6d49f609..00000000000 --- a/service/lakeformation/paginators.go +++ /dev/null @@ -1,234 +0,0 @@ -// 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/api_op_ListAliases.go b/service/lambda/api_op_ListAliases.go index ad1e3a37d13..2e4d93847c4 100644 --- a/service/lambda/api_op_ListAliases.go +++ b/service/lambda/api_op_ListAliases.go @@ -4,6 +4,7 @@ package lambda import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/lambda/types" @@ -131,6 +132,80 @@ func addOperationListAliasesMiddlewares(stack *middleware.Stack, options Options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAliasesPaginator returns a new ListAliasesPaginator +func NewListAliasesPaginator(client ListAliasesAPIClient, params *ListAliasesInput, optFns ...func(*ListAliasesPaginatorOptions)) *ListAliasesPaginator { + options := ListAliasesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAliasesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAliases(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/lambda/api_op_ListEventSourceMappings.go b/service/lambda/api_op_ListEventSourceMappings.go index e9e356ccef3..d2a8c6c3138 100644 --- a/service/lambda/api_op_ListEventSourceMappings.go +++ b/service/lambda/api_op_ListEventSourceMappings.go @@ -4,6 +4,7 @@ package lambda import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/lambda/types" @@ -140,6 +141,83 @@ func addOperationListEventSourceMappingsMiddlewares(stack *middleware.Stack, opt return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListEventSourceMappingsPaginator returns a new +// ListEventSourceMappingsPaginator +func NewListEventSourceMappingsPaginator(client ListEventSourceMappingsAPIClient, params *ListEventSourceMappingsInput, optFns ...func(*ListEventSourceMappingsPaginatorOptions)) *ListEventSourceMappingsPaginator { + options := ListEventSourceMappingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListEventSourceMappingsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListEventSourceMappings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/lambda/api_op_ListFunctionEventInvokeConfigs.go b/service/lambda/api_op_ListFunctionEventInvokeConfigs.go index 85226c3a481..6c0a6e86d80 100644 --- a/service/lambda/api_op_ListFunctionEventInvokeConfigs.go +++ b/service/lambda/api_op_ListFunctionEventInvokeConfigs.go @@ -4,6 +4,7 @@ package lambda import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/lambda/types" @@ -128,6 +129,83 @@ func addOperationListFunctionEventInvokeConfigsMiddlewares(stack *middleware.Sta return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListFunctionEventInvokeConfigsPaginator returns a new +// ListFunctionEventInvokeConfigsPaginator +func NewListFunctionEventInvokeConfigsPaginator(client ListFunctionEventInvokeConfigsAPIClient, params *ListFunctionEventInvokeConfigsInput, optFns ...func(*ListFunctionEventInvokeConfigsPaginatorOptions)) *ListFunctionEventInvokeConfigsPaginator { + options := ListFunctionEventInvokeConfigsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListFunctionEventInvokeConfigsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListFunctionEventInvokeConfigs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/lambda/api_op_ListFunctions.go b/service/lambda/api_op_ListFunctions.go index a32f1759f09..e9eefc514e0 100644 --- a/service/lambda/api_op_ListFunctions.go +++ b/service/lambda/api_op_ListFunctions.go @@ -4,6 +4,7 @@ package lambda import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/lambda/types" @@ -119,6 +120,80 @@ func addOperationListFunctionsMiddlewares(stack *middleware.Stack, options Optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListFunctionsPaginator returns a new ListFunctionsPaginator +func NewListFunctionsPaginator(client ListFunctionsAPIClient, params *ListFunctionsInput, optFns ...func(*ListFunctionsPaginatorOptions)) *ListFunctionsPaginator { + options := ListFunctionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListFunctionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListFunctions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/lambda/api_op_ListLayerVersions.go b/service/lambda/api_op_ListLayerVersions.go index 194abbf5d25..e13d20690c3 100644 --- a/service/lambda/api_op_ListLayerVersions.go +++ b/service/lambda/api_op_ListLayerVersions.go @@ -4,6 +4,7 @@ package lambda import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/lambda/types" @@ -120,6 +121,81 @@ func addOperationListLayerVersionsMiddlewares(stack *middleware.Stack, options O return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListLayerVersionsPaginator returns a new ListLayerVersionsPaginator +func NewListLayerVersionsPaginator(client ListLayerVersionsAPIClient, params *ListLayerVersionsInput, optFns ...func(*ListLayerVersionsPaginatorOptions)) *ListLayerVersionsPaginator { + options := ListLayerVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListLayerVersionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListLayerVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/lambda/api_op_ListLayers.go b/service/lambda/api_op_ListLayers.go index 32134e4c6e3..9155ba350ea 100644 --- a/service/lambda/api_op_ListLayers.go +++ b/service/lambda/api_op_ListLayers.go @@ -4,6 +4,7 @@ package lambda import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/lambda/types" @@ -112,6 +113,80 @@ func addOperationListLayersMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListLayersPaginator returns a new ListLayersPaginator +func NewListLayersPaginator(client ListLayersAPIClient, params *ListLayersInput, optFns ...func(*ListLayersPaginatorOptions)) *ListLayersPaginator { + options := ListLayersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListLayersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListLayers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/lambda/api_op_ListProvisionedConcurrencyConfigs.go b/service/lambda/api_op_ListProvisionedConcurrencyConfigs.go index 3b1fe542df7..9fc4136ac6b 100644 --- a/service/lambda/api_op_ListProvisionedConcurrencyConfigs.go +++ b/service/lambda/api_op_ListProvisionedConcurrencyConfigs.go @@ -4,6 +4,7 @@ package lambda import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/lambda/types" @@ -126,6 +127,83 @@ func addOperationListProvisionedConcurrencyConfigsMiddlewares(stack *middleware. return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListProvisionedConcurrencyConfigsPaginator returns a new +// ListProvisionedConcurrencyConfigsPaginator +func NewListProvisionedConcurrencyConfigsPaginator(client ListProvisionedConcurrencyConfigsAPIClient, params *ListProvisionedConcurrencyConfigsInput, optFns ...func(*ListProvisionedConcurrencyConfigsPaginatorOptions)) *ListProvisionedConcurrencyConfigsPaginator { + options := ListProvisionedConcurrencyConfigsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListProvisionedConcurrencyConfigsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListProvisionedConcurrencyConfigs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/lambda/api_op_ListVersionsByFunction.go b/service/lambda/api_op_ListVersionsByFunction.go index 4c4f1b51d03..6ea722d5f51 100644 --- a/service/lambda/api_op_ListVersionsByFunction.go +++ b/service/lambda/api_op_ListVersionsByFunction.go @@ -4,6 +4,7 @@ package lambda import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/lambda/types" @@ -129,6 +130,82 @@ func addOperationListVersionsByFunctionMiddlewares(stack *middleware.Stack, opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListVersionsByFunctionPaginator returns a new ListVersionsByFunctionPaginator +func NewListVersionsByFunctionPaginator(client ListVersionsByFunctionAPIClient, params *ListVersionsByFunctionInput, optFns ...func(*ListVersionsByFunctionPaginatorOptions)) *ListVersionsByFunctionPaginator { + options := ListVersionsByFunctionPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListVersionsByFunctionInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListVersionsByFunction(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/lambda/go.mod b/service/lambda/go.mod index 97f9353e3fd..db1d8d811e7 100644 --- a/service/lambda/go.mod +++ b/service/lambda/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/lambda/go.sum b/service/lambda/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/lambda/go.sum +++ b/service/lambda/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 26bb183b2e0..00000000000 --- a/service/lambda/paginators.go +++ /dev/null @@ -1,612 +0,0 @@ -// 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/api_op_GetBotAliases.go b/service/lexmodelbuildingservice/api_op_GetBotAliases.go index ac2c1c0e59b..ef46146cc9b 100644 --- a/service/lexmodelbuildingservice/api_op_GetBotAliases.go +++ b/service/lexmodelbuildingservice/api_op_GetBotAliases.go @@ -4,6 +4,7 @@ package lexmodelbuildingservice import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/lexmodelbuildingservice/types" @@ -125,6 +126,80 @@ func addOperationGetBotAliasesMiddlewares(stack *middleware.Stack, options Optio return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetBotAliasesPaginator returns a new GetBotAliasesPaginator +func NewGetBotAliasesPaginator(client GetBotAliasesAPIClient, params *GetBotAliasesInput, optFns ...func(*GetBotAliasesPaginatorOptions)) *GetBotAliasesPaginator { + options := GetBotAliasesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetBotAliasesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetBotAliases(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/lexmodelbuildingservice/api_op_GetBotChannelAssociations.go b/service/lexmodelbuildingservice/api_op_GetBotChannelAssociations.go index 4bdcdf617c7..c562e0c5be7 100644 --- a/service/lexmodelbuildingservice/api_op_GetBotChannelAssociations.go +++ b/service/lexmodelbuildingservice/api_op_GetBotChannelAssociations.go @@ -4,6 +4,7 @@ package lexmodelbuildingservice import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/lexmodelbuildingservice/types" @@ -134,6 +135,83 @@ func addOperationGetBotChannelAssociationsMiddlewares(stack *middleware.Stack, o return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetBotChannelAssociationsPaginator returns a new +// GetBotChannelAssociationsPaginator +func NewGetBotChannelAssociationsPaginator(client GetBotChannelAssociationsAPIClient, params *GetBotChannelAssociationsInput, optFns ...func(*GetBotChannelAssociationsPaginatorOptions)) *GetBotChannelAssociationsPaginator { + options := GetBotChannelAssociationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetBotChannelAssociationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetBotChannelAssociations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/lexmodelbuildingservice/api_op_GetBotVersions.go b/service/lexmodelbuildingservice/api_op_GetBotVersions.go index 4ce84dd7535..eabb62a74e9 100644 --- a/service/lexmodelbuildingservice/api_op_GetBotVersions.go +++ b/service/lexmodelbuildingservice/api_op_GetBotVersions.go @@ -4,6 +4,7 @@ package lexmodelbuildingservice import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/lexmodelbuildingservice/types" @@ -126,6 +127,81 @@ func addOperationGetBotVersionsMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetBotVersionsPaginator returns a new GetBotVersionsPaginator +func NewGetBotVersionsPaginator(client GetBotVersionsAPIClient, params *GetBotVersionsInput, optFns ...func(*GetBotVersionsPaginatorOptions)) *GetBotVersionsPaginator { + options := GetBotVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetBotVersionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetBotVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/lexmodelbuildingservice/api_op_GetBots.go b/service/lexmodelbuildingservice/api_op_GetBots.go index c10653f7135..95d248b6386 100644 --- a/service/lexmodelbuildingservice/api_op_GetBots.go +++ b/service/lexmodelbuildingservice/api_op_GetBots.go @@ -4,6 +4,7 @@ package lexmodelbuildingservice import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/lexmodelbuildingservice/types" @@ -123,6 +124,81 @@ func addOperationGetBotsMiddlewares(stack *middleware.Stack, options Options) (e return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetBotsPaginator returns a new GetBotsPaginator +func NewGetBotsPaginator(client GetBotsAPIClient, params *GetBotsInput, optFns ...func(*GetBotsPaginatorOptions)) *GetBotsPaginator { + options := GetBotsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetBotsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetBots(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/lexmodelbuildingservice/api_op_GetBuiltinIntents.go b/service/lexmodelbuildingservice/api_op_GetBuiltinIntents.go index aa0807605a7..91a23433b32 100644 --- a/service/lexmodelbuildingservice/api_op_GetBuiltinIntents.go +++ b/service/lexmodelbuildingservice/api_op_GetBuiltinIntents.go @@ -4,6 +4,7 @@ package lexmodelbuildingservice import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/lexmodelbuildingservice/types" @@ -122,6 +123,81 @@ func addOperationGetBuiltinIntentsMiddlewares(stack *middleware.Stack, options O return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetBuiltinIntentsPaginator returns a new GetBuiltinIntentsPaginator +func NewGetBuiltinIntentsPaginator(client GetBuiltinIntentsAPIClient, params *GetBuiltinIntentsInput, optFns ...func(*GetBuiltinIntentsPaginatorOptions)) *GetBuiltinIntentsPaginator { + options := GetBuiltinIntentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetBuiltinIntentsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetBuiltinIntents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/lexmodelbuildingservice/api_op_GetBuiltinSlotTypes.go b/service/lexmodelbuildingservice/api_op_GetBuiltinSlotTypes.go index ee9339a5da5..726f78066b9 100644 --- a/service/lexmodelbuildingservice/api_op_GetBuiltinSlotTypes.go +++ b/service/lexmodelbuildingservice/api_op_GetBuiltinSlotTypes.go @@ -4,6 +4,7 @@ package lexmodelbuildingservice import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/lexmodelbuildingservice/types" @@ -122,6 +123,82 @@ func addOperationGetBuiltinSlotTypesMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetBuiltinSlotTypesPaginator returns a new GetBuiltinSlotTypesPaginator +func NewGetBuiltinSlotTypesPaginator(client GetBuiltinSlotTypesAPIClient, params *GetBuiltinSlotTypesInput, optFns ...func(*GetBuiltinSlotTypesPaginatorOptions)) *GetBuiltinSlotTypesPaginator { + options := GetBuiltinSlotTypesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetBuiltinSlotTypesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetBuiltinSlotTypes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/lexmodelbuildingservice/api_op_GetIntentVersions.go b/service/lexmodelbuildingservice/api_op_GetIntentVersions.go index 39c44ff1cc5..c07a828f078 100644 --- a/service/lexmodelbuildingservice/api_op_GetIntentVersions.go +++ b/service/lexmodelbuildingservice/api_op_GetIntentVersions.go @@ -4,6 +4,7 @@ package lexmodelbuildingservice import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/lexmodelbuildingservice/types" @@ -127,6 +128,82 @@ func addOperationGetIntentVersionsMiddlewares(stack *middleware.Stack, options O return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetIntentVersionsPaginator returns a new GetIntentVersionsPaginator +func NewGetIntentVersionsPaginator(client GetIntentVersionsAPIClient, params *GetIntentVersionsInput, optFns ...func(*GetIntentVersionsPaginatorOptions)) *GetIntentVersionsPaginator { + options := GetIntentVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetIntentVersionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetIntentVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/lexmodelbuildingservice/api_op_GetIntents.go b/service/lexmodelbuildingservice/api_op_GetIntents.go index 5b4a1e7a236..54423f395a6 100644 --- a/service/lexmodelbuildingservice/api_op_GetIntents.go +++ b/service/lexmodelbuildingservice/api_op_GetIntents.go @@ -4,6 +4,7 @@ package lexmodelbuildingservice import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/lexmodelbuildingservice/types" @@ -124,6 +125,80 @@ func addOperationGetIntentsMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetIntentsPaginator returns a new GetIntentsPaginator +func NewGetIntentsPaginator(client GetIntentsAPIClient, params *GetIntentsInput, optFns ...func(*GetIntentsPaginatorOptions)) *GetIntentsPaginator { + options := GetIntentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetIntentsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetIntents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/lexmodelbuildingservice/api_op_GetSlotTypeVersions.go b/service/lexmodelbuildingservice/api_op_GetSlotTypeVersions.go index 2cca801502c..8e0e4704047 100644 --- a/service/lexmodelbuildingservice/api_op_GetSlotTypeVersions.go +++ b/service/lexmodelbuildingservice/api_op_GetSlotTypeVersions.go @@ -4,6 +4,7 @@ package lexmodelbuildingservice import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/lexmodelbuildingservice/types" @@ -127,6 +128,83 @@ func addOperationGetSlotTypeVersionsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetSlotTypeVersionsPaginator returns a new GetSlotTypeVersionsPaginator +func NewGetSlotTypeVersionsPaginator(client GetSlotTypeVersionsAPIClient, params *GetSlotTypeVersionsInput, optFns ...func(*GetSlotTypeVersionsPaginatorOptions)) *GetSlotTypeVersionsPaginator { + options := GetSlotTypeVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetSlotTypeVersionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetSlotTypeVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/lexmodelbuildingservice/api_op_GetSlotTypes.go b/service/lexmodelbuildingservice/api_op_GetSlotTypes.go index 8c5595d7f80..14815b245f7 100644 --- a/service/lexmodelbuildingservice/api_op_GetSlotTypes.go +++ b/service/lexmodelbuildingservice/api_op_GetSlotTypes.go @@ -4,6 +4,7 @@ package lexmodelbuildingservice import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/lexmodelbuildingservice/types" @@ -125,6 +126,80 @@ func addOperationGetSlotTypesMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetSlotTypesPaginator returns a new GetSlotTypesPaginator +func NewGetSlotTypesPaginator(client GetSlotTypesAPIClient, params *GetSlotTypesInput, optFns ...func(*GetSlotTypesPaginatorOptions)) *GetSlotTypesPaginator { + options := GetSlotTypesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetSlotTypesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetSlotTypes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/lexmodelbuildingservice/go.mod b/service/lexmodelbuildingservice/go.mod index 68f59736d11..7ef27297ee2 100644 --- a/service/lexmodelbuildingservice/go.mod +++ b/service/lexmodelbuildingservice/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/lexmodelbuildingservice/go.sum b/service/lexmodelbuildingservice/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/lexmodelbuildingservice/go.sum +++ b/service/lexmodelbuildingservice/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 116b6bda4ef..00000000000 --- a/service/lexmodelbuildingservice/paginators.go +++ /dev/null @@ -1,761 +0,0 @@ -// 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.mod b/service/lexruntimeservice/go.mod index e15464ca1ea..d44e3f68987 100644 --- a/service/lexruntimeservice/go.mod +++ b/service/lexruntimeservice/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/lexruntimeservice/go.sum b/service/lexruntimeservice/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/lexruntimeservice/go.sum +++ b/service/lexruntimeservice/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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.mod b/service/licensemanager/go.mod index f95ae99926d..edfa99adee0 100644 --- a/service/licensemanager/go.mod +++ b/service/licensemanager/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/licensemanager/go.sum b/service/licensemanager/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/licensemanager/go.sum +++ b/service/licensemanager/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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.mod b/service/lightsail/go.mod index 6c94f850ef5..1ac9c07fa46 100644 --- a/service/lightsail/go.mod +++ b/service/lightsail/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/lightsail/go.sum b/service/lightsail/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/lightsail/go.sum +++ b/service/lightsail/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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/api_op_DescribeBatchPredictions.go b/service/machinelearning/api_op_DescribeBatchPredictions.go index c9072f2f9f0..f56bd594f08 100644 --- a/service/machinelearning/api_op_DescribeBatchPredictions.go +++ b/service/machinelearning/api_op_DescribeBatchPredictions.go @@ -4,6 +4,7 @@ package machinelearning import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/machinelearning/types" @@ -187,6 +188,84 @@ func addOperationDescribeBatchPredictionsMiddlewares(stack *middleware.Stack, op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeBatchPredictionsPaginator returns a new +// DescribeBatchPredictionsPaginator +func NewDescribeBatchPredictionsPaginator(client DescribeBatchPredictionsAPIClient, params *DescribeBatchPredictionsInput, optFns ...func(*DescribeBatchPredictionsPaginatorOptions)) *DescribeBatchPredictionsPaginator { + options := DescribeBatchPredictionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeBatchPredictionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeBatchPredictions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/machinelearning/api_op_DescribeDataSources.go b/service/machinelearning/api_op_DescribeDataSources.go index 0762e50f2b3..2e1ec3f0656 100644 --- a/service/machinelearning/api_op_DescribeDataSources.go +++ b/service/machinelearning/api_op_DescribeDataSources.go @@ -4,6 +4,7 @@ package machinelearning import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/machinelearning/types" @@ -178,6 +179,82 @@ func addOperationDescribeDataSourcesMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeDataSourcesPaginator returns a new DescribeDataSourcesPaginator +func NewDescribeDataSourcesPaginator(client DescribeDataSourcesAPIClient, params *DescribeDataSourcesInput, optFns ...func(*DescribeDataSourcesPaginatorOptions)) *DescribeDataSourcesPaginator { + options := DescribeDataSourcesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDataSourcesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDataSources(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/machinelearning/api_op_DescribeEvaluations.go b/service/machinelearning/api_op_DescribeEvaluations.go index 69141724e50..1de3dc081a7 100644 --- a/service/machinelearning/api_op_DescribeEvaluations.go +++ b/service/machinelearning/api_op_DescribeEvaluations.go @@ -4,6 +4,7 @@ package machinelearning import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/machinelearning/types" @@ -185,6 +186,82 @@ func addOperationDescribeEvaluationsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeEvaluationsPaginator returns a new DescribeEvaluationsPaginator +func NewDescribeEvaluationsPaginator(client DescribeEvaluationsAPIClient, params *DescribeEvaluationsInput, optFns ...func(*DescribeEvaluationsPaginatorOptions)) *DescribeEvaluationsPaginator { + options := DescribeEvaluationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEvaluationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEvaluations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/machinelearning/api_op_DescribeMLModels.go b/service/machinelearning/api_op_DescribeMLModels.go index 6934ecd7439..0c6452e07fb 100644 --- a/service/machinelearning/api_op_DescribeMLModels.go +++ b/service/machinelearning/api_op_DescribeMLModels.go @@ -4,6 +4,7 @@ package machinelearning import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/machinelearning/types" @@ -190,6 +191,82 @@ func addOperationDescribeMLModelsMiddlewares(stack *middleware.Stack, options Op return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeMLModelsPaginator returns a new DescribeMLModelsPaginator +func NewDescribeMLModelsPaginator(client DescribeMLModelsAPIClient, params *DescribeMLModelsInput, optFns ...func(*DescribeMLModelsPaginatorOptions)) *DescribeMLModelsPaginator { + options := DescribeMLModelsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeMLModelsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeMLModels(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/machinelearning/go.mod b/service/machinelearning/go.mod index c0e224e2f35..484609e97d8 100644 --- a/service/machinelearning/go.mod +++ b/service/machinelearning/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/machinelearning/go.sum b/service/machinelearning/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/machinelearning/go.sum +++ b/service/machinelearning/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index a58bc1ed43d..00000000000 --- a/service/machinelearning/paginators.go +++ /dev/null @@ -1,314 +0,0 @@ -// 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/api_op_ListMemberAccounts.go b/service/macie/api_op_ListMemberAccounts.go index d10623b8a4e..8655bb79df1 100644 --- a/service/macie/api_op_ListMemberAccounts.go +++ b/service/macie/api_op_ListMemberAccounts.go @@ -4,6 +4,7 @@ package macie import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie/types" @@ -114,6 +115,83 @@ func addOperationListMemberAccountsMiddlewares(stack *middleware.Stack, options return 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 { + // 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListMemberAccountsPaginator returns a new ListMemberAccountsPaginator +func NewListMemberAccountsPaginator(client ListMemberAccountsAPIClient, params *ListMemberAccountsInput, optFns ...func(*ListMemberAccountsPaginatorOptions)) *ListMemberAccountsPaginator { + options := ListMemberAccountsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListMemberAccountsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListMemberAccounts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/macie/api_op_ListS3Resources.go b/service/macie/api_op_ListS3Resources.go index 66f054476c5..41702375d5e 100644 --- a/service/macie/api_op_ListS3Resources.go +++ b/service/macie/api_op_ListS3Resources.go @@ -4,6 +4,7 @@ package macie import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie/types" @@ -120,6 +121,82 @@ func addOperationListS3ResourcesMiddlewares(stack *middleware.Stack, options Opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListS3ResourcesPaginator returns a new ListS3ResourcesPaginator +func NewListS3ResourcesPaginator(client ListS3ResourcesAPIClient, params *ListS3ResourcesInput, optFns ...func(*ListS3ResourcesPaginatorOptions)) *ListS3ResourcesPaginator { + options := ListS3ResourcesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListS3ResourcesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListS3Resources(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/macie/go.mod b/service/macie/go.mod index bd83bc1d9cf..08573a6cba1 100644 --- a/service/macie/go.mod +++ b/service/macie/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/macie/go.sum b/service/macie/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/macie/go.sum +++ b/service/macie/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 7ad8d8d3375..00000000000 --- a/service/macie/paginators.go +++ /dev/null @@ -1,161 +0,0 @@ -// 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/api_op_DescribeBuckets.go b/service/macie2/api_op_DescribeBuckets.go index 72288a9a026..4125ed182fc 100644 --- a/service/macie2/api_op_DescribeBuckets.go +++ b/service/macie2/api_op_DescribeBuckets.go @@ -4,6 +4,7 @@ package macie2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" @@ -116,6 +117,82 @@ func addOperationDescribeBucketsMiddlewares(stack *middleware.Stack, options Opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeBucketsPaginator returns a new DescribeBucketsPaginator +func NewDescribeBucketsPaginator(client DescribeBucketsAPIClient, params *DescribeBucketsInput, optFns ...func(*DescribeBucketsPaginatorOptions)) *DescribeBucketsPaginator { + options := DescribeBucketsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeBucketsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeBuckets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/macie2/api_op_GetUsageStatistics.go b/service/macie2/api_op_GetUsageStatistics.go index 9775ae5a8be..f0ff4c92259 100644 --- a/service/macie2/api_op_GetUsageStatistics.go +++ b/service/macie2/api_op_GetUsageStatistics.go @@ -4,6 +4,7 @@ package macie2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" @@ -116,6 +117,82 @@ func addOperationGetUsageStatisticsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetUsageStatisticsPaginator returns a new GetUsageStatisticsPaginator +func NewGetUsageStatisticsPaginator(client GetUsageStatisticsAPIClient, params *GetUsageStatisticsInput, optFns ...func(*GetUsageStatisticsPaginatorOptions)) *GetUsageStatisticsPaginator { + options := GetUsageStatisticsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetUsageStatisticsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetUsageStatistics(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/macie2/api_op_ListClassificationJobs.go b/service/macie2/api_op_ListClassificationJobs.go index f8883d7db96..6605f99ab6a 100644 --- a/service/macie2/api_op_ListClassificationJobs.go +++ b/service/macie2/api_op_ListClassificationJobs.go @@ -4,6 +4,7 @@ package macie2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" @@ -114,6 +115,82 @@ func addOperationListClassificationJobsMiddlewares(stack *middleware.Stack, opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListClassificationJobsPaginator returns a new ListClassificationJobsPaginator +func NewListClassificationJobsPaginator(client ListClassificationJobsAPIClient, params *ListClassificationJobsInput, optFns ...func(*ListClassificationJobsPaginatorOptions)) *ListClassificationJobsPaginator { + options := ListClassificationJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListClassificationJobsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListClassificationJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/macie2/api_op_ListCustomDataIdentifiers.go b/service/macie2/api_op_ListCustomDataIdentifiers.go index 98b2e302333..80a53924771 100644 --- a/service/macie2/api_op_ListCustomDataIdentifiers.go +++ b/service/macie2/api_op_ListCustomDataIdentifiers.go @@ -4,6 +4,7 @@ package macie2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" @@ -108,6 +109,83 @@ func addOperationListCustomDataIdentifiersMiddlewares(stack *middleware.Stack, o return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListCustomDataIdentifiersPaginator returns a new +// ListCustomDataIdentifiersPaginator +func NewListCustomDataIdentifiersPaginator(client ListCustomDataIdentifiersAPIClient, params *ListCustomDataIdentifiersInput, optFns ...func(*ListCustomDataIdentifiersPaginatorOptions)) *ListCustomDataIdentifiersPaginator { + options := ListCustomDataIdentifiersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListCustomDataIdentifiersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListCustomDataIdentifiers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/macie2/api_op_ListFindings.go b/service/macie2/api_op_ListFindings.go index b7e0defbb21..48cb7715909 100644 --- a/service/macie2/api_op_ListFindings.go +++ b/service/macie2/api_op_ListFindings.go @@ -4,6 +4,7 @@ package macie2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" @@ -114,6 +115,80 @@ func addOperationListFindingsMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListFindingsPaginator returns a new ListFindingsPaginator +func NewListFindingsPaginator(client ListFindingsAPIClient, params *ListFindingsInput, optFns ...func(*ListFindingsPaginatorOptions)) *ListFindingsPaginator { + options := ListFindingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListFindingsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListFindings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/macie2/api_op_ListFindingsFilters.go b/service/macie2/api_op_ListFindingsFilters.go index cc8e99fff8b..bb43e6ac2e2 100644 --- a/service/macie2/api_op_ListFindingsFilters.go +++ b/service/macie2/api_op_ListFindingsFilters.go @@ -4,6 +4,7 @@ package macie2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" @@ -107,6 +108,82 @@ func addOperationListFindingsFiltersMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListFindingsFiltersPaginator returns a new ListFindingsFiltersPaginator +func NewListFindingsFiltersPaginator(client ListFindingsFiltersAPIClient, params *ListFindingsFiltersInput, optFns ...func(*ListFindingsFiltersPaginatorOptions)) *ListFindingsFiltersPaginator { + options := ListFindingsFiltersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListFindingsFiltersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListFindingsFilters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/macie2/api_op_ListInvitations.go b/service/macie2/api_op_ListInvitations.go index 2ea02fe7f9e..b0dccb7de2d 100644 --- a/service/macie2/api_op_ListInvitations.go +++ b/service/macie2/api_op_ListInvitations.go @@ -4,6 +4,7 @@ package macie2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" @@ -108,6 +109,81 @@ func addOperationListInvitationsMiddlewares(stack *middleware.Stack, options Opt return 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 items to include in each page of a paginated response. + Limit *int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListInvitationsPaginator returns a new ListInvitationsPaginator +func NewListInvitationsPaginator(client ListInvitationsAPIClient, params *ListInvitationsInput, optFns ...func(*ListInvitationsPaginatorOptions)) *ListInvitationsPaginator { + options := ListInvitationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListInvitationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListInvitations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/macie2/api_op_ListMembers.go b/service/macie2/api_op_ListMembers.go index 7cc3fc4599c..c76cc73686b 100644 --- a/service/macie2/api_op_ListMembers.go +++ b/service/macie2/api_op_ListMembers.go @@ -4,6 +4,7 @@ package macie2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" @@ -116,6 +117,80 @@ func addOperationListMembersMiddlewares(stack *middleware.Stack, options Options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListMembersPaginator returns a new ListMembersPaginator +func NewListMembersPaginator(client ListMembersAPIClient, params *ListMembersInput, optFns ...func(*ListMembersPaginatorOptions)) *ListMembersPaginator { + options := ListMembersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListMembersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListMembers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/macie2/api_op_ListOrganizationAdminAccounts.go b/service/macie2/api_op_ListOrganizationAdminAccounts.go index 4a3bb9abfad..7287fe6ce5b 100644 --- a/service/macie2/api_op_ListOrganizationAdminAccounts.go +++ b/service/macie2/api_op_ListOrganizationAdminAccounts.go @@ -4,6 +4,7 @@ package macie2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/macie2/types" @@ -109,6 +110,83 @@ func addOperationListOrganizationAdminAccountsMiddlewares(stack *middleware.Stac return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListOrganizationAdminAccountsPaginator returns a new +// ListOrganizationAdminAccountsPaginator +func NewListOrganizationAdminAccountsPaginator(client ListOrganizationAdminAccountsAPIClient, params *ListOrganizationAdminAccountsInput, optFns ...func(*ListOrganizationAdminAccountsPaginatorOptions)) *ListOrganizationAdminAccountsPaginator { + options := ListOrganizationAdminAccountsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListOrganizationAdminAccountsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListOrganizationAdminAccounts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/macie2/go.mod b/service/macie2/go.mod index af0c6ddcdbb..0b76af88371 100644 --- a/service/macie2/go.mod +++ b/service/macie2/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/macie2/go.sum b/service/macie2/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/macie2/go.sum +++ b/service/macie2/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 9bf9cf55f3b..00000000000 --- a/service/macie2/paginators.go +++ /dev/null @@ -1,689 +0,0 @@ -// 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/api_op_ListInvitations.go b/service/managedblockchain/api_op_ListInvitations.go index 11568aa3ea5..7163beb289a 100644 --- a/service/managedblockchain/api_op_ListInvitations.go +++ b/service/managedblockchain/api_op_ListInvitations.go @@ -4,6 +4,7 @@ package managedblockchain import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/managedblockchain/types" @@ -105,6 +106,81 @@ func addOperationListInvitationsMiddlewares(stack *middleware.Stack, options Opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListInvitationsPaginator returns a new ListInvitationsPaginator +func NewListInvitationsPaginator(client ListInvitationsAPIClient, params *ListInvitationsInput, optFns ...func(*ListInvitationsPaginatorOptions)) *ListInvitationsPaginator { + options := ListInvitationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListInvitationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListInvitations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/managedblockchain/api_op_ListMembers.go b/service/managedblockchain/api_op_ListMembers.go index de34e600c91..924573355a5 100644 --- a/service/managedblockchain/api_op_ListMembers.go +++ b/service/managedblockchain/api_op_ListMembers.go @@ -4,6 +4,7 @@ package managedblockchain import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/managedblockchain/types" @@ -127,6 +128,80 @@ func addOperationListMembersMiddlewares(stack *middleware.Stack, options Options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListMembersPaginator returns a new ListMembersPaginator +func NewListMembersPaginator(client ListMembersAPIClient, params *ListMembersInput, optFns ...func(*ListMembersPaginatorOptions)) *ListMembersPaginator { + options := ListMembersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListMembersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListMembers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/managedblockchain/api_op_ListNetworks.go b/service/managedblockchain/api_op_ListNetworks.go index 2171195ed6b..9a24e369638 100644 --- a/service/managedblockchain/api_op_ListNetworks.go +++ b/service/managedblockchain/api_op_ListNetworks.go @@ -4,6 +4,7 @@ package managedblockchain import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/managedblockchain/types" @@ -118,6 +119,80 @@ func addOperationListNetworksMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListNetworksPaginator returns a new ListNetworksPaginator +func NewListNetworksPaginator(client ListNetworksAPIClient, params *ListNetworksInput, optFns ...func(*ListNetworksPaginatorOptions)) *ListNetworksPaginator { + options := ListNetworksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListNetworksInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListNetworks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/managedblockchain/api_op_ListNodes.go b/service/managedblockchain/api_op_ListNodes.go index 81b2f222406..fd8c448c93c 100644 --- a/service/managedblockchain/api_op_ListNodes.go +++ b/service/managedblockchain/api_op_ListNodes.go @@ -4,6 +4,7 @@ package managedblockchain import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/managedblockchain/types" @@ -123,6 +124,80 @@ func addOperationListNodesMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListNodesPaginator returns a new ListNodesPaginator +func NewListNodesPaginator(client ListNodesAPIClient, params *ListNodesInput, optFns ...func(*ListNodesPaginatorOptions)) *ListNodesPaginator { + options := ListNodesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListNodesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListNodes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/managedblockchain/api_op_ListProposalVotes.go b/service/managedblockchain/api_op_ListProposalVotes.go index 5d19412740d..f32393ee52d 100644 --- a/service/managedblockchain/api_op_ListProposalVotes.go +++ b/service/managedblockchain/api_op_ListProposalVotes.go @@ -4,6 +4,7 @@ package managedblockchain import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/managedblockchain/types" @@ -119,6 +120,81 @@ func addOperationListProposalVotesMiddlewares(stack *middleware.Stack, options O return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListProposalVotesPaginator returns a new ListProposalVotesPaginator +func NewListProposalVotesPaginator(client ListProposalVotesAPIClient, params *ListProposalVotesInput, optFns ...func(*ListProposalVotesPaginatorOptions)) *ListProposalVotesPaginator { + options := ListProposalVotesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListProposalVotesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListProposalVotes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/managedblockchain/api_op_ListProposals.go b/service/managedblockchain/api_op_ListProposals.go index 6fe6dd54b79..fe2e6228b94 100644 --- a/service/managedblockchain/api_op_ListProposals.go +++ b/service/managedblockchain/api_op_ListProposals.go @@ -4,6 +4,7 @@ package managedblockchain import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/managedblockchain/types" @@ -113,6 +114,80 @@ func addOperationListProposalsMiddlewares(stack *middleware.Stack, options Optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListProposalsPaginator returns a new ListProposalsPaginator +func NewListProposalsPaginator(client ListProposalsAPIClient, params *ListProposalsInput, optFns ...func(*ListProposalsPaginatorOptions)) *ListProposalsPaginator { + options := ListProposalsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListProposalsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListProposals(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/managedblockchain/go.mod b/service/managedblockchain/go.mod index d4f6aded6d7..244c947aadb 100644 --- a/service/managedblockchain/go.mod +++ b/service/managedblockchain/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/managedblockchain/go.sum b/service/managedblockchain/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/managedblockchain/go.sum +++ b/service/managedblockchain/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index f5af00a053d..00000000000 --- a/service/managedblockchain/paginators.go +++ /dev/null @@ -1,454 +0,0 @@ -// 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/api_op_ListChangeSets.go b/service/marketplacecatalog/api_op_ListChangeSets.go index 419610184d6..a75b7b83b77 100644 --- a/service/marketplacecatalog/api_op_ListChangeSets.go +++ b/service/marketplacecatalog/api_op_ListChangeSets.go @@ -4,6 +4,7 @@ package marketplacecatalog import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/marketplacecatalog/types" @@ -126,6 +127,83 @@ func addOperationListChangeSetsMiddlewares(stack *middleware.Stack, options Opti return 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 { + // 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListChangeSetsPaginator returns a new ListChangeSetsPaginator +func NewListChangeSetsPaginator(client ListChangeSetsAPIClient, params *ListChangeSetsInput, optFns ...func(*ListChangeSetsPaginatorOptions)) *ListChangeSetsPaginator { + options := ListChangeSetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListChangeSetsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListChangeSets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/marketplacecatalog/api_op_ListEntities.go b/service/marketplacecatalog/api_op_ListEntities.go index b9d5385c995..d40062da6ab 100644 --- a/service/marketplacecatalog/api_op_ListEntities.go +++ b/service/marketplacecatalog/api_op_ListEntities.go @@ -4,6 +4,7 @@ package marketplacecatalog import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/marketplacecatalog/types" @@ -126,6 +127,81 @@ func addOperationListEntitiesMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListEntitiesPaginator returns a new ListEntitiesPaginator +func NewListEntitiesPaginator(client ListEntitiesAPIClient, params *ListEntitiesInput, optFns ...func(*ListEntitiesPaginatorOptions)) *ListEntitiesPaginator { + options := ListEntitiesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListEntitiesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListEntities(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/marketplacecatalog/go.mod b/service/marketplacecatalog/go.mod index da1ea95a36e..8835c8e67d0 100644 --- a/service/marketplacecatalog/go.mod +++ b/service/marketplacecatalog/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/marketplacecatalog/go.sum b/service/marketplacecatalog/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/marketplacecatalog/go.sum +++ b/service/marketplacecatalog/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 9c9400e032c..00000000000 --- a/service/marketplacecatalog/paginators.go +++ /dev/null @@ -1,160 +0,0 @@ -// 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.mod b/service/marketplacecommerceanalytics/go.mod index 7d6a8a5247b..d56688a9cc9 100644 --- a/service/marketplacecommerceanalytics/go.mod +++ b/service/marketplacecommerceanalytics/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/marketplacecommerceanalytics/go.sum b/service/marketplacecommerceanalytics/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/marketplacecommerceanalytics/go.sum +++ b/service/marketplacecommerceanalytics/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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.mod b/service/marketplaceentitlementservice/go.mod index baeb0222a06..c95dd7fdd8b 100644 --- a/service/marketplaceentitlementservice/go.mod +++ b/service/marketplaceentitlementservice/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/marketplaceentitlementservice/go.sum b/service/marketplaceentitlementservice/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/marketplaceentitlementservice/go.sum +++ b/service/marketplaceentitlementservice/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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.mod b/service/marketplacemetering/go.mod index 0aeb02db4f1..fb29ebb2b10 100644 --- a/service/marketplacemetering/go.mod +++ b/service/marketplacemetering/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/marketplacemetering/go.sum b/service/marketplacemetering/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/marketplacemetering/go.sum +++ b/service/marketplacemetering/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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/api_op_ListEntitlements.go b/service/mediaconnect/api_op_ListEntitlements.go index 07898a2c638..848cb417da0 100644 --- a/service/mediaconnect/api_op_ListEntitlements.go +++ b/service/mediaconnect/api_op_ListEntitlements.go @@ -4,6 +4,7 @@ package mediaconnect import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mediaconnect/types" @@ -120,6 +121,87 @@ func addOperationListEntitlementsMiddlewares(stack *middleware.Stack, options Op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListEntitlementsPaginator returns a new ListEntitlementsPaginator +func NewListEntitlementsPaginator(client ListEntitlementsAPIClient, params *ListEntitlementsInput, optFns ...func(*ListEntitlementsPaginatorOptions)) *ListEntitlementsPaginator { + options := ListEntitlementsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListEntitlementsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListEntitlements(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mediaconnect/api_op_ListFlows.go b/service/mediaconnect/api_op_ListFlows.go index 888540ea559..50bebe4c23b 100644 --- a/service/mediaconnect/api_op_ListFlows.go +++ b/service/mediaconnect/api_op_ListFlows.go @@ -4,6 +4,7 @@ package mediaconnect import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mediaconnect/types" @@ -120,6 +121,86 @@ func addOperationListFlowsMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListFlowsPaginator returns a new ListFlowsPaginator +func NewListFlowsPaginator(client ListFlowsAPIClient, params *ListFlowsInput, optFns ...func(*ListFlowsPaginatorOptions)) *ListFlowsPaginator { + options := ListFlowsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListFlowsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListFlows(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mediaconnect/api_op_ListOfferings.go b/service/mediaconnect/api_op_ListOfferings.go index 02089f64a5f..7bc6b9fd2b8 100644 --- a/service/mediaconnect/api_op_ListOfferings.go +++ b/service/mediaconnect/api_op_ListOfferings.go @@ -4,6 +4,7 @@ package mediaconnect import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mediaconnect/types" @@ -123,6 +124,86 @@ func addOperationListOfferingsMiddlewares(stack *middleware.Stack, options Optio return 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 { + // 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListOfferingsPaginator returns a new ListOfferingsPaginator +func NewListOfferingsPaginator(client ListOfferingsAPIClient, params *ListOfferingsInput, optFns ...func(*ListOfferingsPaginatorOptions)) *ListOfferingsPaginator { + options := ListOfferingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListOfferingsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListOfferings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mediaconnect/api_op_ListReservations.go b/service/mediaconnect/api_op_ListReservations.go index c3f7e9ad0b7..005698fb6c6 100644 --- a/service/mediaconnect/api_op_ListReservations.go +++ b/service/mediaconnect/api_op_ListReservations.go @@ -4,6 +4,7 @@ package mediaconnect import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mediaconnect/types" @@ -122,6 +123,87 @@ func addOperationListReservationsMiddlewares(stack *middleware.Stack, options Op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListReservationsPaginator returns a new ListReservationsPaginator +func NewListReservationsPaginator(client ListReservationsAPIClient, params *ListReservationsInput, optFns ...func(*ListReservationsPaginatorOptions)) *ListReservationsPaginator { + options := ListReservationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListReservationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListReservations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mediaconnect/go.mod b/service/mediaconnect/go.mod index d13c73d5e29..933f0c649de 100644 --- a/service/mediaconnect/go.mod +++ b/service/mediaconnect/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/mediaconnect/go.sum b/service/mediaconnect/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/mediaconnect/go.sum +++ b/service/mediaconnect/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index e2ebce3f3fe..00000000000 --- a/service/mediaconnect/paginators.go +++ /dev/null @@ -1,330 +0,0 @@ -// 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/api_op_DescribeEndpoints.go b/service/mediaconvert/api_op_DescribeEndpoints.go index 6bea28dfc08..7533ad70965 100644 --- a/service/mediaconvert/api_op_DescribeEndpoints.go +++ b/service/mediaconvert/api_op_DescribeEndpoints.go @@ -4,6 +4,7 @@ package mediaconvert import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mediaconvert/types" @@ -115,6 +116,82 @@ func addOperationDescribeEndpointsMiddlewares(stack *middleware.Stack, options O return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeEndpointsPaginator returns a new DescribeEndpointsPaginator +func NewDescribeEndpointsPaginator(client DescribeEndpointsAPIClient, params *DescribeEndpointsInput, optFns ...func(*DescribeEndpointsPaginatorOptions)) *DescribeEndpointsPaginator { + options := DescribeEndpointsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEndpointsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEndpoints(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mediaconvert/api_op_ListJobTemplates.go b/service/mediaconvert/api_op_ListJobTemplates.go index 2abaae01140..c9e141d5a0a 100644 --- a/service/mediaconvert/api_op_ListJobTemplates.go +++ b/service/mediaconvert/api_op_ListJobTemplates.go @@ -4,6 +4,7 @@ package mediaconvert import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mediaconvert/types" @@ -122,6 +123,82 @@ func addOperationListJobTemplatesMiddlewares(stack *middleware.Stack, options Op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListJobTemplatesPaginator returns a new ListJobTemplatesPaginator +func NewListJobTemplatesPaginator(client ListJobTemplatesAPIClient, params *ListJobTemplatesInput, optFns ...func(*ListJobTemplatesPaginatorOptions)) *ListJobTemplatesPaginator { + options := ListJobTemplatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListJobTemplatesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListJobTemplates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mediaconvert/api_op_ListJobs.go b/service/mediaconvert/api_op_ListJobs.go index 2fffd73a999..6daa7f718c0 100644 --- a/service/mediaconvert/api_op_ListJobs.go +++ b/service/mediaconvert/api_op_ListJobs.go @@ -4,6 +4,7 @@ package mediaconvert import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mediaconvert/types" @@ -120,6 +121,80 @@ func addOperationListJobsMiddlewares(stack *middleware.Stack, options Options) ( return 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 { + // 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListJobsPaginator returns a new ListJobsPaginator +func NewListJobsPaginator(client ListJobsAPIClient, params *ListJobsInput, optFns ...func(*ListJobsPaginatorOptions)) *ListJobsPaginator { + options := ListJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListJobsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mediaconvert/api_op_ListPresets.go b/service/mediaconvert/api_op_ListPresets.go index c4c239fd37d..a70dbf62e6b 100644 --- a/service/mediaconvert/api_op_ListPresets.go +++ b/service/mediaconvert/api_op_ListPresets.go @@ -4,6 +4,7 @@ package mediaconvert import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mediaconvert/types" @@ -121,6 +122,80 @@ func addOperationListPresetsMiddlewares(stack *middleware.Stack, options Options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListPresetsPaginator returns a new ListPresetsPaginator +func NewListPresetsPaginator(client ListPresetsAPIClient, params *ListPresetsInput, optFns ...func(*ListPresetsPaginatorOptions)) *ListPresetsPaginator { + options := ListPresetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPresetsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPresets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mediaconvert/api_op_ListQueues.go b/service/mediaconvert/api_op_ListQueues.go index a06e5286807..3e49bbefed8 100644 --- a/service/mediaconvert/api_op_ListQueues.go +++ b/service/mediaconvert/api_op_ListQueues.go @@ -4,6 +4,7 @@ package mediaconvert import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mediaconvert/types" @@ -117,6 +118,80 @@ func addOperationListQueuesMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListQueuesPaginator returns a new ListQueuesPaginator +func NewListQueuesPaginator(client ListQueuesAPIClient, params *ListQueuesInput, optFns ...func(*ListQueuesPaginatorOptions)) *ListQueuesPaginator { + options := ListQueuesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListQueuesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListQueues(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mediaconvert/go.mod b/service/mediaconvert/go.mod index f3f2944bcaf..a2617d94925 100644 --- a/service/mediaconvert/go.mod +++ b/service/mediaconvert/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/mediaconvert/go.sum b/service/mediaconvert/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/mediaconvert/go.sum +++ b/service/mediaconvert/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index d9d17d1bc52..00000000000 --- a/service/mediaconvert/paginators.go +++ /dev/null @@ -1,382 +0,0 @@ -// 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/api_op_DescribeSchedule.go b/service/medialive/api_op_DescribeSchedule.go index f2c7933c7b4..56ca04c2eed 100644 --- a/service/medialive/api_op_DescribeSchedule.go +++ b/service/medialive/api_op_DescribeSchedule.go @@ -4,6 +4,7 @@ package medialive import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/medialive/types" @@ -115,6 +116,81 @@ func addOperationDescribeScheduleMiddlewares(stack *middleware.Stack, options Op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeSchedulePaginator returns a new DescribeSchedulePaginator +func NewDescribeSchedulePaginator(client DescribeScheduleAPIClient, params *DescribeScheduleInput, optFns ...func(*DescribeSchedulePaginatorOptions)) *DescribeSchedulePaginator { + options := DescribeSchedulePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeScheduleInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeSchedule(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/medialive/api_op_ListChannels.go b/service/medialive/api_op_ListChannels.go index 1c427b1c247..828f7ea8135 100644 --- a/service/medialive/api_op_ListChannels.go +++ b/service/medialive/api_op_ListChannels.go @@ -4,6 +4,7 @@ package medialive import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/medialive/types" @@ -107,6 +108,80 @@ func addOperationListChannelsMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListChannelsPaginator returns a new ListChannelsPaginator +func NewListChannelsPaginator(client ListChannelsAPIClient, params *ListChannelsInput, optFns ...func(*ListChannelsPaginatorOptions)) *ListChannelsPaginator { + options := ListChannelsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListChannelsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListChannels(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/medialive/api_op_ListInputDeviceTransfers.go b/service/medialive/api_op_ListInputDeviceTransfers.go index 8ee856db9cb..ee91c909fb6 100644 --- a/service/medialive/api_op_ListInputDeviceTransfers.go +++ b/service/medialive/api_op_ListInputDeviceTransfers.go @@ -4,6 +4,7 @@ package medialive import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/medialive/types" @@ -117,6 +118,83 @@ func addOperationListInputDeviceTransfersMiddlewares(stack *middleware.Stack, op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListInputDeviceTransfersPaginator returns a new +// ListInputDeviceTransfersPaginator +func NewListInputDeviceTransfersPaginator(client ListInputDeviceTransfersAPIClient, params *ListInputDeviceTransfersInput, optFns ...func(*ListInputDeviceTransfersPaginatorOptions)) *ListInputDeviceTransfersPaginator { + options := ListInputDeviceTransfersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListInputDeviceTransfersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListInputDeviceTransfers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/medialive/api_op_ListInputDevices.go b/service/medialive/api_op_ListInputDevices.go index 0d6f9af478b..11e5999e06f 100644 --- a/service/medialive/api_op_ListInputDevices.go +++ b/service/medialive/api_op_ListInputDevices.go @@ -4,6 +4,7 @@ package medialive import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/medialive/types" @@ -107,6 +108,81 @@ func addOperationListInputDevicesMiddlewares(stack *middleware.Stack, options Op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListInputDevicesPaginator returns a new ListInputDevicesPaginator +func NewListInputDevicesPaginator(client ListInputDevicesAPIClient, params *ListInputDevicesInput, optFns ...func(*ListInputDevicesPaginatorOptions)) *ListInputDevicesPaginator { + options := ListInputDevicesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListInputDevicesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListInputDevices(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/medialive/api_op_ListInputSecurityGroups.go b/service/medialive/api_op_ListInputSecurityGroups.go index c4b3ff4e70c..e99d1d1939f 100644 --- a/service/medialive/api_op_ListInputSecurityGroups.go +++ b/service/medialive/api_op_ListInputSecurityGroups.go @@ -4,6 +4,7 @@ package medialive import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/medialive/types" @@ -107,6 +108,83 @@ func addOperationListInputSecurityGroupsMiddlewares(stack *middleware.Stack, opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListInputSecurityGroupsPaginator returns a new +// ListInputSecurityGroupsPaginator +func NewListInputSecurityGroupsPaginator(client ListInputSecurityGroupsAPIClient, params *ListInputSecurityGroupsInput, optFns ...func(*ListInputSecurityGroupsPaginatorOptions)) *ListInputSecurityGroupsPaginator { + options := ListInputSecurityGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListInputSecurityGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListInputSecurityGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/medialive/api_op_ListInputs.go b/service/medialive/api_op_ListInputs.go index 6e288914795..c33b7799bd4 100644 --- a/service/medialive/api_op_ListInputs.go +++ b/service/medialive/api_op_ListInputs.go @@ -4,6 +4,7 @@ package medialive import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/medialive/types" @@ -107,6 +108,80 @@ func addOperationListInputsMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListInputsPaginator returns a new ListInputsPaginator +func NewListInputsPaginator(client ListInputsAPIClient, params *ListInputsInput, optFns ...func(*ListInputsPaginatorOptions)) *ListInputsPaginator { + options := ListInputsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListInputsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListInputs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/medialive/api_op_ListMultiplexPrograms.go b/service/medialive/api_op_ListMultiplexPrograms.go index c7d4f9447e6..bc88a7e1f53 100644 --- a/service/medialive/api_op_ListMultiplexPrograms.go +++ b/service/medialive/api_op_ListMultiplexPrograms.go @@ -4,6 +4,7 @@ package medialive import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/medialive/types" @@ -115,6 +116,82 @@ func addOperationListMultiplexProgramsMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListMultiplexProgramsPaginator returns a new ListMultiplexProgramsPaginator +func NewListMultiplexProgramsPaginator(client ListMultiplexProgramsAPIClient, params *ListMultiplexProgramsInput, optFns ...func(*ListMultiplexProgramsPaginatorOptions)) *ListMultiplexProgramsPaginator { + options := ListMultiplexProgramsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListMultiplexProgramsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListMultiplexPrograms(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/medialive/api_op_ListMultiplexes.go b/service/medialive/api_op_ListMultiplexes.go index d47353b6c80..e7d54292a72 100644 --- a/service/medialive/api_op_ListMultiplexes.go +++ b/service/medialive/api_op_ListMultiplexes.go @@ -4,6 +4,7 @@ package medialive import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/medialive/types" @@ -107,6 +108,81 @@ func addOperationListMultiplexesMiddlewares(stack *middleware.Stack, options Opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListMultiplexesPaginator returns a new ListMultiplexesPaginator +func NewListMultiplexesPaginator(client ListMultiplexesAPIClient, params *ListMultiplexesInput, optFns ...func(*ListMultiplexesPaginatorOptions)) *ListMultiplexesPaginator { + options := ListMultiplexesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListMultiplexesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListMultiplexes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/medialive/api_op_ListOfferings.go b/service/medialive/api_op_ListOfferings.go index c3c706e2f8f..38c50c5919c 100644 --- a/service/medialive/api_op_ListOfferings.go +++ b/service/medialive/api_op_ListOfferings.go @@ -4,6 +4,7 @@ package medialive import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/medialive/types" @@ -138,6 +139,80 @@ func addOperationListOfferingsMiddlewares(stack *middleware.Stack, options Optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListOfferingsPaginator returns a new ListOfferingsPaginator +func NewListOfferingsPaginator(client ListOfferingsAPIClient, params *ListOfferingsInput, optFns ...func(*ListOfferingsPaginatorOptions)) *ListOfferingsPaginator { + options := ListOfferingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListOfferingsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListOfferings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/medialive/api_op_ListReservations.go b/service/medialive/api_op_ListReservations.go index a50096e5d4b..c1a51246723 100644 --- a/service/medialive/api_op_ListReservations.go +++ b/service/medialive/api_op_ListReservations.go @@ -4,6 +4,7 @@ package medialive import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/medialive/types" @@ -131,6 +132,81 @@ func addOperationListReservationsMiddlewares(stack *middleware.Stack, options Op return 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 { + // Placeholder documentation for MaxResults + Limit *int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListReservationsPaginator returns a new ListReservationsPaginator +func NewListReservationsPaginator(client ListReservationsAPIClient, params *ListReservationsInput, optFns ...func(*ListReservationsPaginatorOptions)) *ListReservationsPaginator { + options := ListReservationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListReservationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListReservations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/medialive/go.mod b/service/medialive/go.mod index 8189fdcd8e6..2177e2214fd 100644 --- a/service/medialive/go.mod +++ b/service/medialive/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/medialive/go.sum b/service/medialive/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/medialive/go.sum +++ b/service/medialive/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 40d13a74df1..00000000000 --- a/service/medialive/paginators.go +++ /dev/null @@ -1,760 +0,0 @@ -// 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/api_op_ListChannels.go b/service/mediapackage/api_op_ListChannels.go index dbd3d24c9de..6c73cc3503d 100644 --- a/service/mediapackage/api_op_ListChannels.go +++ b/service/mediapackage/api_op_ListChannels.go @@ -4,6 +4,7 @@ package mediapackage import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mediapackage/types" @@ -105,6 +106,80 @@ func addOperationListChannelsMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListChannelsPaginator returns a new ListChannelsPaginator +func NewListChannelsPaginator(client ListChannelsAPIClient, params *ListChannelsInput, optFns ...func(*ListChannelsPaginatorOptions)) *ListChannelsPaginator { + options := ListChannelsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListChannelsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListChannels(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mediapackage/api_op_ListHarvestJobs.go b/service/mediapackage/api_op_ListHarvestJobs.go index b20b0f72220..5255071ee78 100644 --- a/service/mediapackage/api_op_ListHarvestJobs.go +++ b/service/mediapackage/api_op_ListHarvestJobs.go @@ -4,6 +4,7 @@ package mediapackage import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mediapackage/types" @@ -112,6 +113,81 @@ func addOperationListHarvestJobsMiddlewares(stack *middleware.Stack, options Opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListHarvestJobsPaginator returns a new ListHarvestJobsPaginator +func NewListHarvestJobsPaginator(client ListHarvestJobsAPIClient, params *ListHarvestJobsInput, optFns ...func(*ListHarvestJobsPaginatorOptions)) *ListHarvestJobsPaginator { + options := ListHarvestJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListHarvestJobsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListHarvestJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mediapackage/api_op_ListOriginEndpoints.go b/service/mediapackage/api_op_ListOriginEndpoints.go index 7803e73aa48..2ea4e005614 100644 --- a/service/mediapackage/api_op_ListOriginEndpoints.go +++ b/service/mediapackage/api_op_ListOriginEndpoints.go @@ -4,6 +4,7 @@ package mediapackage import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mediapackage/types" @@ -109,6 +110,82 @@ func addOperationListOriginEndpointsMiddlewares(stack *middleware.Stack, options return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListOriginEndpointsPaginator returns a new ListOriginEndpointsPaginator +func NewListOriginEndpointsPaginator(client ListOriginEndpointsAPIClient, params *ListOriginEndpointsInput, optFns ...func(*ListOriginEndpointsPaginatorOptions)) *ListOriginEndpointsPaginator { + options := ListOriginEndpointsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListOriginEndpointsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListOriginEndpoints(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mediapackage/go.mod b/service/mediapackage/go.mod index c2602c3e651..55c02664942 100644 --- a/service/mediapackage/go.mod +++ b/service/mediapackage/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/mediapackage/go.sum b/service/mediapackage/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/mediapackage/go.sum +++ b/service/mediapackage/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 2e3af252220..00000000000 --- a/service/mediapackage/paginators.go +++ /dev/null @@ -1,233 +0,0 @@ -// 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/api_op_ListAssets.go b/service/mediapackagevod/api_op_ListAssets.go index 0de01470ecf..bf1949966ba 100644 --- a/service/mediapackagevod/api_op_ListAssets.go +++ b/service/mediapackagevod/api_op_ListAssets.go @@ -4,6 +4,7 @@ package mediapackagevod import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mediapackagevod/types" @@ -108,6 +109,80 @@ func addOperationListAssetsMiddlewares(stack *middleware.Stack, options Options) return 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 { + // Upper bound on number of records to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAssetsPaginator returns a new ListAssetsPaginator +func NewListAssetsPaginator(client ListAssetsAPIClient, params *ListAssetsInput, optFns ...func(*ListAssetsPaginatorOptions)) *ListAssetsPaginator { + options := ListAssetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAssetsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAssets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mediapackagevod/api_op_ListPackagingConfigurations.go b/service/mediapackagevod/api_op_ListPackagingConfigurations.go index bcd316c4116..8012556f09e 100644 --- a/service/mediapackagevod/api_op_ListPackagingConfigurations.go +++ b/service/mediapackagevod/api_op_ListPackagingConfigurations.go @@ -4,6 +4,7 @@ package mediapackagevod import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mediapackagevod/types" @@ -109,6 +110,83 @@ func addOperationListPackagingConfigurationsMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListPackagingConfigurationsPaginator returns a new +// ListPackagingConfigurationsPaginator +func NewListPackagingConfigurationsPaginator(client ListPackagingConfigurationsAPIClient, params *ListPackagingConfigurationsInput, optFns ...func(*ListPackagingConfigurationsPaginatorOptions)) *ListPackagingConfigurationsPaginator { + options := ListPackagingConfigurationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPackagingConfigurationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPackagingConfigurations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mediapackagevod/api_op_ListPackagingGroups.go b/service/mediapackagevod/api_op_ListPackagingGroups.go index eb2561cd510..fe7f2be5f05 100644 --- a/service/mediapackagevod/api_op_ListPackagingGroups.go +++ b/service/mediapackagevod/api_op_ListPackagingGroups.go @@ -4,6 +4,7 @@ package mediapackagevod import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mediapackagevod/types" @@ -105,6 +106,82 @@ func addOperationListPackagingGroupsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListPackagingGroupsPaginator returns a new ListPackagingGroupsPaginator +func NewListPackagingGroupsPaginator(client ListPackagingGroupsAPIClient, params *ListPackagingGroupsInput, optFns ...func(*ListPackagingGroupsPaginatorOptions)) *ListPackagingGroupsPaginator { + options := ListPackagingGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPackagingGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPackagingGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mediapackagevod/go.mod b/service/mediapackagevod/go.mod index 672f7ddc1ca..8c0a6353617 100644 --- a/service/mediapackagevod/go.mod +++ b/service/mediapackagevod/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/mediapackagevod/go.sum b/service/mediapackagevod/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/mediapackagevod/go.sum +++ b/service/mediapackagevod/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 42d2638e114..00000000000 --- a/service/mediapackagevod/paginators.go +++ /dev/null @@ -1,235 +0,0 @@ -// 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/api_op_ListContainers.go b/service/mediastore/api_op_ListContainers.go index 0168c56d890..ea2cbfddca9 100644 --- a/service/mediastore/api_op_ListContainers.go +++ b/service/mediastore/api_op_ListContainers.go @@ -4,6 +4,7 @@ package mediastore import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mediastore/types" @@ -120,6 +121,82 @@ func addOperationListContainersMiddlewares(stack *middleware.Stack, options Opti return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListContainersPaginator returns a new ListContainersPaginator +func NewListContainersPaginator(client ListContainersAPIClient, params *ListContainersInput, optFns ...func(*ListContainersPaginatorOptions)) *ListContainersPaginator { + options := ListContainersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListContainersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListContainers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mediastore/go.mod b/service/mediastore/go.mod index 941aa46a1bf..d6e0a8c21a1 100644 --- a/service/mediastore/go.mod +++ b/service/mediastore/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/mediastore/go.sum b/service/mediastore/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/mediastore/go.sum +++ b/service/mediastore/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 2ef7ba1a15a..00000000000 --- a/service/mediastore/paginators.go +++ /dev/null @@ -1,84 +0,0 @@ -// 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.mod b/service/mediastoredata/go.mod index 22fd0dc4864..f60474dab19 100644 --- a/service/mediastoredata/go.mod +++ b/service/mediastoredata/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/mediastoredata/go.sum b/service/mediastoredata/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/mediastoredata/go.sum +++ b/service/mediastoredata/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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.mod b/service/mediatailor/go.mod index 02c42c33f36..e881b9695bd 100644 --- a/service/mediatailor/go.mod +++ b/service/mediatailor/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/mediatailor/go.sum b/service/mediatailor/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/mediatailor/go.sum +++ b/service/mediatailor/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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/api_op_ListApplicationStates.go b/service/migrationhub/api_op_ListApplicationStates.go index 877312d9fd4..84a28468d67 100644 --- a/service/migrationhub/api_op_ListApplicationStates.go +++ b/service/migrationhub/api_op_ListApplicationStates.go @@ -4,6 +4,7 @@ package migrationhub import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/migrationhub/types" @@ -115,6 +116,82 @@ func addOperationListApplicationStatesMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListApplicationStatesPaginator returns a new ListApplicationStatesPaginator +func NewListApplicationStatesPaginator(client ListApplicationStatesAPIClient, params *ListApplicationStatesInput, optFns ...func(*ListApplicationStatesPaginatorOptions)) *ListApplicationStatesPaginator { + options := ListApplicationStatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListApplicationStatesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListApplicationStates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/migrationhub/api_op_ListCreatedArtifacts.go b/service/migrationhub/api_op_ListCreatedArtifacts.go index e94867bd4a5..41b5352285c 100644 --- a/service/migrationhub/api_op_ListCreatedArtifacts.go +++ b/service/migrationhub/api_op_ListCreatedArtifacts.go @@ -4,6 +4,7 @@ package migrationhub import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/migrationhub/types" @@ -133,6 +134,82 @@ func addOperationListCreatedArtifactsMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListCreatedArtifactsPaginator returns a new ListCreatedArtifactsPaginator +func NewListCreatedArtifactsPaginator(client ListCreatedArtifactsAPIClient, params *ListCreatedArtifactsInput, optFns ...func(*ListCreatedArtifactsPaginatorOptions)) *ListCreatedArtifactsPaginator { + options := ListCreatedArtifactsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListCreatedArtifactsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListCreatedArtifacts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/migrationhub/api_op_ListDiscoveredResources.go b/service/migrationhub/api_op_ListDiscoveredResources.go index 466e3fba1ef..29d5bdc2b09 100644 --- a/service/migrationhub/api_op_ListDiscoveredResources.go +++ b/service/migrationhub/api_op_ListDiscoveredResources.go @@ -4,6 +4,7 @@ package migrationhub import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/migrationhub/types" @@ -121,6 +122,83 @@ func addOperationListDiscoveredResourcesMiddlewares(stack *middleware.Stack, opt return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDiscoveredResourcesPaginator returns a new +// ListDiscoveredResourcesPaginator +func NewListDiscoveredResourcesPaginator(client ListDiscoveredResourcesAPIClient, params *ListDiscoveredResourcesInput, optFns ...func(*ListDiscoveredResourcesPaginatorOptions)) *ListDiscoveredResourcesPaginator { + options := ListDiscoveredResourcesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDiscoveredResourcesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDiscoveredResources(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/migrationhub/api_op_ListMigrationTasks.go b/service/migrationhub/api_op_ListMigrationTasks.go index 8fde875fd36..f9afd70501c 100644 --- a/service/migrationhub/api_op_ListMigrationTasks.go +++ b/service/migrationhub/api_op_ListMigrationTasks.go @@ -4,6 +4,7 @@ package migrationhub import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/migrationhub/types" @@ -123,6 +124,82 @@ func addOperationListMigrationTasksMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListMigrationTasksPaginator returns a new ListMigrationTasksPaginator +func NewListMigrationTasksPaginator(client ListMigrationTasksAPIClient, params *ListMigrationTasksInput, optFns ...func(*ListMigrationTasksPaginatorOptions)) *ListMigrationTasksPaginator { + options := ListMigrationTasksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListMigrationTasksInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListMigrationTasks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/migrationhub/api_op_ListProgressUpdateStreams.go b/service/migrationhub/api_op_ListProgressUpdateStreams.go index 40ff22d1a58..a288894668f 100644 --- a/service/migrationhub/api_op_ListProgressUpdateStreams.go +++ b/service/migrationhub/api_op_ListProgressUpdateStreams.go @@ -4,6 +4,7 @@ package migrationhub import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/migrationhub/types" @@ -109,6 +110,83 @@ func addOperationListProgressUpdateStreamsMiddlewares(stack *middleware.Stack, o return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListProgressUpdateStreamsPaginator returns a new +// ListProgressUpdateStreamsPaginator +func NewListProgressUpdateStreamsPaginator(client ListProgressUpdateStreamsAPIClient, params *ListProgressUpdateStreamsInput, optFns ...func(*ListProgressUpdateStreamsPaginatorOptions)) *ListProgressUpdateStreamsPaginator { + options := ListProgressUpdateStreamsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListProgressUpdateStreamsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListProgressUpdateStreams(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/migrationhub/go.mod b/service/migrationhub/go.mod index 64ca2c6a99d..19c67c0aae8 100644 --- a/service/migrationhub/go.mod +++ b/service/migrationhub/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/migrationhub/go.sum b/service/migrationhub/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/migrationhub/go.sum +++ b/service/migrationhub/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 28e33f7f4ab..00000000000 --- a/service/migrationhub/paginators.go +++ /dev/null @@ -1,390 +0,0 @@ -// 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/api_op_DescribeHomeRegionControls.go b/service/migrationhubconfig/api_op_DescribeHomeRegionControls.go index 0f5bcce1c62..141af787af0 100644 --- a/service/migrationhubconfig/api_op_DescribeHomeRegionControls.go +++ b/service/migrationhubconfig/api_op_DescribeHomeRegionControls.go @@ -4,6 +4,7 @@ package migrationhubconfig import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/migrationhubconfig/types" @@ -123,6 +124,83 @@ func addOperationDescribeHomeRegionControlsMiddlewares(stack *middleware.Stack, return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeHomeRegionControlsPaginator returns a new +// DescribeHomeRegionControlsPaginator +func NewDescribeHomeRegionControlsPaginator(client DescribeHomeRegionControlsAPIClient, params *DescribeHomeRegionControlsInput, optFns ...func(*DescribeHomeRegionControlsPaginatorOptions)) *DescribeHomeRegionControlsPaginator { + options := DescribeHomeRegionControlsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeHomeRegionControlsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeHomeRegionControls(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/migrationhubconfig/go.mod b/service/migrationhubconfig/go.mod index cb1ad46be6c..7585e5753ff 100644 --- a/service/migrationhubconfig/go.mod +++ b/service/migrationhubconfig/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/migrationhubconfig/go.sum b/service/migrationhubconfig/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/migrationhubconfig/go.sum +++ b/service/migrationhubconfig/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 2da0ab5f167..00000000000 --- a/service/migrationhubconfig/paginators.go +++ /dev/null @@ -1,85 +0,0 @@ -// 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/api_op_ListBundles.go b/service/mobile/api_op_ListBundles.go index 242dcfbea35..332256ab0cd 100644 --- a/service/mobile/api_op_ListBundles.go +++ b/service/mobile/api_op_ListBundles.go @@ -4,6 +4,7 @@ package mobile import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mobile/types" @@ -110,6 +111,80 @@ func addOperationListBundlesMiddlewares(stack *middleware.Stack, options Options return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListBundlesPaginator returns a new ListBundlesPaginator +func NewListBundlesPaginator(client ListBundlesAPIClient, params *ListBundlesInput, optFns ...func(*ListBundlesPaginatorOptions)) *ListBundlesPaginator { + options := ListBundlesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListBundlesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListBundles(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mobile/api_op_ListProjects.go b/service/mobile/api_op_ListProjects.go index 692c412599e..430b8f71d71 100644 --- a/service/mobile/api_op_ListProjects.go +++ b/service/mobile/api_op_ListProjects.go @@ -4,6 +4,7 @@ package mobile import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mobile/types" @@ -111,6 +112,80 @@ func addOperationListProjectsMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListProjectsPaginator returns a new ListProjectsPaginator +func NewListProjectsPaginator(client ListProjectsAPIClient, params *ListProjectsInput, optFns ...func(*ListProjectsPaginatorOptions)) *ListProjectsPaginator { + options := ListProjectsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListProjectsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListProjects(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mobile/go.mod b/service/mobile/go.mod index 7de0b264633..25e295745f8 100644 --- a/service/mobile/go.mod +++ b/service/mobile/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/mobile/go.sum b/service/mobile/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/mobile/go.sum +++ b/service/mobile/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 5f3a8a6b7c0..00000000000 --- a/service/mobile/paginators.go +++ /dev/null @@ -1,156 +0,0 @@ -// 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/api_op_ListBrokers.go b/service/mq/api_op_ListBrokers.go index 45b578b4be5..c609da7d1f3 100644 --- a/service/mq/api_op_ListBrokers.go +++ b/service/mq/api_op_ListBrokers.go @@ -4,6 +4,7 @@ package mq import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mq/types" @@ -108,6 +109,81 @@ func addOperationListBrokersMiddlewares(stack *middleware.Stack, options Options return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListBrokersPaginator returns a new ListBrokersPaginator +func NewListBrokersPaginator(client ListBrokersAPIClient, params *ListBrokersInput, optFns ...func(*ListBrokersPaginatorOptions)) *ListBrokersPaginator { + options := ListBrokersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListBrokersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListBrokers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mq/go.mod b/service/mq/go.mod index b12d67f1d84..77c3c0ad844 100644 --- a/service/mq/go.mod +++ b/service/mq/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/mq/go.sum b/service/mq/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/mq/go.sum +++ b/service/mq/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index beeb94b0946..00000000000 --- a/service/mq/paginators.go +++ /dev/null @@ -1,83 +0,0 @@ -// 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/api_op_ListAssignmentsForHIT.go b/service/mturk/api_op_ListAssignmentsForHIT.go index e6a97b07d29..13094bf5ccc 100644 --- a/service/mturk/api_op_ListAssignmentsForHIT.go +++ b/service/mturk/api_op_ListAssignmentsForHIT.go @@ -4,6 +4,7 @@ package mturk import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mturk/types" @@ -134,6 +135,81 @@ func addOperationListAssignmentsForHITMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAssignmentsForHITPaginator returns a new ListAssignmentsForHITPaginator +func NewListAssignmentsForHITPaginator(client ListAssignmentsForHITAPIClient, params *ListAssignmentsForHITInput, optFns ...func(*ListAssignmentsForHITPaginatorOptions)) *ListAssignmentsForHITPaginator { + options := ListAssignmentsForHITPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAssignmentsForHITInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAssignmentsForHIT(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mturk/api_op_ListBonusPayments.go b/service/mturk/api_op_ListBonusPayments.go index a2f22755f84..1322d1a4079 100644 --- a/service/mturk/api_op_ListBonusPayments.go +++ b/service/mturk/api_op_ListBonusPayments.go @@ -4,6 +4,7 @@ package mturk import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mturk/types" @@ -123,6 +124,80 @@ func addOperationListBonusPaymentsMiddlewares(stack *middleware.Stack, options O return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListBonusPaymentsPaginator returns a new ListBonusPaymentsPaginator +func NewListBonusPaymentsPaginator(client ListBonusPaymentsAPIClient, params *ListBonusPaymentsInput, optFns ...func(*ListBonusPaymentsPaginatorOptions)) *ListBonusPaymentsPaginator { + options := ListBonusPaymentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListBonusPaymentsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListBonusPayments(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mturk/api_op_ListHITs.go b/service/mturk/api_op_ListHITs.go index 3129b2f8ed9..87aa3b79cd6 100644 --- a/service/mturk/api_op_ListHITs.go +++ b/service/mturk/api_op_ListHITs.go @@ -4,6 +4,7 @@ package mturk import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mturk/types" @@ -111,6 +112,79 @@ func addOperationListHITsMiddlewares(stack *middleware.Stack, options Options) ( return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListHITsPaginator returns a new ListHITsPaginator +func NewListHITsPaginator(client ListHITsAPIClient, params *ListHITsInput, optFns ...func(*ListHITsPaginatorOptions)) *ListHITsPaginator { + options := ListHITsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListHITsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListHITs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mturk/api_op_ListHITsForQualificationType.go b/service/mturk/api_op_ListHITsForQualificationType.go index eac85351e94..c930062a973 100644 --- a/service/mturk/api_op_ListHITsForQualificationType.go +++ b/service/mturk/api_op_ListHITsForQualificationType.go @@ -4,6 +4,7 @@ package mturk import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mturk/types" @@ -122,6 +123,83 @@ func addOperationListHITsForQualificationTypeMiddlewares(stack *middleware.Stack return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListHITsForQualificationTypePaginator returns a new +// ListHITsForQualificationTypePaginator +func NewListHITsForQualificationTypePaginator(client ListHITsForQualificationTypeAPIClient, params *ListHITsForQualificationTypeInput, optFns ...func(*ListHITsForQualificationTypePaginatorOptions)) *ListHITsForQualificationTypePaginator { + options := ListHITsForQualificationTypePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListHITsForQualificationTypeInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListHITsForQualificationType(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mturk/api_op_ListQualificationRequests.go b/service/mturk/api_op_ListQualificationRequests.go index 14a5090c8f5..f037b84e5fb 100644 --- a/service/mturk/api_op_ListQualificationRequests.go +++ b/service/mturk/api_op_ListQualificationRequests.go @@ -4,6 +4,7 @@ package mturk import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mturk/types" @@ -120,6 +121,83 @@ func addOperationListQualificationRequestsMiddlewares(stack *middleware.Stack, o return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListQualificationRequestsPaginator returns a new +// ListQualificationRequestsPaginator +func NewListQualificationRequestsPaginator(client ListQualificationRequestsAPIClient, params *ListQualificationRequestsInput, optFns ...func(*ListQualificationRequestsPaginatorOptions)) *ListQualificationRequestsPaginator { + options := ListQualificationRequestsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListQualificationRequestsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListQualificationRequests(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mturk/api_op_ListQualificationTypes.go b/service/mturk/api_op_ListQualificationTypes.go index b7547e9802f..ef32f4729aa 100644 --- a/service/mturk/api_op_ListQualificationTypes.go +++ b/service/mturk/api_op_ListQualificationTypes.go @@ -4,6 +4,7 @@ package mturk import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mturk/types" @@ -134,6 +135,82 @@ func addOperationListQualificationTypesMiddlewares(stack *middleware.Stack, opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListQualificationTypesPaginator returns a new ListQualificationTypesPaginator +func NewListQualificationTypesPaginator(client ListQualificationTypesAPIClient, params *ListQualificationTypesInput, optFns ...func(*ListQualificationTypesPaginatorOptions)) *ListQualificationTypesPaginator { + options := ListQualificationTypesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListQualificationTypesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListQualificationTypes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mturk/api_op_ListReviewPolicyResultsForHIT.go b/service/mturk/api_op_ListReviewPolicyResultsForHIT.go index 5ce61841b8d..5eca7adc0cb 100644 --- a/service/mturk/api_op_ListReviewPolicyResultsForHIT.go +++ b/service/mturk/api_op_ListReviewPolicyResultsForHIT.go @@ -4,6 +4,7 @@ package mturk import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mturk/types" @@ -146,6 +147,83 @@ func addOperationListReviewPolicyResultsForHITMiddlewares(stack *middleware.Stac return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListReviewPolicyResultsForHITPaginator returns a new +// ListReviewPolicyResultsForHITPaginator +func NewListReviewPolicyResultsForHITPaginator(client ListReviewPolicyResultsForHITAPIClient, params *ListReviewPolicyResultsForHITInput, optFns ...func(*ListReviewPolicyResultsForHITPaginatorOptions)) *ListReviewPolicyResultsForHITPaginator { + options := ListReviewPolicyResultsForHITPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListReviewPolicyResultsForHITInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListReviewPolicyResultsForHIT(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mturk/api_op_ListReviewableHITs.go b/service/mturk/api_op_ListReviewableHITs.go index 80b6b2ebb01..091a2de0ba8 100644 --- a/service/mturk/api_op_ListReviewableHITs.go +++ b/service/mturk/api_op_ListReviewableHITs.go @@ -4,6 +4,7 @@ package mturk import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mturk/types" @@ -120,6 +121,82 @@ func addOperationListReviewableHITsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListReviewableHITsPaginator returns a new ListReviewableHITsPaginator +func NewListReviewableHITsPaginator(client ListReviewableHITsAPIClient, params *ListReviewableHITsInput, optFns ...func(*ListReviewableHITsPaginatorOptions)) *ListReviewableHITsPaginator { + options := ListReviewableHITsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListReviewableHITsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListReviewableHITs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mturk/api_op_ListWorkerBlocks.go b/service/mturk/api_op_ListWorkerBlocks.go index 7cf35d2bc50..e103b26776d 100644 --- a/service/mturk/api_op_ListWorkerBlocks.go +++ b/service/mturk/api_op_ListWorkerBlocks.go @@ -4,6 +4,7 @@ package mturk import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mturk/types" @@ -111,6 +112,80 @@ func addOperationListWorkerBlocksMiddlewares(stack *middleware.Stack, options Op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListWorkerBlocksPaginator returns a new ListWorkerBlocksPaginator +func NewListWorkerBlocksPaginator(client ListWorkerBlocksAPIClient, params *ListWorkerBlocksInput, optFns ...func(*ListWorkerBlocksPaginatorOptions)) *ListWorkerBlocksPaginator { + options := ListWorkerBlocksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListWorkerBlocksInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListWorkerBlocks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mturk/api_op_ListWorkersWithQualificationType.go b/service/mturk/api_op_ListWorkersWithQualificationType.go index dc4b67a6d69..90bf8fc8117 100644 --- a/service/mturk/api_op_ListWorkersWithQualificationType.go +++ b/service/mturk/api_op_ListWorkersWithQualificationType.go @@ -4,6 +4,7 @@ package mturk import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mturk/types" @@ -123,6 +124,83 @@ func addOperationListWorkersWithQualificationTypeMiddlewares(stack *middleware.S return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListWorkersWithQualificationTypePaginator returns a new +// ListWorkersWithQualificationTypePaginator +func NewListWorkersWithQualificationTypePaginator(client ListWorkersWithQualificationTypeAPIClient, params *ListWorkersWithQualificationTypeInput, optFns ...func(*ListWorkersWithQualificationTypePaginatorOptions)) *ListWorkersWithQualificationTypePaginator { + options := ListWorkersWithQualificationTypePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListWorkersWithQualificationTypeInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListWorkersWithQualificationType(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mturk/go.mod b/service/mturk/go.mod index a0ffb61a49e..6cfcdd3b44f 100644 --- a/service/mturk/go.mod +++ b/service/mturk/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/mturk/go.sum b/service/mturk/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/mturk/go.sum +++ b/service/mturk/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 17d28d88dc8..00000000000 --- a/service/mturk/paginators.go +++ /dev/null @@ -1,764 +0,0 @@ -// 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/api_op_DescribeDBClusterEndpoints.go b/service/neptune/api_op_DescribeDBClusterEndpoints.go index 3b2eb9f255a..a605d6a31d4 100644 --- a/service/neptune/api_op_DescribeDBClusterEndpoints.go +++ b/service/neptune/api_op_DescribeDBClusterEndpoints.go @@ -4,6 +4,7 @@ package neptune import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/neptune/types" @@ -137,6 +138,86 @@ func addOperationDescribeDBClusterEndpointsMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeDBClusterEndpointsPaginator returns a new +// DescribeDBClusterEndpointsPaginator +func NewDescribeDBClusterEndpointsPaginator(client DescribeDBClusterEndpointsAPIClient, params *DescribeDBClusterEndpointsInput, optFns ...func(*DescribeDBClusterEndpointsPaginatorOptions)) *DescribeDBClusterEndpointsPaginator { + options := DescribeDBClusterEndpointsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBClusterEndpointsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBClusterEndpoints(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/neptune/api_op_DescribeDBEngineVersions.go b/service/neptune/api_op_DescribeDBEngineVersions.go index b576468d252..a0811975358 100644 --- a/service/neptune/api_op_DescribeDBEngineVersions.go +++ b/service/neptune/api_op_DescribeDBEngineVersions.go @@ -4,6 +4,7 @@ package neptune import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/neptune/types" @@ -144,6 +145,86 @@ func addOperationDescribeDBEngineVersionsMiddlewares(stack *middleware.Stack, op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeDBEngineVersionsPaginator returns a new +// DescribeDBEngineVersionsPaginator +func NewDescribeDBEngineVersionsPaginator(client DescribeDBEngineVersionsAPIClient, params *DescribeDBEngineVersionsInput, optFns ...func(*DescribeDBEngineVersionsPaginatorOptions)) *DescribeDBEngineVersionsPaginator { + options := DescribeDBEngineVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBEngineVersionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBEngineVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/neptune/api_op_DescribeDBInstances.go b/service/neptune/api_op_DescribeDBInstances.go index bc6bca43f6c..bf523cf0279 100644 --- a/service/neptune/api_op_DescribeDBInstances.go +++ b/service/neptune/api_op_DescribeDBInstances.go @@ -4,6 +4,7 @@ package neptune import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/neptune/types" @@ -141,6 +142,85 @@ func addOperationDescribeDBInstancesMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeDBInstancesPaginator returns a new DescribeDBInstancesPaginator +func NewDescribeDBInstancesPaginator(client DescribeDBInstancesAPIClient, params *DescribeDBInstancesInput, optFns ...func(*DescribeDBInstancesPaginatorOptions)) *DescribeDBInstancesPaginator { + options := DescribeDBInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBInstancesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBInstances(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/neptune/api_op_DescribeDBParameterGroups.go b/service/neptune/api_op_DescribeDBParameterGroups.go index ba72dfc99b5..ad6c47fb0e1 100644 --- a/service/neptune/api_op_DescribeDBParameterGroups.go +++ b/service/neptune/api_op_DescribeDBParameterGroups.go @@ -4,6 +4,7 @@ package neptune import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/neptune/types" @@ -126,6 +127,86 @@ func addOperationDescribeDBParameterGroupsMiddlewares(stack *middleware.Stack, o return 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 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeDBParameterGroupsPaginator returns a new +// DescribeDBParameterGroupsPaginator +func NewDescribeDBParameterGroupsPaginator(client DescribeDBParameterGroupsAPIClient, params *DescribeDBParameterGroupsInput, optFns ...func(*DescribeDBParameterGroupsPaginatorOptions)) *DescribeDBParameterGroupsPaginator { + options := DescribeDBParameterGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBParameterGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBParameterGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/neptune/api_op_DescribeDBParameters.go b/service/neptune/api_op_DescribeDBParameters.go index c21dc2d5981..a6564654649 100644 --- a/service/neptune/api_op_DescribeDBParameters.go +++ b/service/neptune/api_op_DescribeDBParameters.go @@ -4,6 +4,7 @@ package neptune import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/neptune/types" @@ -130,6 +131,85 @@ func addOperationDescribeDBParametersMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeDBParametersPaginator returns a new DescribeDBParametersPaginator +func NewDescribeDBParametersPaginator(client DescribeDBParametersAPIClient, params *DescribeDBParametersInput, optFns ...func(*DescribeDBParametersPaginatorOptions)) *DescribeDBParametersPaginator { + options := DescribeDBParametersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBParametersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBParameters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/neptune/api_op_DescribeDBSubnetGroups.go b/service/neptune/api_op_DescribeDBSubnetGroups.go index 9f867056ea0..9ef639935e5 100644 --- a/service/neptune/api_op_DescribeDBSubnetGroups.go +++ b/service/neptune/api_op_DescribeDBSubnetGroups.go @@ -4,6 +4,7 @@ package neptune import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/neptune/types" @@ -124,6 +125,85 @@ func addOperationDescribeDBSubnetGroupsMiddlewares(stack *middleware.Stack, opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeDBSubnetGroupsPaginator returns a new DescribeDBSubnetGroupsPaginator +func NewDescribeDBSubnetGroupsPaginator(client DescribeDBSubnetGroupsAPIClient, params *DescribeDBSubnetGroupsInput, optFns ...func(*DescribeDBSubnetGroupsPaginatorOptions)) *DescribeDBSubnetGroupsPaginator { + options := DescribeDBSubnetGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBSubnetGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBSubnetGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/neptune/api_op_DescribeEngineDefaultParameters.go b/service/neptune/api_op_DescribeEngineDefaultParameters.go index 74684f5b686..b31cbf20ced 100644 --- a/service/neptune/api_op_DescribeEngineDefaultParameters.go +++ b/service/neptune/api_op_DescribeEngineDefaultParameters.go @@ -4,6 +4,7 @@ package neptune import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/neptune/types" @@ -121,6 +122,91 @@ func addOperationDescribeEngineDefaultParametersMiddlewares(stack *middleware.St return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeEngineDefaultParametersPaginator returns a new +// DescribeEngineDefaultParametersPaginator +func NewDescribeEngineDefaultParametersPaginator(client DescribeEngineDefaultParametersAPIClient, params *DescribeEngineDefaultParametersInput, optFns ...func(*DescribeEngineDefaultParametersPaginatorOptions)) *DescribeEngineDefaultParametersPaginator { + options := DescribeEngineDefaultParametersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEngineDefaultParametersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + if result.EngineDefaults != nil { + p.nextToken = result.EngineDefaults.Marker + } else { + p.nextToken = nil + } + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEngineDefaultParameters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/neptune/api_op_DescribeEventSubscriptions.go b/service/neptune/api_op_DescribeEventSubscriptions.go index df6d3d4d260..4e7fedf1d36 100644 --- a/service/neptune/api_op_DescribeEventSubscriptions.go +++ b/service/neptune/api_op_DescribeEventSubscriptions.go @@ -4,6 +4,7 @@ package neptune import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/neptune/types" @@ -126,6 +127,86 @@ func addOperationDescribeEventSubscriptionsMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeEventSubscriptionsPaginator returns a new +// DescribeEventSubscriptionsPaginator +func NewDescribeEventSubscriptionsPaginator(client DescribeEventSubscriptionsAPIClient, params *DescribeEventSubscriptionsInput, optFns ...func(*DescribeEventSubscriptionsPaginatorOptions)) *DescribeEventSubscriptionsPaginator { + options := DescribeEventSubscriptionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEventSubscriptionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEventSubscriptions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/neptune/api_op_DescribeEvents.go b/service/neptune/api_op_DescribeEvents.go index e33247c210b..7839f9a6dec 100644 --- a/service/neptune/api_op_DescribeEvents.go +++ b/service/neptune/api_op_DescribeEvents.go @@ -4,6 +4,7 @@ package neptune import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/neptune/types" @@ -166,6 +167,84 @@ func addOperationDescribeEventsMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeEventsPaginator returns a new DescribeEventsPaginator +func NewDescribeEventsPaginator(client DescribeEventsAPIClient, params *DescribeEventsInput, optFns ...func(*DescribeEventsPaginatorOptions)) *DescribeEventsPaginator { + options := DescribeEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEventsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEvents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/neptune/api_op_DescribeOrderableDBInstanceOptions.go b/service/neptune/api_op_DescribeOrderableDBInstanceOptions.go index dcadb57b9c0..69aafe43d2e 100644 --- a/service/neptune/api_op_DescribeOrderableDBInstanceOptions.go +++ b/service/neptune/api_op_DescribeOrderableDBInstanceOptions.go @@ -4,6 +4,7 @@ package neptune import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/neptune/types" @@ -141,6 +142,86 @@ func addOperationDescribeOrderableDBInstanceOptionsMiddlewares(stack *middleware return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeOrderableDBInstanceOptionsPaginator returns a new +// DescribeOrderableDBInstanceOptionsPaginator +func NewDescribeOrderableDBInstanceOptionsPaginator(client DescribeOrderableDBInstanceOptionsAPIClient, params *DescribeOrderableDBInstanceOptionsInput, optFns ...func(*DescribeOrderableDBInstanceOptionsPaginatorOptions)) *DescribeOrderableDBInstanceOptionsPaginator { + options := DescribeOrderableDBInstanceOptionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeOrderableDBInstanceOptionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeOrderableDBInstanceOptions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/neptune/go.mod b/service/neptune/go.mod index cd2192de393..a7781c287ef 100644 --- a/service/neptune/go.mod +++ b/service/neptune/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/neptune/go.sum b/service/neptune/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/neptune/go.sum +++ b/service/neptune/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index ccda98f6a93..00000000000 --- a/service/neptune/paginators.go +++ /dev/null @@ -1,805 +0,0 @@ -// 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/api_op_DescribeGlobalNetworks.go b/service/networkmanager/api_op_DescribeGlobalNetworks.go index 31f2981a6a9..7e6d98da99c 100644 --- a/service/networkmanager/api_op_DescribeGlobalNetworks.go +++ b/service/networkmanager/api_op_DescribeGlobalNetworks.go @@ -4,6 +4,7 @@ package networkmanager import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/networkmanager/types" @@ -111,6 +112,82 @@ func addOperationDescribeGlobalNetworksMiddlewares(stack *middleware.Stack, opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeGlobalNetworksPaginator returns a new DescribeGlobalNetworksPaginator +func NewDescribeGlobalNetworksPaginator(client DescribeGlobalNetworksAPIClient, params *DescribeGlobalNetworksInput, optFns ...func(*DescribeGlobalNetworksPaginatorOptions)) *DescribeGlobalNetworksPaginator { + options := DescribeGlobalNetworksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeGlobalNetworksInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeGlobalNetworks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/networkmanager/api_op_GetCustomerGatewayAssociations.go b/service/networkmanager/api_op_GetCustomerGatewayAssociations.go index d75a3eb3967..e0e412cfd81 100644 --- a/service/networkmanager/api_op_GetCustomerGatewayAssociations.go +++ b/service/networkmanager/api_op_GetCustomerGatewayAssociations.go @@ -4,6 +4,7 @@ package networkmanager import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/networkmanager/types" @@ -120,6 +121,83 @@ func addOperationGetCustomerGatewayAssociationsMiddlewares(stack *middleware.Sta return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetCustomerGatewayAssociationsPaginator returns a new +// GetCustomerGatewayAssociationsPaginator +func NewGetCustomerGatewayAssociationsPaginator(client GetCustomerGatewayAssociationsAPIClient, params *GetCustomerGatewayAssociationsInput, optFns ...func(*GetCustomerGatewayAssociationsPaginatorOptions)) *GetCustomerGatewayAssociationsPaginator { + options := GetCustomerGatewayAssociationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetCustomerGatewayAssociationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetCustomerGatewayAssociations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/networkmanager/api_op_GetDevices.go b/service/networkmanager/api_op_GetDevices.go index b79df922057..b67951ba01d 100644 --- a/service/networkmanager/api_op_GetDevices.go +++ b/service/networkmanager/api_op_GetDevices.go @@ -4,6 +4,7 @@ package networkmanager import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/networkmanager/types" @@ -119,6 +120,80 @@ func addOperationGetDevicesMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetDevicesPaginator returns a new GetDevicesPaginator +func NewGetDevicesPaginator(client GetDevicesAPIClient, params *GetDevicesInput, optFns ...func(*GetDevicesPaginatorOptions)) *GetDevicesPaginator { + options := GetDevicesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetDevicesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetDevices(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/networkmanager/api_op_GetLinkAssociations.go b/service/networkmanager/api_op_GetLinkAssociations.go index 1cd5947982f..acb7ce6ea71 100644 --- a/service/networkmanager/api_op_GetLinkAssociations.go +++ b/service/networkmanager/api_op_GetLinkAssociations.go @@ -4,6 +4,7 @@ package networkmanager import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/networkmanager/types" @@ -120,6 +121,82 @@ func addOperationGetLinkAssociationsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetLinkAssociationsPaginator returns a new GetLinkAssociationsPaginator +func NewGetLinkAssociationsPaginator(client GetLinkAssociationsAPIClient, params *GetLinkAssociationsInput, optFns ...func(*GetLinkAssociationsPaginatorOptions)) *GetLinkAssociationsPaginator { + options := GetLinkAssociationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetLinkAssociationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetLinkAssociations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/networkmanager/api_op_GetLinks.go b/service/networkmanager/api_op_GetLinks.go index e74070d06ca..5b263f5a329 100644 --- a/service/networkmanager/api_op_GetLinks.go +++ b/service/networkmanager/api_op_GetLinks.go @@ -4,6 +4,7 @@ package networkmanager import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/networkmanager/types" @@ -127,6 +128,80 @@ func addOperationGetLinksMiddlewares(stack *middleware.Stack, options Options) ( return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetLinksPaginator returns a new GetLinksPaginator +func NewGetLinksPaginator(client GetLinksAPIClient, params *GetLinksInput, optFns ...func(*GetLinksPaginatorOptions)) *GetLinksPaginator { + options := GetLinksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetLinksInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetLinks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/networkmanager/api_op_GetSites.go b/service/networkmanager/api_op_GetSites.go index 71b37adad08..8d9bf66f843 100644 --- a/service/networkmanager/api_op_GetSites.go +++ b/service/networkmanager/api_op_GetSites.go @@ -4,6 +4,7 @@ package networkmanager import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/networkmanager/types" @@ -116,6 +117,80 @@ func addOperationGetSitesMiddlewares(stack *middleware.Stack, options Options) ( return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetSitesPaginator returns a new GetSitesPaginator +func NewGetSitesPaginator(client GetSitesAPIClient, params *GetSitesInput, optFns ...func(*GetSitesPaginatorOptions)) *GetSitesPaginator { + options := GetSitesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetSitesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetSites(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/networkmanager/api_op_GetTransitGatewayRegistrations.go b/service/networkmanager/api_op_GetTransitGatewayRegistrations.go index 74753a81fe8..70e45464293 100644 --- a/service/networkmanager/api_op_GetTransitGatewayRegistrations.go +++ b/service/networkmanager/api_op_GetTransitGatewayRegistrations.go @@ -4,6 +4,7 @@ package networkmanager import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/networkmanager/types" @@ -118,6 +119,83 @@ func addOperationGetTransitGatewayRegistrationsMiddlewares(stack *middleware.Sta return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetTransitGatewayRegistrationsPaginator returns a new +// GetTransitGatewayRegistrationsPaginator +func NewGetTransitGatewayRegistrationsPaginator(client GetTransitGatewayRegistrationsAPIClient, params *GetTransitGatewayRegistrationsInput, optFns ...func(*GetTransitGatewayRegistrationsPaginatorOptions)) *GetTransitGatewayRegistrationsPaginator { + options := GetTransitGatewayRegistrationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetTransitGatewayRegistrationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetTransitGatewayRegistrations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/networkmanager/go.mod b/service/networkmanager/go.mod index 0dcc0fa2f91..271dfc83d92 100644 --- a/service/networkmanager/go.mod +++ b/service/networkmanager/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/networkmanager/go.sum b/service/networkmanager/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/networkmanager/go.sum +++ b/service/networkmanager/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 79a8215bec9..00000000000 --- a/service/networkmanager/paginators.go +++ /dev/null @@ -1,536 +0,0 @@ -// 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/api_op_DescribeEcsClusters.go b/service/opsworks/api_op_DescribeEcsClusters.go index 0c60627ab76..dfba2265c7e 100644 --- a/service/opsworks/api_op_DescribeEcsClusters.go +++ b/service/opsworks/api_op_DescribeEcsClusters.go @@ -4,6 +4,7 @@ package opsworks import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/opsworks/types" @@ -132,6 +133,85 @@ func addOperationDescribeEcsClustersMiddlewares(stack *middleware.Stack, options return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeEcsClustersPaginator returns a new DescribeEcsClustersPaginator +func NewDescribeEcsClustersPaginator(client DescribeEcsClustersAPIClient, params *DescribeEcsClustersInput, optFns ...func(*DescribeEcsClustersPaginatorOptions)) *DescribeEcsClustersPaginator { + options := DescribeEcsClustersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEcsClustersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEcsClusters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/opsworks/go.mod b/service/opsworks/go.mod index c05edd79bdf..5b58e64ecd2 100644 --- a/service/opsworks/go.mod +++ b/service/opsworks/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/opsworks/go.sum b/service/opsworks/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/opsworks/go.sum +++ b/service/opsworks/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index e34f09b85a6..00000000000 --- a/service/opsworks/paginators.go +++ /dev/null @@ -1,87 +0,0 @@ -// 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/api_op_DescribeBackups.go b/service/opsworkscm/api_op_DescribeBackups.go index 4b1440b2437..0870c717e45 100644 --- a/service/opsworkscm/api_op_DescribeBackups.go +++ b/service/opsworkscm/api_op_DescribeBackups.go @@ -4,6 +4,7 @@ package opsworkscm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/opsworkscm/types" @@ -115,6 +116,81 @@ func addOperationDescribeBackupsMiddlewares(stack *middleware.Stack, options Opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeBackupsPaginator returns a new DescribeBackupsPaginator +func NewDescribeBackupsPaginator(client DescribeBackupsAPIClient, params *DescribeBackupsInput, optFns ...func(*DescribeBackupsPaginatorOptions)) *DescribeBackupsPaginator { + options := DescribeBackupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeBackupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeBackups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/opsworkscm/api_op_DescribeEvents.go b/service/opsworkscm/api_op_DescribeEvents.go index 4aa94516277..b2486dcb657 100644 --- a/service/opsworkscm/api_op_DescribeEvents.go +++ b/service/opsworkscm/api_op_DescribeEvents.go @@ -4,6 +4,7 @@ package opsworkscm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/opsworkscm/types" @@ -131,6 +132,84 @@ func addOperationDescribeEventsMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeEventsPaginator returns a new DescribeEventsPaginator +func NewDescribeEventsPaginator(client DescribeEventsAPIClient, params *DescribeEventsInput, optFns ...func(*DescribeEventsPaginatorOptions)) *DescribeEventsPaginator { + options := DescribeEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEventsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEvents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/opsworkscm/api_op_DescribeServers.go b/service/opsworkscm/api_op_DescribeServers.go index 9038f66c9e6..6166cd2a0e1 100644 --- a/service/opsworkscm/api_op_DescribeServers.go +++ b/service/opsworkscm/api_op_DescribeServers.go @@ -4,6 +4,7 @@ package opsworkscm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/opsworkscm/types" @@ -120,6 +121,81 @@ func addOperationDescribeServersMiddlewares(stack *middleware.Stack, options Opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeServersPaginator returns a new DescribeServersPaginator +func NewDescribeServersPaginator(client DescribeServersAPIClient, params *DescribeServersInput, optFns ...func(*DescribeServersPaginatorOptions)) *DescribeServersPaginator { + options := DescribeServersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeServersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeServers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/opsworkscm/api_op_ListTagsForResource.go b/service/opsworkscm/api_op_ListTagsForResource.go index 32cea1b19d8..82e49a4018e 100644 --- a/service/opsworkscm/api_op_ListTagsForResource.go +++ b/service/opsworkscm/api_op_ListTagsForResource.go @@ -4,6 +4,7 @@ package opsworkscm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/opsworkscm/types" @@ -128,6 +129,85 @@ func addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options return 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 { + // 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator +func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator { + options := ListTagsForResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTagsForResourceInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/opsworkscm/go.mod b/service/opsworkscm/go.mod index d3dff7f1901..c425bc43ba6 100644 --- a/service/opsworkscm/go.mod +++ b/service/opsworkscm/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/opsworkscm/go.sum b/service/opsworkscm/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/opsworkscm/go.sum +++ b/service/opsworkscm/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 8a1f6985c72..00000000000 --- a/service/opsworkscm/paginators.go +++ /dev/null @@ -1,315 +0,0 @@ -// 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/api_op_ListAWSServiceAccessForOrganization.go b/service/organizations/api_op_ListAWSServiceAccessForOrganization.go index 93babe5beab..ae5ba7bad29 100644 --- a/service/organizations/api_op_ListAWSServiceAccessForOrganization.go +++ b/service/organizations/api_op_ListAWSServiceAccessForOrganization.go @@ -4,6 +4,7 @@ package organizations import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/organizations/types" @@ -130,6 +131,91 @@ func addOperationListAWSServiceAccessForOrganizationMiddlewares(stack *middlewar return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAWSServiceAccessForOrganizationPaginator returns a new +// ListAWSServiceAccessForOrganizationPaginator +func NewListAWSServiceAccessForOrganizationPaginator(client ListAWSServiceAccessForOrganizationAPIClient, params *ListAWSServiceAccessForOrganizationInput, optFns ...func(*ListAWSServiceAccessForOrganizationPaginatorOptions)) *ListAWSServiceAccessForOrganizationPaginator { + options := ListAWSServiceAccessForOrganizationPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAWSServiceAccessForOrganizationInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAWSServiceAccessForOrganization(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/organizations/api_op_ListAccounts.go b/service/organizations/api_op_ListAccounts.go index 6578cc903db..de54b455879 100644 --- a/service/organizations/api_op_ListAccounts.go +++ b/service/organizations/api_op_ListAccounts.go @@ -4,6 +4,7 @@ package organizations import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/organizations/types" @@ -127,6 +128,88 @@ func addOperationListAccountsMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAccountsPaginator returns a new ListAccountsPaginator +func NewListAccountsPaginator(client ListAccountsAPIClient, params *ListAccountsInput, optFns ...func(*ListAccountsPaginatorOptions)) *ListAccountsPaginator { + options := ListAccountsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAccountsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAccounts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/organizations/api_op_ListAccountsForParent.go b/service/organizations/api_op_ListAccountsForParent.go index b6270279b0d..5a266c77bb7 100644 --- a/service/organizations/api_op_ListAccountsForParent.go +++ b/service/organizations/api_op_ListAccountsForParent.go @@ -4,6 +4,7 @@ package organizations import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/organizations/types" @@ -138,6 +139,90 @@ func addOperationListAccountsForParentMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAccountsForParentPaginator returns a new ListAccountsForParentPaginator +func NewListAccountsForParentPaginator(client ListAccountsForParentAPIClient, params *ListAccountsForParentInput, optFns ...func(*ListAccountsForParentPaginatorOptions)) *ListAccountsForParentPaginator { + options := ListAccountsForParentPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAccountsForParentInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAccountsForParent(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/organizations/api_op_ListChildren.go b/service/organizations/api_op_ListChildren.go index d437c00aabd..6cc74db20a5 100644 --- a/service/organizations/api_op_ListChildren.go +++ b/service/organizations/api_op_ListChildren.go @@ -4,6 +4,7 @@ package organizations import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/organizations/types" @@ -150,6 +151,88 @@ func addOperationListChildrenMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListChildrenPaginator returns a new ListChildrenPaginator +func NewListChildrenPaginator(client ListChildrenAPIClient, params *ListChildrenInput, optFns ...func(*ListChildrenPaginatorOptions)) *ListChildrenPaginator { + options := ListChildrenPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListChildrenInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListChildren(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/organizations/api_op_ListCreateAccountStatus.go b/service/organizations/api_op_ListCreateAccountStatus.go index 37e9206c3af..e8da07001bb 100644 --- a/service/organizations/api_op_ListCreateAccountStatus.go +++ b/service/organizations/api_op_ListCreateAccountStatus.go @@ -4,6 +4,7 @@ package organizations import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/organizations/types" @@ -132,6 +133,91 @@ func addOperationListCreateAccountStatusMiddlewares(stack *middleware.Stack, opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListCreateAccountStatusPaginator returns a new +// ListCreateAccountStatusPaginator +func NewListCreateAccountStatusPaginator(client ListCreateAccountStatusAPIClient, params *ListCreateAccountStatusInput, optFns ...func(*ListCreateAccountStatusPaginatorOptions)) *ListCreateAccountStatusPaginator { + options := ListCreateAccountStatusPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListCreateAccountStatusInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListCreateAccountStatus(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/organizations/api_op_ListDelegatedAdministrators.go b/service/organizations/api_op_ListDelegatedAdministrators.go index 9e446381145..d3a23f1801d 100644 --- a/service/organizations/api_op_ListDelegatedAdministrators.go +++ b/service/organizations/api_op_ListDelegatedAdministrators.go @@ -4,6 +4,7 @@ package organizations import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/organizations/types" @@ -128,6 +129,91 @@ func addOperationListDelegatedAdministratorsMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDelegatedAdministratorsPaginator returns a new +// ListDelegatedAdministratorsPaginator +func NewListDelegatedAdministratorsPaginator(client ListDelegatedAdministratorsAPIClient, params *ListDelegatedAdministratorsInput, optFns ...func(*ListDelegatedAdministratorsPaginatorOptions)) *ListDelegatedAdministratorsPaginator { + options := ListDelegatedAdministratorsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDelegatedAdministratorsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDelegatedAdministrators(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/organizations/api_op_ListDelegatedServicesForAccount.go b/service/organizations/api_op_ListDelegatedServicesForAccount.go index a2ab6aa85c7..93ed604db55 100644 --- a/service/organizations/api_op_ListDelegatedServicesForAccount.go +++ b/service/organizations/api_op_ListDelegatedServicesForAccount.go @@ -4,6 +4,7 @@ package organizations import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/organizations/types" @@ -130,6 +131,91 @@ func addOperationListDelegatedServicesForAccountMiddlewares(stack *middleware.St return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDelegatedServicesForAccountPaginator returns a new +// ListDelegatedServicesForAccountPaginator +func NewListDelegatedServicesForAccountPaginator(client ListDelegatedServicesForAccountAPIClient, params *ListDelegatedServicesForAccountInput, optFns ...func(*ListDelegatedServicesForAccountPaginatorOptions)) *ListDelegatedServicesForAccountPaginator { + options := ListDelegatedServicesForAccountPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDelegatedServicesForAccountInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDelegatedServicesForAccount(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/organizations/api_op_ListHandshakesForAccount.go b/service/organizations/api_op_ListHandshakesForAccount.go index a748acc9424..534173e93d8 100644 --- a/service/organizations/api_op_ListHandshakesForAccount.go +++ b/service/organizations/api_op_ListHandshakesForAccount.go @@ -4,6 +4,7 @@ package organizations import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/organizations/types" @@ -136,6 +137,91 @@ func addOperationListHandshakesForAccountMiddlewares(stack *middleware.Stack, op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListHandshakesForAccountPaginator returns a new +// ListHandshakesForAccountPaginator +func NewListHandshakesForAccountPaginator(client ListHandshakesForAccountAPIClient, params *ListHandshakesForAccountInput, optFns ...func(*ListHandshakesForAccountPaginatorOptions)) *ListHandshakesForAccountPaginator { + options := ListHandshakesForAccountPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListHandshakesForAccountInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListHandshakesForAccount(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/organizations/api_op_ListHandshakesForOrganization.go b/service/organizations/api_op_ListHandshakesForOrganization.go index e6db515dba9..655143598da 100644 --- a/service/organizations/api_op_ListHandshakesForOrganization.go +++ b/service/organizations/api_op_ListHandshakesForOrganization.go @@ -4,6 +4,7 @@ package organizations import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/organizations/types" @@ -139,6 +140,91 @@ func addOperationListHandshakesForOrganizationMiddlewares(stack *middleware.Stac return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListHandshakesForOrganizationPaginator returns a new +// ListHandshakesForOrganizationPaginator +func NewListHandshakesForOrganizationPaginator(client ListHandshakesForOrganizationAPIClient, params *ListHandshakesForOrganizationInput, optFns ...func(*ListHandshakesForOrganizationPaginatorOptions)) *ListHandshakesForOrganizationPaginator { + options := ListHandshakesForOrganizationPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListHandshakesForOrganizationInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListHandshakesForOrganization(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/organizations/api_op_ListOrganizationalUnitsForParent.go b/service/organizations/api_op_ListOrganizationalUnitsForParent.go index 443a03bf1c1..23b3180ef9c 100644 --- a/service/organizations/api_op_ListOrganizationalUnitsForParent.go +++ b/service/organizations/api_op_ListOrganizationalUnitsForParent.go @@ -4,6 +4,7 @@ package organizations import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/organizations/types" @@ -143,6 +144,91 @@ func addOperationListOrganizationalUnitsForParentMiddlewares(stack *middleware.S return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListOrganizationalUnitsForParentPaginator returns a new +// ListOrganizationalUnitsForParentPaginator +func NewListOrganizationalUnitsForParentPaginator(client ListOrganizationalUnitsForParentAPIClient, params *ListOrganizationalUnitsForParentInput, optFns ...func(*ListOrganizationalUnitsForParentPaginatorOptions)) *ListOrganizationalUnitsForParentPaginator { + options := ListOrganizationalUnitsForParentPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListOrganizationalUnitsForParentInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListOrganizationalUnitsForParent(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/organizations/api_op_ListParents.go b/service/organizations/api_op_ListParents.go index b097415352c..d5f2a0a7b5d 100644 --- a/service/organizations/api_op_ListParents.go +++ b/service/organizations/api_op_ListParents.go @@ -4,6 +4,7 @@ package organizations import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/organizations/types" @@ -147,6 +148,88 @@ func addOperationListParentsMiddlewares(stack *middleware.Stack, options Options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListParentsPaginator returns a new ListParentsPaginator +func NewListParentsPaginator(client ListParentsAPIClient, params *ListParentsInput, optFns ...func(*ListParentsPaginatorOptions)) *ListParentsPaginator { + options := ListParentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListParentsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListParents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/organizations/api_op_ListPolicies.go b/service/organizations/api_op_ListPolicies.go index c3e11212e3e..05dbd51ead6 100644 --- a/service/organizations/api_op_ListPolicies.go +++ b/service/organizations/api_op_ListPolicies.go @@ -4,6 +4,7 @@ package organizations import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/organizations/types" @@ -151,6 +152,88 @@ func addOperationListPoliciesMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListPoliciesPaginator returns a new ListPoliciesPaginator +func NewListPoliciesPaginator(client ListPoliciesAPIClient, params *ListPoliciesInput, optFns ...func(*ListPoliciesPaginatorOptions)) *ListPoliciesPaginator { + options := ListPoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPoliciesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPolicies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/organizations/api_op_ListPoliciesForTarget.go b/service/organizations/api_op_ListPoliciesForTarget.go index 31a6ddeb5d1..1be64b22425 100644 --- a/service/organizations/api_op_ListPoliciesForTarget.go +++ b/service/organizations/api_op_ListPoliciesForTarget.go @@ -4,6 +4,7 @@ package organizations import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/organizations/types" @@ -170,6 +171,90 @@ func addOperationListPoliciesForTargetMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListPoliciesForTargetPaginator returns a new ListPoliciesForTargetPaginator +func NewListPoliciesForTargetPaginator(client ListPoliciesForTargetAPIClient, params *ListPoliciesForTargetInput, optFns ...func(*ListPoliciesForTargetPaginatorOptions)) *ListPoliciesForTargetPaginator { + options := ListPoliciesForTargetPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPoliciesForTargetInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPoliciesForTarget(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/organizations/api_op_ListRoots.go b/service/organizations/api_op_ListRoots.go index 12ef8b5f36e..d456fcf5665 100644 --- a/service/organizations/api_op_ListRoots.go +++ b/service/organizations/api_op_ListRoots.go @@ -4,6 +4,7 @@ package organizations import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/organizations/types" @@ -130,6 +131,88 @@ func addOperationListRootsMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListRootsPaginator returns a new ListRootsPaginator +func NewListRootsPaginator(client ListRootsAPIClient, params *ListRootsInput, optFns ...func(*ListRootsPaginatorOptions)) *ListRootsPaginator { + options := ListRootsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRootsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRoots(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/organizations/api_op_ListTagsForResource.go b/service/organizations/api_op_ListTagsForResource.go index d46d2a03580..95a8e9fee3e 100644 --- a/service/organizations/api_op_ListTagsForResource.go +++ b/service/organizations/api_op_ListTagsForResource.go @@ -4,6 +4,7 @@ package organizations import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/organizations/types" @@ -143,6 +144,78 @@ func addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator +func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator { + options := ListTagsForResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTagsForResourceInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/organizations/api_op_ListTargetsForPolicy.go b/service/organizations/api_op_ListTargetsForPolicy.go index 0be1a70108d..2f509985a18 100644 --- a/service/organizations/api_op_ListTargetsForPolicy.go +++ b/service/organizations/api_op_ListTargetsForPolicy.go @@ -4,6 +4,7 @@ package organizations import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/organizations/types" @@ -138,6 +139,90 @@ func addOperationListTargetsForPolicyMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTargetsForPolicyPaginator returns a new ListTargetsForPolicyPaginator +func NewListTargetsForPolicyPaginator(client ListTargetsForPolicyAPIClient, params *ListTargetsForPolicyInput, optFns ...func(*ListTargetsForPolicyPaginatorOptions)) *ListTargetsForPolicyPaginator { + options := ListTargetsForPolicyPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTargetsForPolicyInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTargetsForPolicy(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/organizations/go.mod b/service/organizations/go.mod index b4834635966..e2738fd3d48 100644 --- a/service/organizations/go.mod +++ b/service/organizations/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/organizations/go.sum b/service/organizations/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/organizations/go.sum +++ b/service/organizations/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 12dd19d4b0d..00000000000 --- a/service/organizations/paginators.go +++ /dev/null @@ -1,1337 +0,0 @@ -// 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/api_op_ListOutposts.go b/service/outposts/api_op_ListOutposts.go index 7e1b618386c..65ad278adc0 100644 --- a/service/outposts/api_op_ListOutposts.go +++ b/service/outposts/api_op_ListOutposts.go @@ -4,6 +4,7 @@ package outposts import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/outposts/types" @@ -105,6 +106,80 @@ func addOperationListOutpostsMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListOutpostsPaginator returns a new ListOutpostsPaginator +func NewListOutpostsPaginator(client ListOutpostsAPIClient, params *ListOutpostsInput, optFns ...func(*ListOutpostsPaginatorOptions)) *ListOutpostsPaginator { + options := ListOutpostsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListOutpostsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListOutposts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/outposts/api_op_ListSites.go b/service/outposts/api_op_ListSites.go index 34214783de2..22401bd0a14 100644 --- a/service/outposts/api_op_ListSites.go +++ b/service/outposts/api_op_ListSites.go @@ -4,6 +4,7 @@ package outposts import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/outposts/types" @@ -105,6 +106,80 @@ func addOperationListSitesMiddlewares(stack *middleware.Stack, options Options) return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListSitesPaginator returns a new ListSitesPaginator +func NewListSitesPaginator(client ListSitesAPIClient, params *ListSitesInput, optFns ...func(*ListSitesPaginatorOptions)) *ListSitesPaginator { + options := ListSitesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSitesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSites(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/outposts/go.mod b/service/outposts/go.mod index 13fa4b6bb6b..442e4589ad5 100644 --- a/service/outposts/go.mod +++ b/service/outposts/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/outposts/go.sum b/service/outposts/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/outposts/go.sum +++ b/service/outposts/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 80c079b3b6a..00000000000 --- a/service/outposts/paginators.go +++ /dev/null @@ -1,156 +0,0 @@ -// 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/api_op_ListBatchInferenceJobs.go b/service/personalize/api_op_ListBatchInferenceJobs.go index c4fbc541f7b..8afbf5dab1f 100644 --- a/service/personalize/api_op_ListBatchInferenceJobs.go +++ b/service/personalize/api_op_ListBatchInferenceJobs.go @@ -4,6 +4,7 @@ package personalize import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/personalize/types" @@ -112,6 +113,83 @@ func addOperationListBatchInferenceJobsMiddlewares(stack *middleware.Stack, opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListBatchInferenceJobsPaginator returns a new ListBatchInferenceJobsPaginator +func NewListBatchInferenceJobsPaginator(client ListBatchInferenceJobsAPIClient, params *ListBatchInferenceJobsInput, optFns ...func(*ListBatchInferenceJobsPaginatorOptions)) *ListBatchInferenceJobsPaginator { + options := ListBatchInferenceJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListBatchInferenceJobsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListBatchInferenceJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/personalize/api_op_ListCampaigns.go b/service/personalize/api_op_ListCampaigns.go index 9b132160d17..c5b0602645b 100644 --- a/service/personalize/api_op_ListCampaigns.go +++ b/service/personalize/api_op_ListCampaigns.go @@ -4,6 +4,7 @@ package personalize import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/personalize/types" @@ -114,6 +115,80 @@ func addOperationListCampaignsMiddlewares(stack *middleware.Stack, options Optio return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListCampaignsPaginator returns a new ListCampaignsPaginator +func NewListCampaignsPaginator(client ListCampaignsAPIClient, params *ListCampaignsInput, optFns ...func(*ListCampaignsPaginatorOptions)) *ListCampaignsPaginator { + options := ListCampaignsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListCampaignsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListCampaigns(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/personalize/api_op_ListDatasetGroups.go b/service/personalize/api_op_ListDatasetGroups.go index 0e255241e1d..67508aeb521 100644 --- a/service/personalize/api_op_ListDatasetGroups.go +++ b/service/personalize/api_op_ListDatasetGroups.go @@ -4,6 +4,7 @@ package personalize import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/personalize/types" @@ -108,6 +109,81 @@ func addOperationListDatasetGroupsMiddlewares(stack *middleware.Stack, options O return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDatasetGroupsPaginator returns a new ListDatasetGroupsPaginator +func NewListDatasetGroupsPaginator(client ListDatasetGroupsAPIClient, params *ListDatasetGroupsInput, optFns ...func(*ListDatasetGroupsPaginatorOptions)) *ListDatasetGroupsPaginator { + options := ListDatasetGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDatasetGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDatasetGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/personalize/api_op_ListDatasetImportJobs.go b/service/personalize/api_op_ListDatasetImportJobs.go index 80b37fda080..7dc074dc995 100644 --- a/service/personalize/api_op_ListDatasetImportJobs.go +++ b/service/personalize/api_op_ListDatasetImportJobs.go @@ -4,6 +4,7 @@ package personalize import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/personalize/types" @@ -115,6 +116,82 @@ func addOperationListDatasetImportJobsMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDatasetImportJobsPaginator returns a new ListDatasetImportJobsPaginator +func NewListDatasetImportJobsPaginator(client ListDatasetImportJobsAPIClient, params *ListDatasetImportJobsInput, optFns ...func(*ListDatasetImportJobsPaginatorOptions)) *ListDatasetImportJobsPaginator { + options := ListDatasetImportJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDatasetImportJobsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDatasetImportJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/personalize/api_op_ListDatasets.go b/service/personalize/api_op_ListDatasets.go index 49eec666327..87c5c5149fe 100644 --- a/service/personalize/api_op_ListDatasets.go +++ b/service/personalize/api_op_ListDatasets.go @@ -4,6 +4,7 @@ package personalize import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/personalize/types" @@ -112,6 +113,80 @@ func addOperationListDatasetsMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDatasetsPaginator returns a new ListDatasetsPaginator +func NewListDatasetsPaginator(client ListDatasetsAPIClient, params *ListDatasetsInput, optFns ...func(*ListDatasetsPaginatorOptions)) *ListDatasetsPaginator { + options := ListDatasetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDatasetsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDatasets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/personalize/api_op_ListEventTrackers.go b/service/personalize/api_op_ListEventTrackers.go index db3c6fb7903..9085b2c6d1a 100644 --- a/service/personalize/api_op_ListEventTrackers.go +++ b/service/personalize/api_op_ListEventTrackers.go @@ -4,6 +4,7 @@ package personalize import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/personalize/types" @@ -112,6 +113,81 @@ func addOperationListEventTrackersMiddlewares(stack *middleware.Stack, options O return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListEventTrackersPaginator returns a new ListEventTrackersPaginator +func NewListEventTrackersPaginator(client ListEventTrackersAPIClient, params *ListEventTrackersInput, optFns ...func(*ListEventTrackersPaginatorOptions)) *ListEventTrackersPaginator { + options := ListEventTrackersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListEventTrackersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListEventTrackers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/personalize/api_op_ListRecipes.go b/service/personalize/api_op_ListRecipes.go index ae62a1e3f59..54cb28be1bc 100644 --- a/service/personalize/api_op_ListRecipes.go +++ b/service/personalize/api_op_ListRecipes.go @@ -4,6 +4,7 @@ package personalize import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/personalize/types" @@ -110,6 +111,80 @@ func addOperationListRecipesMiddlewares(stack *middleware.Stack, options Options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListRecipesPaginator returns a new ListRecipesPaginator +func NewListRecipesPaginator(client ListRecipesAPIClient, params *ListRecipesInput, optFns ...func(*ListRecipesPaginatorOptions)) *ListRecipesPaginator { + options := ListRecipesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRecipesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRecipes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/personalize/api_op_ListSchemas.go b/service/personalize/api_op_ListSchemas.go index e9b55e61eb6..d235314750f 100644 --- a/service/personalize/api_op_ListSchemas.go +++ b/service/personalize/api_op_ListSchemas.go @@ -4,6 +4,7 @@ package personalize import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/personalize/types" @@ -108,6 +109,80 @@ func addOperationListSchemasMiddlewares(stack *middleware.Stack, options Options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListSchemasPaginator returns a new ListSchemasPaginator +func NewListSchemasPaginator(client ListSchemasAPIClient, params *ListSchemasInput, optFns ...func(*ListSchemasPaginatorOptions)) *ListSchemasPaginator { + options := ListSchemasPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSchemasInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSchemas(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/personalize/api_op_ListSolutionVersions.go b/service/personalize/api_op_ListSolutionVersions.go index dc1e6dc7ac9..daeb1e587cb 100644 --- a/service/personalize/api_op_ListSolutionVersions.go +++ b/service/personalize/api_op_ListSolutionVersions.go @@ -4,6 +4,7 @@ package personalize import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/personalize/types" @@ -113,6 +114,82 @@ func addOperationListSolutionVersionsMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListSolutionVersionsPaginator returns a new ListSolutionVersionsPaginator +func NewListSolutionVersionsPaginator(client ListSolutionVersionsAPIClient, params *ListSolutionVersionsInput, optFns ...func(*ListSolutionVersionsPaginatorOptions)) *ListSolutionVersionsPaginator { + options := ListSolutionVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSolutionVersionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSolutionVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/personalize/api_op_ListSolutions.go b/service/personalize/api_op_ListSolutions.go index a5b8de012e7..6dd1d48639a 100644 --- a/service/personalize/api_op_ListSolutions.go +++ b/service/personalize/api_op_ListSolutions.go @@ -4,6 +4,7 @@ package personalize import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/personalize/types" @@ -113,6 +114,80 @@ func addOperationListSolutionsMiddlewares(stack *middleware.Stack, options Optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListSolutionsPaginator returns a new ListSolutionsPaginator +func NewListSolutionsPaginator(client ListSolutionsAPIClient, params *ListSolutionsInput, optFns ...func(*ListSolutionsPaginatorOptions)) *ListSolutionsPaginator { + options := ListSolutionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSolutionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSolutions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/personalize/go.mod b/service/personalize/go.mod index d5ea632a752..3c021a73f5a 100644 --- a/service/personalize/go.mod +++ b/service/personalize/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/personalize/go.sum b/service/personalize/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/personalize/go.sum +++ b/service/personalize/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index beb981a5ae3..00000000000 --- a/service/personalize/paginators.go +++ /dev/null @@ -1,757 +0,0 @@ -// 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.mod b/service/personalizeevents/go.mod index f2d120d994f..c603ad2b383 100644 --- a/service/personalizeevents/go.mod +++ b/service/personalizeevents/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/personalizeevents/go.sum b/service/personalizeevents/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/personalizeevents/go.sum +++ b/service/personalizeevents/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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.mod b/service/personalizeruntime/go.mod index 688a3edf73f..a39bb49811e 100644 --- a/service/personalizeruntime/go.mod +++ b/service/personalizeruntime/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/personalizeruntime/go.sum b/service/personalizeruntime/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/personalizeruntime/go.sum +++ b/service/personalizeruntime/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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.mod b/service/pi/go.mod index 984cd4c9bc2..122dc898e40 100644 --- a/service/pi/go.mod +++ b/service/pi/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/pi/go.sum b/service/pi/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/pi/go.sum +++ b/service/pi/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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.mod b/service/pinpoint/go.mod index 75bfedbeee5..8ad588006cc 100644 --- a/service/pinpoint/go.mod +++ b/service/pinpoint/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/pinpoint/go.sum b/service/pinpoint/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/pinpoint/go.sum +++ b/service/pinpoint/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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/api_op_GetDedicatedIps.go b/service/pinpointemail/api_op_GetDedicatedIps.go index a5c99941a74..6dbefd0c42a 100644 --- a/service/pinpointemail/api_op_GetDedicatedIps.go +++ b/service/pinpointemail/api_op_GetDedicatedIps.go @@ -4,6 +4,7 @@ package pinpointemail import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/pinpointemail/types" @@ -119,6 +120,84 @@ func addOperationGetDedicatedIpsMiddlewares(stack *middleware.Stack, options Opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetDedicatedIpsPaginator returns a new GetDedicatedIpsPaginator +func NewGetDedicatedIpsPaginator(client GetDedicatedIpsAPIClient, params *GetDedicatedIpsInput, optFns ...func(*GetDedicatedIpsPaginatorOptions)) *GetDedicatedIpsPaginator { + options := GetDedicatedIpsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetDedicatedIpsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetDedicatedIps(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/pinpointemail/api_op_ListConfigurationSets.go b/service/pinpointemail/api_op_ListConfigurationSets.go index f9fe14d886a..df3622c6a9c 100644 --- a/service/pinpointemail/api_op_ListConfigurationSets.go +++ b/service/pinpointemail/api_op_ListConfigurationSets.go @@ -4,6 +4,7 @@ package pinpointemail import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -120,6 +121,85 @@ func addOperationListConfigurationSetsMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListConfigurationSetsPaginator returns a new ListConfigurationSetsPaginator +func NewListConfigurationSetsPaginator(client ListConfigurationSetsAPIClient, params *ListConfigurationSetsInput, optFns ...func(*ListConfigurationSetsPaginatorOptions)) *ListConfigurationSetsPaginator { + options := ListConfigurationSetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListConfigurationSetsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListConfigurationSets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/pinpointemail/api_op_ListDedicatedIpPools.go b/service/pinpointemail/api_op_ListDedicatedIpPools.go index 26a32db2dc6..ed7538a253b 100644 --- a/service/pinpointemail/api_op_ListDedicatedIpPools.go +++ b/service/pinpointemail/api_op_ListDedicatedIpPools.go @@ -4,6 +4,7 @@ package pinpointemail import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -114,6 +115,85 @@ func addOperationListDedicatedIpPoolsMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDedicatedIpPoolsPaginator returns a new ListDedicatedIpPoolsPaginator +func NewListDedicatedIpPoolsPaginator(client ListDedicatedIpPoolsAPIClient, params *ListDedicatedIpPoolsInput, optFns ...func(*ListDedicatedIpPoolsPaginatorOptions)) *ListDedicatedIpPoolsPaginator { + options := ListDedicatedIpPoolsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDedicatedIpPoolsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDedicatedIpPools(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/pinpointemail/api_op_ListDeliverabilityTestReports.go b/service/pinpointemail/api_op_ListDeliverabilityTestReports.go index 3ff846b0f46..5c9ca63cfac 100644 --- a/service/pinpointemail/api_op_ListDeliverabilityTestReports.go +++ b/service/pinpointemail/api_op_ListDeliverabilityTestReports.go @@ -4,6 +4,7 @@ package pinpointemail import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/pinpointemail/types" @@ -123,6 +124,87 @@ func addOperationListDeliverabilityTestReportsMiddlewares(stack *middleware.Stac return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDeliverabilityTestReportsPaginator returns a new +// ListDeliverabilityTestReportsPaginator +func NewListDeliverabilityTestReportsPaginator(client ListDeliverabilityTestReportsAPIClient, params *ListDeliverabilityTestReportsInput, optFns ...func(*ListDeliverabilityTestReportsPaginatorOptions)) *ListDeliverabilityTestReportsPaginator { + options := ListDeliverabilityTestReportsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDeliverabilityTestReportsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDeliverabilityTestReports(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/pinpointemail/api_op_ListDomainDeliverabilityCampaigns.go b/service/pinpointemail/api_op_ListDomainDeliverabilityCampaigns.go index 25ebddc6a71..b21f4a23106 100644 --- a/service/pinpointemail/api_op_ListDomainDeliverabilityCampaigns.go +++ b/service/pinpointemail/api_op_ListDomainDeliverabilityCampaigns.go @@ -4,6 +4,7 @@ package pinpointemail import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/pinpointemail/types" @@ -148,6 +149,86 @@ func addOperationListDomainDeliverabilityCampaignsMiddlewares(stack *middleware. return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDomainDeliverabilityCampaignsPaginator returns a new +// ListDomainDeliverabilityCampaignsPaginator +func NewListDomainDeliverabilityCampaignsPaginator(client ListDomainDeliverabilityCampaignsAPIClient, params *ListDomainDeliverabilityCampaignsInput, optFns ...func(*ListDomainDeliverabilityCampaignsPaginatorOptions)) *ListDomainDeliverabilityCampaignsPaginator { + options := ListDomainDeliverabilityCampaignsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDomainDeliverabilityCampaignsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDomainDeliverabilityCampaigns(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/pinpointemail/api_op_ListEmailIdentities.go b/service/pinpointemail/api_op_ListEmailIdentities.go index 7ec4aaa4f59..106649ff116 100644 --- a/service/pinpointemail/api_op_ListEmailIdentities.go +++ b/service/pinpointemail/api_op_ListEmailIdentities.go @@ -4,6 +4,7 @@ package pinpointemail import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/pinpointemail/types" @@ -123,6 +124,86 @@ func addOperationListEmailIdentitiesMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListEmailIdentitiesPaginator returns a new ListEmailIdentitiesPaginator +func NewListEmailIdentitiesPaginator(client ListEmailIdentitiesAPIClient, params *ListEmailIdentitiesInput, optFns ...func(*ListEmailIdentitiesPaginatorOptions)) *ListEmailIdentitiesPaginator { + options := ListEmailIdentitiesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListEmailIdentitiesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListEmailIdentities(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/pinpointemail/go.mod b/service/pinpointemail/go.mod index 032d9e5913c..0764e820d6e 100644 --- a/service/pinpointemail/go.mod +++ b/service/pinpointemail/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/pinpointemail/go.sum b/service/pinpointemail/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/pinpointemail/go.sum +++ b/service/pinpointemail/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index f7495209434..00000000000 --- a/service/pinpointemail/paginators.go +++ /dev/null @@ -1,485 +0,0 @@ -// 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.mod b/service/pinpointsmsvoice/go.mod index e5a61515f3c..dc07a86e3a6 100644 --- a/service/pinpointsmsvoice/go.mod +++ b/service/pinpointsmsvoice/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/pinpointsmsvoice/go.sum b/service/pinpointsmsvoice/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/pinpointsmsvoice/go.sum +++ b/service/pinpointsmsvoice/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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/api_op_ListSpeechSynthesisTasks.go b/service/polly/api_op_ListSpeechSynthesisTasks.go index d47b21fd654..aca489c1162 100644 --- a/service/polly/api_op_ListSpeechSynthesisTasks.go +++ b/service/polly/api_op_ListSpeechSynthesisTasks.go @@ -4,6 +4,7 @@ package polly import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/polly/types" @@ -114,6 +115,83 @@ func addOperationListSpeechSynthesisTasksMiddlewares(stack *middleware.Stack, op return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListSpeechSynthesisTasksPaginator returns a new +// ListSpeechSynthesisTasksPaginator +func NewListSpeechSynthesisTasksPaginator(client ListSpeechSynthesisTasksAPIClient, params *ListSpeechSynthesisTasksInput, optFns ...func(*ListSpeechSynthesisTasksPaginatorOptions)) *ListSpeechSynthesisTasksPaginator { + options := ListSpeechSynthesisTasksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSpeechSynthesisTasksInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSpeechSynthesisTasks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/polly/go.mod b/service/polly/go.mod index 21e39359281..b595bd8c787 100644 --- a/service/polly/go.mod +++ b/service/polly/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/polly/go.sum b/service/polly/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/polly/go.sum +++ b/service/polly/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index d4d4d50ee6b..00000000000 --- a/service/polly/paginators.go +++ /dev/null @@ -1,85 +0,0 @@ -// 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/api_op_DescribeServices.go b/service/pricing/api_op_DescribeServices.go index a5f2e47ef25..18514ba57f3 100644 --- a/service/pricing/api_op_DescribeServices.go +++ b/service/pricing/api_op_DescribeServices.go @@ -4,6 +4,7 @@ package pricing import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/pricing/types" @@ -122,6 +123,81 @@ func addOperationDescribeServicesMiddlewares(stack *middleware.Stack, options Op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeServicesPaginator returns a new DescribeServicesPaginator +func NewDescribeServicesPaginator(client DescribeServicesAPIClient, params *DescribeServicesInput, optFns ...func(*DescribeServicesPaginatorOptions)) *DescribeServicesPaginator { + options := DescribeServicesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeServicesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeServices(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/pricing/api_op_GetAttributeValues.go b/service/pricing/api_op_GetAttributeValues.go index 14857232392..fbc4a510a0c 100644 --- a/service/pricing/api_op_GetAttributeValues.go +++ b/service/pricing/api_op_GetAttributeValues.go @@ -4,6 +4,7 @@ package pricing import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/pricing/types" @@ -127,6 +128,82 @@ func addOperationGetAttributeValuesMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetAttributeValuesPaginator returns a new GetAttributeValuesPaginator +func NewGetAttributeValuesPaginator(client GetAttributeValuesAPIClient, params *GetAttributeValuesInput, optFns ...func(*GetAttributeValuesPaginatorOptions)) *GetAttributeValuesPaginator { + options := GetAttributeValuesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetAttributeValuesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetAttributeValues(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/pricing/api_op_GetProducts.go b/service/pricing/api_op_GetProducts.go index c22b8cd963b..c579dcb8e6f 100644 --- a/service/pricing/api_op_GetProducts.go +++ b/service/pricing/api_op_GetProducts.go @@ -4,6 +4,7 @@ package pricing import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/pricing/types" @@ -123,6 +124,80 @@ func addOperationGetProductsMiddlewares(stack *middleware.Stack, options Options return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetProductsPaginator returns a new GetProductsPaginator +func NewGetProductsPaginator(client GetProductsAPIClient, params *GetProductsInput, optFns ...func(*GetProductsPaginatorOptions)) *GetProductsPaginator { + options := GetProductsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetProductsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetProducts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/pricing/go.mod b/service/pricing/go.mod index 1758b6f9d4d..84d485e6199 100644 --- a/service/pricing/go.mod +++ b/service/pricing/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/pricing/go.sum b/service/pricing/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/pricing/go.sum +++ b/service/pricing/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 9246a333d78..00000000000 --- a/service/pricing/paginators.go +++ /dev/null @@ -1,233 +0,0 @@ -// 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/api_op_ListJournalKinesisStreamsForLedger.go b/service/qldb/api_op_ListJournalKinesisStreamsForLedger.go index 0c57a89e561..3ee93f809fc 100644 --- a/service/qldb/api_op_ListJournalKinesisStreamsForLedger.go +++ b/service/qldb/api_op_ListJournalKinesisStreamsForLedger.go @@ -4,6 +4,7 @@ package qldb import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/qldb/types" @@ -128,6 +129,85 @@ func addOperationListJournalKinesisStreamsForLedgerMiddlewares(stack *middleware return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListJournalKinesisStreamsForLedgerPaginator returns a new +// ListJournalKinesisStreamsForLedgerPaginator +func NewListJournalKinesisStreamsForLedgerPaginator(client ListJournalKinesisStreamsForLedgerAPIClient, params *ListJournalKinesisStreamsForLedgerInput, optFns ...func(*ListJournalKinesisStreamsForLedgerPaginatorOptions)) *ListJournalKinesisStreamsForLedgerPaginator { + options := ListJournalKinesisStreamsForLedgerPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListJournalKinesisStreamsForLedgerInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListJournalKinesisStreamsForLedger(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/qldb/api_op_ListJournalS3Exports.go b/service/qldb/api_op_ListJournalS3Exports.go index e6c0d74b00b..b3c50dfec8a 100644 --- a/service/qldb/api_op_ListJournalS3Exports.go +++ b/service/qldb/api_op_ListJournalS3Exports.go @@ -4,6 +4,7 @@ package qldb import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/qldb/types" @@ -120,6 +121,83 @@ func addOperationListJournalS3ExportsMiddlewares(stack *middleware.Stack, option return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListJournalS3ExportsPaginator returns a new ListJournalS3ExportsPaginator +func NewListJournalS3ExportsPaginator(client ListJournalS3ExportsAPIClient, params *ListJournalS3ExportsInput, optFns ...func(*ListJournalS3ExportsPaginatorOptions)) *ListJournalS3ExportsPaginator { + options := ListJournalS3ExportsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListJournalS3ExportsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListJournalS3Exports(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/qldb/api_op_ListJournalS3ExportsForLedger.go b/service/qldb/api_op_ListJournalS3ExportsForLedger.go index 4bc962701eb..063c59cd711 100644 --- a/service/qldb/api_op_ListJournalS3ExportsForLedger.go +++ b/service/qldb/api_op_ListJournalS3ExportsForLedger.go @@ -4,6 +4,7 @@ package qldb import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/qldb/types" @@ -130,6 +131,85 @@ func addOperationListJournalS3ExportsForLedgerMiddlewares(stack *middleware.Stac return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListJournalS3ExportsForLedgerPaginator returns a new +// ListJournalS3ExportsForLedgerPaginator +func NewListJournalS3ExportsForLedgerPaginator(client ListJournalS3ExportsForLedgerAPIClient, params *ListJournalS3ExportsForLedgerInput, optFns ...func(*ListJournalS3ExportsForLedgerPaginatorOptions)) *ListJournalS3ExportsForLedgerPaginator { + options := ListJournalS3ExportsForLedgerPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListJournalS3ExportsForLedgerInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListJournalS3ExportsForLedger(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/qldb/api_op_ListLedgers.go b/service/qldb/api_op_ListLedgers.go index da472e08710..95756c2cab3 100644 --- a/service/qldb/api_op_ListLedgers.go +++ b/service/qldb/api_op_ListLedgers.go @@ -4,6 +4,7 @@ package qldb import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/qldb/types" @@ -119,6 +120,81 @@ func addOperationListLedgersMiddlewares(stack *middleware.Stack, options Options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListLedgersPaginator returns a new ListLedgersPaginator +func NewListLedgersPaginator(client ListLedgersAPIClient, params *ListLedgersInput, optFns ...func(*ListLedgersPaginatorOptions)) *ListLedgersPaginator { + options := ListLedgersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListLedgersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListLedgers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/qldb/go.mod b/service/qldb/go.mod index a9dc7bf4824..6ce4ddb3600 100644 --- a/service/qldb/go.mod +++ b/service/qldb/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/qldb/go.sum b/service/qldb/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/qldb/go.sum +++ b/service/qldb/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index a460aeb15bb..00000000000 --- a/service/qldb/paginators.go +++ /dev/null @@ -1,318 +0,0 @@ -// 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.mod b/service/qldbsession/go.mod index 06de95c3887..ad75d022780 100644 --- a/service/qldbsession/go.mod +++ b/service/qldbsession/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/qldbsession/go.sum b/service/qldbsession/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/qldbsession/go.sum +++ b/service/qldbsession/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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/api_op_ListAnalyses.go b/service/quicksight/api_op_ListAnalyses.go index 0e3caeaa765..0324a43acfb 100644 --- a/service/quicksight/api_op_ListAnalyses.go +++ b/service/quicksight/api_op_ListAnalyses.go @@ -4,6 +4,7 @@ package quicksight import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/quicksight/types" @@ -119,6 +120,80 @@ func addOperationListAnalysesMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAnalysesPaginator returns a new ListAnalysesPaginator +func NewListAnalysesPaginator(client ListAnalysesAPIClient, params *ListAnalysesInput, optFns ...func(*ListAnalysesPaginatorOptions)) *ListAnalysesPaginator { + options := ListAnalysesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAnalysesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAnalyses(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/quicksight/api_op_ListDashboardVersions.go b/service/quicksight/api_op_ListDashboardVersions.go index fbfd5a7dd5e..f1ba02d8f58 100644 --- a/service/quicksight/api_op_ListDashboardVersions.go +++ b/service/quicksight/api_op_ListDashboardVersions.go @@ -4,6 +4,7 @@ package quicksight import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/quicksight/types" @@ -125,6 +126,82 @@ func addOperationListDashboardVersionsMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDashboardVersionsPaginator returns a new ListDashboardVersionsPaginator +func NewListDashboardVersionsPaginator(client ListDashboardVersionsAPIClient, params *ListDashboardVersionsInput, optFns ...func(*ListDashboardVersionsPaginatorOptions)) *ListDashboardVersionsPaginator { + options := ListDashboardVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDashboardVersionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDashboardVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/quicksight/api_op_ListDashboards.go b/service/quicksight/api_op_ListDashboards.go index d6674af774a..54f382f8f95 100644 --- a/service/quicksight/api_op_ListDashboards.go +++ b/service/quicksight/api_op_ListDashboards.go @@ -4,6 +4,7 @@ package quicksight import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/quicksight/types" @@ -120,6 +121,81 @@ func addOperationListDashboardsMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDashboardsPaginator returns a new ListDashboardsPaginator +func NewListDashboardsPaginator(client ListDashboardsAPIClient, params *ListDashboardsInput, optFns ...func(*ListDashboardsPaginatorOptions)) *ListDashboardsPaginator { + options := ListDashboardsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDashboardsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDashboards(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/quicksight/api_op_ListDataSets.go b/service/quicksight/api_op_ListDataSets.go index 7d2df7b4e9a..b63fefc8d22 100644 --- a/service/quicksight/api_op_ListDataSets.go +++ b/service/quicksight/api_op_ListDataSets.go @@ -4,6 +4,7 @@ package quicksight import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/quicksight/types" @@ -120,6 +121,80 @@ func addOperationListDataSetsMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDataSetsPaginator returns a new ListDataSetsPaginator +func NewListDataSetsPaginator(client ListDataSetsAPIClient, params *ListDataSetsInput, optFns ...func(*ListDataSetsPaginatorOptions)) *ListDataSetsPaginator { + options := ListDataSetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDataSetsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDataSets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/quicksight/api_op_ListDataSources.go b/service/quicksight/api_op_ListDataSources.go index d971d54be3f..016c29e36a9 100644 --- a/service/quicksight/api_op_ListDataSources.go +++ b/service/quicksight/api_op_ListDataSources.go @@ -4,6 +4,7 @@ package quicksight import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/quicksight/types" @@ -119,6 +120,81 @@ func addOperationListDataSourcesMiddlewares(stack *middleware.Stack, options Opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDataSourcesPaginator returns a new ListDataSourcesPaginator +func NewListDataSourcesPaginator(client ListDataSourcesAPIClient, params *ListDataSourcesInput, optFns ...func(*ListDataSourcesPaginatorOptions)) *ListDataSourcesPaginator { + options := ListDataSourcesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDataSourcesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDataSources(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/quicksight/api_op_ListIngestions.go b/service/quicksight/api_op_ListIngestions.go index 728228700bd..6c40bece3a9 100644 --- a/service/quicksight/api_op_ListIngestions.go +++ b/service/quicksight/api_op_ListIngestions.go @@ -4,6 +4,7 @@ package quicksight import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/quicksight/types" @@ -124,6 +125,81 @@ func addOperationListIngestionsMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListIngestionsPaginator returns a new ListIngestionsPaginator +func NewListIngestionsPaginator(client ListIngestionsAPIClient, params *ListIngestionsInput, optFns ...func(*ListIngestionsPaginatorOptions)) *ListIngestionsPaginator { + options := ListIngestionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListIngestionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListIngestions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/quicksight/api_op_ListNamespaces.go b/service/quicksight/api_op_ListNamespaces.go index 2f0c949e20c..dd810cd23d1 100644 --- a/service/quicksight/api_op_ListNamespaces.go +++ b/service/quicksight/api_op_ListNamespaces.go @@ -4,6 +4,7 @@ package quicksight import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/quicksight/types" @@ -122,6 +123,81 @@ func addOperationListNamespacesMiddlewares(stack *middleware.Stack, options Opti return 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 results to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListNamespacesPaginator returns a new ListNamespacesPaginator +func NewListNamespacesPaginator(client ListNamespacesAPIClient, params *ListNamespacesInput, optFns ...func(*ListNamespacesPaginatorOptions)) *ListNamespacesPaginator { + options := ListNamespacesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListNamespacesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListNamespaces(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/quicksight/api_op_ListTemplateAliases.go b/service/quicksight/api_op_ListTemplateAliases.go index 2009b4cad3f..3a699f4042c 100644 --- a/service/quicksight/api_op_ListTemplateAliases.go +++ b/service/quicksight/api_op_ListTemplateAliases.go @@ -4,6 +4,7 @@ package quicksight import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/quicksight/types" @@ -125,6 +126,82 @@ func addOperationListTemplateAliasesMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTemplateAliasesPaginator returns a new ListTemplateAliasesPaginator +func NewListTemplateAliasesPaginator(client ListTemplateAliasesAPIClient, params *ListTemplateAliasesInput, optFns ...func(*ListTemplateAliasesPaginatorOptions)) *ListTemplateAliasesPaginator { + options := ListTemplateAliasesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTemplateAliasesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTemplateAliases(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/quicksight/api_op_ListTemplateVersions.go b/service/quicksight/api_op_ListTemplateVersions.go index d7637420bf4..0c5838d5081 100644 --- a/service/quicksight/api_op_ListTemplateVersions.go +++ b/service/quicksight/api_op_ListTemplateVersions.go @@ -4,6 +4,7 @@ package quicksight import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/quicksight/types" @@ -125,6 +126,82 @@ func addOperationListTemplateVersionsMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTemplateVersionsPaginator returns a new ListTemplateVersionsPaginator +func NewListTemplateVersionsPaginator(client ListTemplateVersionsAPIClient, params *ListTemplateVersionsInput, optFns ...func(*ListTemplateVersionsPaginatorOptions)) *ListTemplateVersionsPaginator { + options := ListTemplateVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTemplateVersionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTemplateVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/quicksight/api_op_ListTemplates.go b/service/quicksight/api_op_ListTemplates.go index c95722f9d9a..e5e2e8ec29b 100644 --- a/service/quicksight/api_op_ListTemplates.go +++ b/service/quicksight/api_op_ListTemplates.go @@ -4,6 +4,7 @@ package quicksight import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/quicksight/types" @@ -119,6 +120,80 @@ func addOperationListTemplatesMiddlewares(stack *middleware.Stack, options Optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTemplatesPaginator returns a new ListTemplatesPaginator +func NewListTemplatesPaginator(client ListTemplatesAPIClient, params *ListTemplatesInput, optFns ...func(*ListTemplatesPaginatorOptions)) *ListTemplatesPaginator { + options := ListTemplatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTemplatesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTemplates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/quicksight/api_op_SearchAnalyses.go b/service/quicksight/api_op_SearchAnalyses.go index fa399b2105d..4699879663a 100644 --- a/service/quicksight/api_op_SearchAnalyses.go +++ b/service/quicksight/api_op_SearchAnalyses.go @@ -4,6 +4,7 @@ package quicksight import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/quicksight/types" @@ -124,6 +125,81 @@ func addOperationSearchAnalysesMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewSearchAnalysesPaginator returns a new SearchAnalysesPaginator +func NewSearchAnalysesPaginator(client SearchAnalysesAPIClient, params *SearchAnalysesInput, optFns ...func(*SearchAnalysesPaginatorOptions)) *SearchAnalysesPaginator { + options := SearchAnalysesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchAnalysesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearchAnalyses(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/quicksight/api_op_SearchDashboards.go b/service/quicksight/api_op_SearchDashboards.go index 726eb5ed832..34e45b07d9b 100644 --- a/service/quicksight/api_op_SearchDashboards.go +++ b/service/quicksight/api_op_SearchDashboards.go @@ -4,6 +4,7 @@ package quicksight import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/quicksight/types" @@ -128,6 +129,81 @@ func addOperationSearchDashboardsMiddlewares(stack *middleware.Stack, options Op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewSearchDashboardsPaginator returns a new SearchDashboardsPaginator +func NewSearchDashboardsPaginator(client SearchDashboardsAPIClient, params *SearchDashboardsInput, optFns ...func(*SearchDashboardsPaginatorOptions)) *SearchDashboardsPaginator { + options := SearchDashboardsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchDashboardsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearchDashboards(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/quicksight/go.mod b/service/quicksight/go.mod index 3b415c4d9a3..4b32e53c1de 100644 --- a/service/quicksight/go.mod +++ b/service/quicksight/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/quicksight/go.sum b/service/quicksight/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/quicksight/go.sum +++ b/service/quicksight/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index bbfe1c37450..00000000000 --- a/service/quicksight/paginators.go +++ /dev/null @@ -1,908 +0,0 @@ -// 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/api_op_GetResourcePolicies.go b/service/ram/api_op_GetResourcePolicies.go index f3e6e23f789..5a1b9eca856 100644 --- a/service/ram/api_op_GetResourcePolicies.go +++ b/service/ram/api_op_GetResourcePolicies.go @@ -4,6 +4,7 @@ package ram import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -117,6 +118,83 @@ func addOperationGetResourcePoliciesMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetResourcePoliciesPaginator returns a new GetResourcePoliciesPaginator +func NewGetResourcePoliciesPaginator(client GetResourcePoliciesAPIClient, params *GetResourcePoliciesInput, optFns ...func(*GetResourcePoliciesPaginatorOptions)) *GetResourcePoliciesPaginator { + options := GetResourcePoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetResourcePoliciesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetResourcePolicies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ram/api_op_GetResourceShareAssociations.go b/service/ram/api_op_GetResourceShareAssociations.go index b12ebfa2c18..77c143545b2 100644 --- a/service/ram/api_op_GetResourceShareAssociations.go +++ b/service/ram/api_op_GetResourceShareAssociations.go @@ -4,6 +4,7 @@ package ram import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ram/types" @@ -131,6 +132,84 @@ func addOperationGetResourceShareAssociationsMiddlewares(stack *middleware.Stack return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetResourceShareAssociationsPaginator returns a new +// GetResourceShareAssociationsPaginator +func NewGetResourceShareAssociationsPaginator(client GetResourceShareAssociationsAPIClient, params *GetResourceShareAssociationsInput, optFns ...func(*GetResourceShareAssociationsPaginatorOptions)) *GetResourceShareAssociationsPaginator { + options := GetResourceShareAssociationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetResourceShareAssociationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetResourceShareAssociations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ram/api_op_GetResourceShareInvitations.go b/service/ram/api_op_GetResourceShareInvitations.go index 0a4543494e1..eb420e76871 100644 --- a/service/ram/api_op_GetResourceShareInvitations.go +++ b/service/ram/api_op_GetResourceShareInvitations.go @@ -4,6 +4,7 @@ package ram import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ram/types" @@ -113,6 +114,84 @@ func addOperationGetResourceShareInvitationsMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetResourceShareInvitationsPaginator returns a new +// GetResourceShareInvitationsPaginator +func NewGetResourceShareInvitationsPaginator(client GetResourceShareInvitationsAPIClient, params *GetResourceShareInvitationsInput, optFns ...func(*GetResourceShareInvitationsPaginatorOptions)) *GetResourceShareInvitationsPaginator { + options := GetResourceShareInvitationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetResourceShareInvitationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetResourceShareInvitations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ram/api_op_GetResourceShares.go b/service/ram/api_op_GetResourceShares.go index 7a90129ef37..61c49325be3 100644 --- a/service/ram/api_op_GetResourceShares.go +++ b/service/ram/api_op_GetResourceShares.go @@ -4,6 +4,7 @@ package ram import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ram/types" @@ -128,6 +129,82 @@ func addOperationGetResourceSharesMiddlewares(stack *middleware.Stack, options O return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetResourceSharesPaginator returns a new GetResourceSharesPaginator +func NewGetResourceSharesPaginator(client GetResourceSharesAPIClient, params *GetResourceSharesInput, optFns ...func(*GetResourceSharesPaginatorOptions)) *GetResourceSharesPaginator { + options := GetResourceSharesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetResourceSharesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetResourceShares(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ram/api_op_ListPendingInvitationResources.go b/service/ram/api_op_ListPendingInvitationResources.go index 7a838c73cac..aa3bd29f080 100644 --- a/service/ram/api_op_ListPendingInvitationResources.go +++ b/service/ram/api_op_ListPendingInvitationResources.go @@ -4,6 +4,7 @@ package ram import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ram/types" @@ -116,6 +117,84 @@ func addOperationListPendingInvitationResourcesMiddlewares(stack *middleware.Sta return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListPendingInvitationResourcesPaginator returns a new +// ListPendingInvitationResourcesPaginator +func NewListPendingInvitationResourcesPaginator(client ListPendingInvitationResourcesAPIClient, params *ListPendingInvitationResourcesInput, optFns ...func(*ListPendingInvitationResourcesPaginatorOptions)) *ListPendingInvitationResourcesPaginator { + options := ListPendingInvitationResourcesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPendingInvitationResourcesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPendingInvitationResources(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ram/api_op_ListPrincipals.go b/service/ram/api_op_ListPrincipals.go index a8f7927a8ef..e411acd628d 100644 --- a/service/ram/api_op_ListPrincipals.go +++ b/service/ram/api_op_ListPrincipals.go @@ -4,6 +4,7 @@ package ram import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ram/types" @@ -133,6 +134,82 @@ func addOperationListPrincipalsMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListPrincipalsPaginator returns a new ListPrincipalsPaginator +func NewListPrincipalsPaginator(client ListPrincipalsAPIClient, params *ListPrincipalsInput, optFns ...func(*ListPrincipalsPaginatorOptions)) *ListPrincipalsPaginator { + options := ListPrincipalsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPrincipalsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPrincipals(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ram/api_op_ListResources.go b/service/ram/api_op_ListResources.go index 9a838f9d712..ee9333753f5 100644 --- a/service/ram/api_op_ListResources.go +++ b/service/ram/api_op_ListResources.go @@ -4,6 +4,7 @@ package ram import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ram/types" @@ -133,6 +134,81 @@ func addOperationListResourcesMiddlewares(stack *middleware.Stack, options Optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListResourcesPaginator returns a new ListResourcesPaginator +func NewListResourcesPaginator(client ListResourcesAPIClient, params *ListResourcesInput, optFns ...func(*ListResourcesPaginatorOptions)) *ListResourcesPaginator { + options := ListResourcesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListResourcesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListResources(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ram/go.mod b/service/ram/go.mod index 93cbda3a548..8bcccea0a82 100644 --- a/service/ram/go.mod +++ b/service/ram/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/ram/go.sum b/service/ram/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/ram/go.sum +++ b/service/ram/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 84cbb6b4eba..00000000000 --- a/service/ram/paginators.go +++ /dev/null @@ -1,546 +0,0 @@ -// 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/api_op_DescribeCertificates.go b/service/rds/api_op_DescribeCertificates.go index 02e9150eb49..d45cd5dfd03 100644 --- a/service/rds/api_op_DescribeCertificates.go +++ b/service/rds/api_op_DescribeCertificates.go @@ -4,6 +4,7 @@ package rds import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/rds/types" @@ -128,6 +129,85 @@ func addOperationDescribeCertificatesMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeCertificatesPaginator returns a new DescribeCertificatesPaginator +func NewDescribeCertificatesPaginator(client DescribeCertificatesAPIClient, params *DescribeCertificatesInput, optFns ...func(*DescribeCertificatesPaginatorOptions)) *DescribeCertificatesPaginator { + options := DescribeCertificatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeCertificatesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeCertificates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeCustomAvailabilityZones.go b/service/rds/api_op_DescribeCustomAvailabilityZones.go index df24db31691..fd794940952 100644 --- a/service/rds/api_op_DescribeCustomAvailabilityZones.go +++ b/service/rds/api_op_DescribeCustomAvailabilityZones.go @@ -4,6 +4,7 @@ package rds import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/rds/types" @@ -127,6 +128,86 @@ func addOperationDescribeCustomAvailabilityZonesMiddlewares(stack *middleware.St return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeCustomAvailabilityZonesPaginator returns a new +// DescribeCustomAvailabilityZonesPaginator +func NewDescribeCustomAvailabilityZonesPaginator(client DescribeCustomAvailabilityZonesAPIClient, params *DescribeCustomAvailabilityZonesInput, optFns ...func(*DescribeCustomAvailabilityZonesPaginatorOptions)) *DescribeCustomAvailabilityZonesPaginator { + options := DescribeCustomAvailabilityZonesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeCustomAvailabilityZonesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeCustomAvailabilityZones(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeDBClusterBacktracks.go b/service/rds/api_op_DescribeDBClusterBacktracks.go index 2f1711893e6..b0fd1cd9c9e 100644 --- a/service/rds/api_op_DescribeDBClusterBacktracks.go +++ b/service/rds/api_op_DescribeDBClusterBacktracks.go @@ -4,6 +4,7 @@ package rds import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/rds/types" @@ -172,6 +173,86 @@ func addOperationDescribeDBClusterBacktracksMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeDBClusterBacktracksPaginator returns a new +// DescribeDBClusterBacktracksPaginator +func NewDescribeDBClusterBacktracksPaginator(client DescribeDBClusterBacktracksAPIClient, params *DescribeDBClusterBacktracksInput, optFns ...func(*DescribeDBClusterBacktracksPaginatorOptions)) *DescribeDBClusterBacktracksPaginator { + options := DescribeDBClusterBacktracksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBClusterBacktracksInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBClusterBacktracks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeDBClusterEndpoints.go b/service/rds/api_op_DescribeDBClusterEndpoints.go index 0d9681181bb..8d5c43f055f 100644 --- a/service/rds/api_op_DescribeDBClusterEndpoints.go +++ b/service/rds/api_op_DescribeDBClusterEndpoints.go @@ -4,6 +4,7 @@ package rds import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/rds/types" @@ -136,6 +137,86 @@ func addOperationDescribeDBClusterEndpointsMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeDBClusterEndpointsPaginator returns a new +// DescribeDBClusterEndpointsPaginator +func NewDescribeDBClusterEndpointsPaginator(client DescribeDBClusterEndpointsAPIClient, params *DescribeDBClusterEndpointsInput, optFns ...func(*DescribeDBClusterEndpointsPaginatorOptions)) *DescribeDBClusterEndpointsPaginator { + options := DescribeDBClusterEndpointsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBClusterEndpointsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBClusterEndpoints(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeDBClusterParameterGroups.go b/service/rds/api_op_DescribeDBClusterParameterGroups.go index f84dc99feff..d829524386b 100644 --- a/service/rds/api_op_DescribeDBClusterParameterGroups.go +++ b/service/rds/api_op_DescribeDBClusterParameterGroups.go @@ -4,6 +4,7 @@ package rds import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/rds/types" @@ -134,6 +135,86 @@ func addOperationDescribeDBClusterParameterGroupsMiddlewares(stack *middleware.S return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeDBClusterParameterGroupsPaginator returns a new +// DescribeDBClusterParameterGroupsPaginator +func NewDescribeDBClusterParameterGroupsPaginator(client DescribeDBClusterParameterGroupsAPIClient, params *DescribeDBClusterParameterGroupsInput, optFns ...func(*DescribeDBClusterParameterGroupsPaginatorOptions)) *DescribeDBClusterParameterGroupsPaginator { + options := DescribeDBClusterParameterGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBClusterParameterGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBClusterParameterGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeDBClusterParameters.go b/service/rds/api_op_DescribeDBClusterParameters.go index a73045aa160..2b28681d96f 100644 --- a/service/rds/api_op_DescribeDBClusterParameters.go +++ b/service/rds/api_op_DescribeDBClusterParameters.go @@ -4,6 +4,7 @@ package rds import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/rds/types" @@ -137,6 +138,86 @@ func addOperationDescribeDBClusterParametersMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeDBClusterParametersPaginator returns a new +// DescribeDBClusterParametersPaginator +func NewDescribeDBClusterParametersPaginator(client DescribeDBClusterParametersAPIClient, params *DescribeDBClusterParametersInput, optFns ...func(*DescribeDBClusterParametersPaginatorOptions)) *DescribeDBClusterParametersPaginator { + options := DescribeDBClusterParametersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBClusterParametersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBClusterParameters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeDBClusterSnapshots.go b/service/rds/api_op_DescribeDBClusterSnapshots.go index 56c7b66371c..8027dfd8d4d 100644 --- a/service/rds/api_op_DescribeDBClusterSnapshots.go +++ b/service/rds/api_op_DescribeDBClusterSnapshots.go @@ -4,6 +4,7 @@ package rds import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/rds/types" @@ -194,6 +195,86 @@ func addOperationDescribeDBClusterSnapshotsMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeDBClusterSnapshotsPaginator returns a new +// DescribeDBClusterSnapshotsPaginator +func NewDescribeDBClusterSnapshotsPaginator(client DescribeDBClusterSnapshotsAPIClient, params *DescribeDBClusterSnapshotsInput, optFns ...func(*DescribeDBClusterSnapshotsPaginatorOptions)) *DescribeDBClusterSnapshotsPaginator { + options := DescribeDBClusterSnapshotsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBClusterSnapshotsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBClusterSnapshots(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeDBClusters.go b/service/rds/api_op_DescribeDBClusters.go index 397080eb6d2..2cc3d19350d 100644 --- a/service/rds/api_op_DescribeDBClusters.go +++ b/service/rds/api_op_DescribeDBClusters.go @@ -4,6 +4,7 @@ package rds import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/rds/types" @@ -139,6 +140,85 @@ func addOperationDescribeDBClustersMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeDBClustersPaginator returns a new DescribeDBClustersPaginator +func NewDescribeDBClustersPaginator(client DescribeDBClustersAPIClient, params *DescribeDBClustersInput, optFns ...func(*DescribeDBClustersPaginatorOptions)) *DescribeDBClustersPaginator { + options := DescribeDBClustersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBClustersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBClusters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeDBEngineVersions.go b/service/rds/api_op_DescribeDBEngineVersions.go index 435eea58454..6940fe3b42f 100644 --- a/service/rds/api_op_DescribeDBEngineVersions.go +++ b/service/rds/api_op_DescribeDBEngineVersions.go @@ -4,6 +4,7 @@ package rds import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/rds/types" @@ -152,6 +153,86 @@ func addOperationDescribeDBEngineVersionsMiddlewares(stack *middleware.Stack, op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeDBEngineVersionsPaginator returns a new +// DescribeDBEngineVersionsPaginator +func NewDescribeDBEngineVersionsPaginator(client DescribeDBEngineVersionsAPIClient, params *DescribeDBEngineVersionsInput, optFns ...func(*DescribeDBEngineVersionsPaginatorOptions)) *DescribeDBEngineVersionsPaginator { + options := DescribeDBEngineVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBEngineVersionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBEngineVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeDBInstanceAutomatedBackups.go b/service/rds/api_op_DescribeDBInstanceAutomatedBackups.go index eb11ea070e8..e60072ee42a 100644 --- a/service/rds/api_op_DescribeDBInstanceAutomatedBackups.go +++ b/service/rds/api_op_DescribeDBInstanceAutomatedBackups.go @@ -4,6 +4,7 @@ package rds import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/rds/types" @@ -159,6 +160,85 @@ func addOperationDescribeDBInstanceAutomatedBackupsMiddlewares(stack *middleware return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeDBInstanceAutomatedBackupsPaginator returns a new +// DescribeDBInstanceAutomatedBackupsPaginator +func NewDescribeDBInstanceAutomatedBackupsPaginator(client DescribeDBInstanceAutomatedBackupsAPIClient, params *DescribeDBInstanceAutomatedBackupsInput, optFns ...func(*DescribeDBInstanceAutomatedBackupsPaginatorOptions)) *DescribeDBInstanceAutomatedBackupsPaginator { + options := DescribeDBInstanceAutomatedBackupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBInstanceAutomatedBackupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBInstanceAutomatedBackups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeDBInstances.go b/service/rds/api_op_DescribeDBInstances.go index b9325754ab9..e3a7dd88b21 100644 --- a/service/rds/api_op_DescribeDBInstances.go +++ b/service/rds/api_op_DescribeDBInstances.go @@ -4,6 +4,7 @@ package rds import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/rds/types" @@ -153,6 +154,85 @@ func addOperationDescribeDBInstancesMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeDBInstancesPaginator returns a new DescribeDBInstancesPaginator +func NewDescribeDBInstancesPaginator(client DescribeDBInstancesAPIClient, params *DescribeDBInstancesInput, optFns ...func(*DescribeDBInstancesPaginatorOptions)) *DescribeDBInstancesPaginator { + options := DescribeDBInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBInstancesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBInstances(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeDBLogFiles.go b/service/rds/api_op_DescribeDBLogFiles.go index f799b4fd1cc..c55cbe9592d 100644 --- a/service/rds/api_op_DescribeDBLogFiles.go +++ b/service/rds/api_op_DescribeDBLogFiles.go @@ -4,6 +4,7 @@ package rds import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/rds/types" @@ -137,6 +138,84 @@ func addOperationDescribeDBLogFilesMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeDBLogFilesPaginator returns a new DescribeDBLogFilesPaginator +func NewDescribeDBLogFilesPaginator(client DescribeDBLogFilesAPIClient, params *DescribeDBLogFilesInput, optFns ...func(*DescribeDBLogFilesPaginatorOptions)) *DescribeDBLogFilesPaginator { + options := DescribeDBLogFilesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBLogFilesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBLogFiles(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeDBParameterGroups.go b/service/rds/api_op_DescribeDBParameterGroups.go index 7f0b4601d4c..60b5202c864 100644 --- a/service/rds/api_op_DescribeDBParameterGroups.go +++ b/service/rds/api_op_DescribeDBParameterGroups.go @@ -4,6 +4,7 @@ package rds import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/rds/types" @@ -129,6 +130,86 @@ func addOperationDescribeDBParameterGroupsMiddlewares(stack *middleware.Stack, o return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeDBParameterGroupsPaginator returns a new +// DescribeDBParameterGroupsPaginator +func NewDescribeDBParameterGroupsPaginator(client DescribeDBParameterGroupsAPIClient, params *DescribeDBParameterGroupsInput, optFns ...func(*DescribeDBParameterGroupsPaginatorOptions)) *DescribeDBParameterGroupsPaginator { + options := DescribeDBParameterGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBParameterGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBParameterGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeDBParameters.go b/service/rds/api_op_DescribeDBParameters.go index e79eef71955..90b9492db99 100644 --- a/service/rds/api_op_DescribeDBParameters.go +++ b/service/rds/api_op_DescribeDBParameters.go @@ -4,6 +4,7 @@ package rds import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/rds/types" @@ -132,6 +133,85 @@ func addOperationDescribeDBParametersMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeDBParametersPaginator returns a new DescribeDBParametersPaginator +func NewDescribeDBParametersPaginator(client DescribeDBParametersAPIClient, params *DescribeDBParametersInput, optFns ...func(*DescribeDBParametersPaginatorOptions)) *DescribeDBParametersPaginator { + options := DescribeDBParametersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBParametersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBParameters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeDBProxies.go b/service/rds/api_op_DescribeDBProxies.go index 15941f74a81..820ea7c0f5d 100644 --- a/service/rds/api_op_DescribeDBProxies.go +++ b/service/rds/api_op_DescribeDBProxies.go @@ -4,6 +4,7 @@ package rds import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/rds/types" @@ -121,6 +122,84 @@ func addOperationDescribeDBProxiesMiddlewares(stack *middleware.Stack, options O return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeDBProxiesPaginator returns a new DescribeDBProxiesPaginator +func NewDescribeDBProxiesPaginator(client DescribeDBProxiesAPIClient, params *DescribeDBProxiesInput, optFns ...func(*DescribeDBProxiesPaginatorOptions)) *DescribeDBProxiesPaginator { + options := DescribeDBProxiesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBProxiesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBProxies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeDBProxyTargetGroups.go b/service/rds/api_op_DescribeDBProxyTargetGroups.go index 056e4ad94a7..6de58d8417f 100644 --- a/service/rds/api_op_DescribeDBProxyTargetGroups.go +++ b/service/rds/api_op_DescribeDBProxyTargetGroups.go @@ -4,6 +4,7 @@ package rds import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/rds/types" @@ -128,6 +129,86 @@ func addOperationDescribeDBProxyTargetGroupsMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeDBProxyTargetGroupsPaginator returns a new +// DescribeDBProxyTargetGroupsPaginator +func NewDescribeDBProxyTargetGroupsPaginator(client DescribeDBProxyTargetGroupsAPIClient, params *DescribeDBProxyTargetGroupsInput, optFns ...func(*DescribeDBProxyTargetGroupsPaginatorOptions)) *DescribeDBProxyTargetGroupsPaginator { + options := DescribeDBProxyTargetGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBProxyTargetGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBProxyTargetGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeDBProxyTargets.go b/service/rds/api_op_DescribeDBProxyTargets.go index f2ef0ab06b6..1b6edfb4794 100644 --- a/service/rds/api_op_DescribeDBProxyTargets.go +++ b/service/rds/api_op_DescribeDBProxyTargets.go @@ -4,6 +4,7 @@ package rds import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/rds/types" @@ -127,6 +128,85 @@ func addOperationDescribeDBProxyTargetsMiddlewares(stack *middleware.Stack, opti return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeDBProxyTargetsPaginator returns a new DescribeDBProxyTargetsPaginator +func NewDescribeDBProxyTargetsPaginator(client DescribeDBProxyTargetsAPIClient, params *DescribeDBProxyTargetsInput, optFns ...func(*DescribeDBProxyTargetsPaginatorOptions)) *DescribeDBProxyTargetsPaginator { + options := DescribeDBProxyTargetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBProxyTargetsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBProxyTargets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeDBSecurityGroups.go b/service/rds/api_op_DescribeDBSecurityGroups.go index 478be788ef1..1048a2fe734 100644 --- a/service/rds/api_op_DescribeDBSecurityGroups.go +++ b/service/rds/api_op_DescribeDBSecurityGroups.go @@ -4,6 +4,7 @@ package rds import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/rds/types" @@ -126,6 +127,86 @@ func addOperationDescribeDBSecurityGroupsMiddlewares(stack *middleware.Stack, op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeDBSecurityGroupsPaginator returns a new +// DescribeDBSecurityGroupsPaginator +func NewDescribeDBSecurityGroupsPaginator(client DescribeDBSecurityGroupsAPIClient, params *DescribeDBSecurityGroupsInput, optFns ...func(*DescribeDBSecurityGroupsPaginatorOptions)) *DescribeDBSecurityGroupsPaginator { + options := DescribeDBSecurityGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBSecurityGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBSecurityGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeDBSnapshots.go b/service/rds/api_op_DescribeDBSnapshots.go index 4aee3087886..fb15d62d0b9 100644 --- a/service/rds/api_op_DescribeDBSnapshots.go +++ b/service/rds/api_op_DescribeDBSnapshots.go @@ -4,6 +4,7 @@ package rds import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/rds/types" @@ -203,6 +204,85 @@ func addOperationDescribeDBSnapshotsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeDBSnapshotsPaginator returns a new DescribeDBSnapshotsPaginator +func NewDescribeDBSnapshotsPaginator(client DescribeDBSnapshotsAPIClient, params *DescribeDBSnapshotsInput, optFns ...func(*DescribeDBSnapshotsPaginatorOptions)) *DescribeDBSnapshotsPaginator { + options := DescribeDBSnapshotsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBSnapshotsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBSnapshots(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeDBSubnetGroups.go b/service/rds/api_op_DescribeDBSubnetGroups.go index bdf811da758..d0982d108e7 100644 --- a/service/rds/api_op_DescribeDBSubnetGroups.go +++ b/service/rds/api_op_DescribeDBSubnetGroups.go @@ -4,6 +4,7 @@ package rds import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/rds/types" @@ -127,6 +128,85 @@ func addOperationDescribeDBSubnetGroupsMiddlewares(stack *middleware.Stack, opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeDBSubnetGroupsPaginator returns a new DescribeDBSubnetGroupsPaginator +func NewDescribeDBSubnetGroupsPaginator(client DescribeDBSubnetGroupsAPIClient, params *DescribeDBSubnetGroupsInput, optFns ...func(*DescribeDBSubnetGroupsPaginatorOptions)) *DescribeDBSubnetGroupsPaginator { + options := DescribeDBSubnetGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBSubnetGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBSubnetGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeEngineDefaultParameters.go b/service/rds/api_op_DescribeEngineDefaultParameters.go index 92e2f140063..611e3113019 100644 --- a/service/rds/api_op_DescribeEngineDefaultParameters.go +++ b/service/rds/api_op_DescribeEngineDefaultParameters.go @@ -4,6 +4,7 @@ package rds import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/rds/types" @@ -122,6 +123,91 @@ func addOperationDescribeEngineDefaultParametersMiddlewares(stack *middleware.St return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeEngineDefaultParametersPaginator returns a new +// DescribeEngineDefaultParametersPaginator +func NewDescribeEngineDefaultParametersPaginator(client DescribeEngineDefaultParametersAPIClient, params *DescribeEngineDefaultParametersInput, optFns ...func(*DescribeEngineDefaultParametersPaginatorOptions)) *DescribeEngineDefaultParametersPaginator { + options := DescribeEngineDefaultParametersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEngineDefaultParametersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + if result.EngineDefaults != nil { + p.nextToken = result.EngineDefaults.Marker + } else { + p.nextToken = nil + } + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEngineDefaultParameters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeEventSubscriptions.go b/service/rds/api_op_DescribeEventSubscriptions.go index 58077516c0e..1b84d7b5e35 100644 --- a/service/rds/api_op_DescribeEventSubscriptions.go +++ b/service/rds/api_op_DescribeEventSubscriptions.go @@ -4,6 +4,7 @@ package rds import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/rds/types" @@ -128,6 +129,86 @@ func addOperationDescribeEventSubscriptionsMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeEventSubscriptionsPaginator returns a new +// DescribeEventSubscriptionsPaginator +func NewDescribeEventSubscriptionsPaginator(client DescribeEventSubscriptionsAPIClient, params *DescribeEventSubscriptionsInput, optFns ...func(*DescribeEventSubscriptionsPaginatorOptions)) *DescribeEventSubscriptionsPaginator { + options := DescribeEventSubscriptionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEventSubscriptionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEventSubscriptions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeEvents.go b/service/rds/api_op_DescribeEvents.go index ec31909db69..abb697eff50 100644 --- a/service/rds/api_op_DescribeEvents.go +++ b/service/rds/api_op_DescribeEvents.go @@ -4,6 +4,7 @@ package rds import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/rds/types" @@ -176,6 +177,84 @@ func addOperationDescribeEventsMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeEventsPaginator returns a new DescribeEventsPaginator +func NewDescribeEventsPaginator(client DescribeEventsAPIClient, params *DescribeEventsInput, optFns ...func(*DescribeEventsPaginatorOptions)) *DescribeEventsPaginator { + options := DescribeEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEventsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEvents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeExportTasks.go b/service/rds/api_op_DescribeExportTasks.go index f34c4982371..e654d1bd94e 100644 --- a/service/rds/api_op_DescribeExportTasks.go +++ b/service/rds/api_op_DescribeExportTasks.go @@ -4,6 +4,7 @@ package rds import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/rds/types" @@ -140,6 +141,86 @@ func addOperationDescribeExportTasksMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeExportTasksPaginator returns a new DescribeExportTasksPaginator +func NewDescribeExportTasksPaginator(client DescribeExportTasksAPIClient, params *DescribeExportTasksInput, optFns ...func(*DescribeExportTasksPaginatorOptions)) *DescribeExportTasksPaginator { + options := DescribeExportTasksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeExportTasksInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeExportTasks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeGlobalClusters.go b/service/rds/api_op_DescribeGlobalClusters.go index a3541ea9228..04a8d73f151 100644 --- a/service/rds/api_op_DescribeGlobalClusters.go +++ b/service/rds/api_op_DescribeGlobalClusters.go @@ -4,6 +4,7 @@ package rds import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/rds/types" @@ -134,6 +135,85 @@ func addOperationDescribeGlobalClustersMiddlewares(stack *middleware.Stack, opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeGlobalClustersPaginator returns a new DescribeGlobalClustersPaginator +func NewDescribeGlobalClustersPaginator(client DescribeGlobalClustersAPIClient, params *DescribeGlobalClustersInput, optFns ...func(*DescribeGlobalClustersPaginatorOptions)) *DescribeGlobalClustersPaginator { + options := DescribeGlobalClustersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeGlobalClustersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeGlobalClusters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeInstallationMedia.go b/service/rds/api_op_DescribeInstallationMedia.go index 172ee486c1e..9d1079a9362 100644 --- a/service/rds/api_op_DescribeInstallationMedia.go +++ b/service/rds/api_op_DescribeInstallationMedia.go @@ -4,6 +4,7 @@ package rds import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/rds/types" @@ -131,6 +132,85 @@ func addOperationDescribeInstallationMediaMiddlewares(stack *middleware.Stack, o return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeInstallationMediaPaginator returns a new +// DescribeInstallationMediaPaginator +func NewDescribeInstallationMediaPaginator(client DescribeInstallationMediaAPIClient, params *DescribeInstallationMediaInput, optFns ...func(*DescribeInstallationMediaPaginatorOptions)) *DescribeInstallationMediaPaginator { + options := DescribeInstallationMediaPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeInstallationMediaInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeInstallationMedia(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeOptionGroupOptions.go b/service/rds/api_op_DescribeOptionGroupOptions.go index 7142748ff89..05e4e2b0799 100644 --- a/service/rds/api_op_DescribeOptionGroupOptions.go +++ b/service/rds/api_op_DescribeOptionGroupOptions.go @@ -4,6 +4,7 @@ package rds import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/rds/types" @@ -129,6 +130,86 @@ func addOperationDescribeOptionGroupOptionsMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeOptionGroupOptionsPaginator returns a new +// DescribeOptionGroupOptionsPaginator +func NewDescribeOptionGroupOptionsPaginator(client DescribeOptionGroupOptionsAPIClient, params *DescribeOptionGroupOptionsInput, optFns ...func(*DescribeOptionGroupOptionsPaginatorOptions)) *DescribeOptionGroupOptionsPaginator { + options := DescribeOptionGroupOptionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeOptionGroupOptionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeOptionGroupOptions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeOptionGroups.go b/service/rds/api_op_DescribeOptionGroups.go index 5d054577c6d..66a735355dc 100644 --- a/service/rds/api_op_DescribeOptionGroups.go +++ b/service/rds/api_op_DescribeOptionGroups.go @@ -4,6 +4,7 @@ package rds import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/rds/types" @@ -133,6 +134,85 @@ func addOperationDescribeOptionGroupsMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeOptionGroupsPaginator returns a new DescribeOptionGroupsPaginator +func NewDescribeOptionGroupsPaginator(client DescribeOptionGroupsAPIClient, params *DescribeOptionGroupsInput, optFns ...func(*DescribeOptionGroupsPaginatorOptions)) *DescribeOptionGroupsPaginator { + options := DescribeOptionGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeOptionGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeOptionGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeOrderableDBInstanceOptions.go b/service/rds/api_op_DescribeOrderableDBInstanceOptions.go index 038e515f6ba..49ad08b143d 100644 --- a/service/rds/api_op_DescribeOrderableDBInstanceOptions.go +++ b/service/rds/api_op_DescribeOrderableDBInstanceOptions.go @@ -4,6 +4,7 @@ package rds import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/rds/types" @@ -148,6 +149,86 @@ func addOperationDescribeOrderableDBInstanceOptionsMiddlewares(stack *middleware return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeOrderableDBInstanceOptionsPaginator returns a new +// DescribeOrderableDBInstanceOptionsPaginator +func NewDescribeOrderableDBInstanceOptionsPaginator(client DescribeOrderableDBInstanceOptionsAPIClient, params *DescribeOrderableDBInstanceOptionsInput, optFns ...func(*DescribeOrderableDBInstanceOptionsPaginatorOptions)) *DescribeOrderableDBInstanceOptionsPaginator { + options := DescribeOrderableDBInstanceOptionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeOrderableDBInstanceOptionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeOrderableDBInstanceOptions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribePendingMaintenanceActions.go b/service/rds/api_op_DescribePendingMaintenanceActions.go index 74977e79824..87ddb1c7760 100644 --- a/service/rds/api_op_DescribePendingMaintenanceActions.go +++ b/service/rds/api_op_DescribePendingMaintenanceActions.go @@ -4,6 +4,7 @@ package rds import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/rds/types" @@ -136,6 +137,86 @@ func addOperationDescribePendingMaintenanceActionsMiddlewares(stack *middleware. return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribePendingMaintenanceActionsPaginator returns a new +// DescribePendingMaintenanceActionsPaginator +func NewDescribePendingMaintenanceActionsPaginator(client DescribePendingMaintenanceActionsAPIClient, params *DescribePendingMaintenanceActionsInput, optFns ...func(*DescribePendingMaintenanceActionsPaginatorOptions)) *DescribePendingMaintenanceActionsPaginator { + options := DescribePendingMaintenanceActionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribePendingMaintenanceActionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribePendingMaintenanceActions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeReservedDBInstances.go b/service/rds/api_op_DescribeReservedDBInstances.go index bddce01fc68..21c323eae27 100644 --- a/service/rds/api_op_DescribeReservedDBInstances.go +++ b/service/rds/api_op_DescribeReservedDBInstances.go @@ -4,6 +4,7 @@ package rds import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/rds/types" @@ -157,6 +158,86 @@ func addOperationDescribeReservedDBInstancesMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeReservedDBInstancesPaginator returns a new +// DescribeReservedDBInstancesPaginator +func NewDescribeReservedDBInstancesPaginator(client DescribeReservedDBInstancesAPIClient, params *DescribeReservedDBInstancesInput, optFns ...func(*DescribeReservedDBInstancesPaginatorOptions)) *DescribeReservedDBInstancesPaginator { + options := DescribeReservedDBInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeReservedDBInstancesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeReservedDBInstances(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeReservedDBInstancesOfferings.go b/service/rds/api_op_DescribeReservedDBInstancesOfferings.go index 236d02d47ca..3a3dde1040d 100644 --- a/service/rds/api_op_DescribeReservedDBInstancesOfferings.go +++ b/service/rds/api_op_DescribeReservedDBInstancesOfferings.go @@ -4,6 +4,7 @@ package rds import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/rds/types" @@ -149,6 +150,86 @@ func addOperationDescribeReservedDBInstancesOfferingsMiddlewares(stack *middlewa return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeReservedDBInstancesOfferingsPaginator returns a new +// DescribeReservedDBInstancesOfferingsPaginator +func NewDescribeReservedDBInstancesOfferingsPaginator(client DescribeReservedDBInstancesOfferingsAPIClient, params *DescribeReservedDBInstancesOfferingsInput, optFns ...func(*DescribeReservedDBInstancesOfferingsPaginatorOptions)) *DescribeReservedDBInstancesOfferingsPaginator { + options := DescribeReservedDBInstancesOfferingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeReservedDBInstancesOfferingsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeReservedDBInstancesOfferings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeSourceRegions.go b/service/rds/api_op_DescribeSourceRegions.go index 5ccc1ff072b..345964ce693 100644 --- a/service/rds/api_op_DescribeSourceRegions.go +++ b/service/rds/api_op_DescribeSourceRegions.go @@ -4,6 +4,7 @@ package rds import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/rds/types" @@ -129,6 +130,85 @@ func addOperationDescribeSourceRegionsMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeSourceRegionsPaginator returns a new DescribeSourceRegionsPaginator +func NewDescribeSourceRegionsPaginator(client DescribeSourceRegionsAPIClient, params *DescribeSourceRegionsInput, optFns ...func(*DescribeSourceRegionsPaginatorOptions)) *DescribeSourceRegionsPaginator { + options := DescribeSourceRegionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeSourceRegionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeSourceRegions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/go.mod b/service/rds/go.mod index 9e53b5dc9a7..4df8c89ca82 100644 --- a/service/rds/go.mod +++ b/service/rds/go.mod @@ -5,7 +5,7 @@ go 1.15 require ( github.com/aws/aws-sdk-go-v2 v0.29.0 github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v0.1.0 - github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/rds/go.sum b/service/rds/go.sum index 875bf37048a..a611da1251c 100644 --- a/service/rds/go.sum +++ b/service/rds/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index ca97f95d859..00000000000 --- a/service/rds/paginators.go +++ /dev/null @@ -1,2632 +0,0 @@ -// 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.mod b/service/rdsdata/go.mod index 15373a9f2f8..37a35b3d02c 100644 --- a/service/rdsdata/go.mod +++ b/service/rdsdata/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/rdsdata/go.sum b/service/rdsdata/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/rdsdata/go.sum +++ b/service/rdsdata/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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/api_op_DescribeClusterParameterGroups.go b/service/redshift/api_op_DescribeClusterParameterGroups.go index ce1b0beffe0..9c71f485a94 100644 --- a/service/redshift/api_op_DescribeClusterParameterGroups.go +++ b/service/redshift/api_op_DescribeClusterParameterGroups.go @@ -4,6 +4,7 @@ package redshift import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/redshift/types" @@ -154,6 +155,87 @@ func addOperationDescribeClusterParameterGroupsMiddlewares(stack *middleware.Sta return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeClusterParameterGroupsPaginator returns a new +// DescribeClusterParameterGroupsPaginator +func NewDescribeClusterParameterGroupsPaginator(client DescribeClusterParameterGroupsAPIClient, params *DescribeClusterParameterGroupsInput, optFns ...func(*DescribeClusterParameterGroupsPaginatorOptions)) *DescribeClusterParameterGroupsPaginator { + options := DescribeClusterParameterGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeClusterParameterGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeClusterParameterGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/redshift/api_op_DescribeClusterParameters.go b/service/redshift/api_op_DescribeClusterParameters.go index 820fc3051b8..f4b8d99b670 100644 --- a/service/redshift/api_op_DescribeClusterParameters.go +++ b/service/redshift/api_op_DescribeClusterParameters.go @@ -4,6 +4,7 @@ package redshift import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/redshift/types" @@ -143,6 +144,87 @@ func addOperationDescribeClusterParametersMiddlewares(stack *middleware.Stack, o return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeClusterParametersPaginator returns a new +// DescribeClusterParametersPaginator +func NewDescribeClusterParametersPaginator(client DescribeClusterParametersAPIClient, params *DescribeClusterParametersInput, optFns ...func(*DescribeClusterParametersPaginatorOptions)) *DescribeClusterParametersPaginator { + options := DescribeClusterParametersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeClusterParametersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeClusterParameters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/redshift/api_op_DescribeClusterSecurityGroups.go b/service/redshift/api_op_DescribeClusterSecurityGroups.go index b9168a576dd..9f9b03705ee 100644 --- a/service/redshift/api_op_DescribeClusterSecurityGroups.go +++ b/service/redshift/api_op_DescribeClusterSecurityGroups.go @@ -4,6 +4,7 @@ package redshift import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/redshift/types" @@ -153,6 +154,87 @@ func addOperationDescribeClusterSecurityGroupsMiddlewares(stack *middleware.Stac return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeClusterSecurityGroupsPaginator returns a new +// DescribeClusterSecurityGroupsPaginator +func NewDescribeClusterSecurityGroupsPaginator(client DescribeClusterSecurityGroupsAPIClient, params *DescribeClusterSecurityGroupsInput, optFns ...func(*DescribeClusterSecurityGroupsPaginatorOptions)) *DescribeClusterSecurityGroupsPaginator { + options := DescribeClusterSecurityGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeClusterSecurityGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeClusterSecurityGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/redshift/api_op_DescribeClusterSnapshots.go b/service/redshift/api_op_DescribeClusterSnapshots.go index 0d0c74beb2e..30fa36096d7 100644 --- a/service/redshift/api_op_DescribeClusterSnapshots.go +++ b/service/redshift/api_op_DescribeClusterSnapshots.go @@ -4,6 +4,7 @@ package redshift import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/redshift/types" @@ -201,6 +202,87 @@ func addOperationDescribeClusterSnapshotsMiddlewares(stack *middleware.Stack, op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeClusterSnapshotsPaginator returns a new +// DescribeClusterSnapshotsPaginator +func NewDescribeClusterSnapshotsPaginator(client DescribeClusterSnapshotsAPIClient, params *DescribeClusterSnapshotsInput, optFns ...func(*DescribeClusterSnapshotsPaginatorOptions)) *DescribeClusterSnapshotsPaginator { + options := DescribeClusterSnapshotsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeClusterSnapshotsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeClusterSnapshots(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/redshift/api_op_DescribeClusterSubnetGroups.go b/service/redshift/api_op_DescribeClusterSubnetGroups.go index cff1fd0513f..2e01096ffe1 100644 --- a/service/redshift/api_op_DescribeClusterSubnetGroups.go +++ b/service/redshift/api_op_DescribeClusterSubnetGroups.go @@ -4,6 +4,7 @@ package redshift import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/redshift/types" @@ -148,6 +149,87 @@ func addOperationDescribeClusterSubnetGroupsMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeClusterSubnetGroupsPaginator returns a new +// DescribeClusterSubnetGroupsPaginator +func NewDescribeClusterSubnetGroupsPaginator(client DescribeClusterSubnetGroupsAPIClient, params *DescribeClusterSubnetGroupsInput, optFns ...func(*DescribeClusterSubnetGroupsPaginatorOptions)) *DescribeClusterSubnetGroupsPaginator { + options := DescribeClusterSubnetGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeClusterSubnetGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeClusterSubnetGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/redshift/api_op_DescribeClusterVersions.go b/service/redshift/api_op_DescribeClusterVersions.go index ee2c0ce5130..4fb01547a3f 100644 --- a/service/redshift/api_op_DescribeClusterVersions.go +++ b/service/redshift/api_op_DescribeClusterVersions.go @@ -4,6 +4,7 @@ package redshift import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/redshift/types" @@ -138,6 +139,87 @@ func addOperationDescribeClusterVersionsMiddlewares(stack *middleware.Stack, opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeClusterVersionsPaginator returns a new +// DescribeClusterVersionsPaginator +func NewDescribeClusterVersionsPaginator(client DescribeClusterVersionsAPIClient, params *DescribeClusterVersionsInput, optFns ...func(*DescribeClusterVersionsPaginatorOptions)) *DescribeClusterVersionsPaginator { + options := DescribeClusterVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeClusterVersionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeClusterVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/redshift/api_op_DescribeClusters.go b/service/redshift/api_op_DescribeClusters.go index cd71b8c0f6a..3c670d24478 100644 --- a/service/redshift/api_op_DescribeClusters.go +++ b/service/redshift/api_op_DescribeClusters.go @@ -4,6 +4,7 @@ package redshift import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/redshift/types" @@ -152,6 +153,85 @@ func addOperationDescribeClustersMiddlewares(stack *middleware.Stack, options Op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeClustersPaginator returns a new DescribeClustersPaginator +func NewDescribeClustersPaginator(client DescribeClustersAPIClient, params *DescribeClustersInput, optFns ...func(*DescribeClustersPaginatorOptions)) *DescribeClustersPaginator { + options := DescribeClustersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeClustersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeClusters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/redshift/api_op_DescribeDefaultClusterParameters.go b/service/redshift/api_op_DescribeDefaultClusterParameters.go index eefc26b0910..6f9445d0671 100644 --- a/service/redshift/api_op_DescribeDefaultClusterParameters.go +++ b/service/redshift/api_op_DescribeDefaultClusterParameters.go @@ -4,6 +4,7 @@ package redshift import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/redshift/types" @@ -124,6 +125,92 @@ func addOperationDescribeDefaultClusterParametersMiddlewares(stack *middleware.S return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeDefaultClusterParametersPaginator returns a new +// DescribeDefaultClusterParametersPaginator +func NewDescribeDefaultClusterParametersPaginator(client DescribeDefaultClusterParametersAPIClient, params *DescribeDefaultClusterParametersInput, optFns ...func(*DescribeDefaultClusterParametersPaginatorOptions)) *DescribeDefaultClusterParametersPaginator { + options := DescribeDefaultClusterParametersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDefaultClusterParametersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + if result.DefaultClusterParameters != nil { + p.nextToken = result.DefaultClusterParameters.Marker + } else { + p.nextToken = nil + } + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDefaultClusterParameters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/redshift/api_op_DescribeEventSubscriptions.go b/service/redshift/api_op_DescribeEventSubscriptions.go index e646d9dfbec..7e0f9775802 100644 --- a/service/redshift/api_op_DescribeEventSubscriptions.go +++ b/service/redshift/api_op_DescribeEventSubscriptions.go @@ -4,6 +4,7 @@ package redshift import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/redshift/types" @@ -148,6 +149,87 @@ func addOperationDescribeEventSubscriptionsMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeEventSubscriptionsPaginator returns a new +// DescribeEventSubscriptionsPaginator +func NewDescribeEventSubscriptionsPaginator(client DescribeEventSubscriptionsAPIClient, params *DescribeEventSubscriptionsInput, optFns ...func(*DescribeEventSubscriptionsPaginatorOptions)) *DescribeEventSubscriptionsPaginator { + options := DescribeEventSubscriptionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEventSubscriptionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEventSubscriptions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/redshift/api_op_DescribeEvents.go b/service/redshift/api_op_DescribeEvents.go index 4f95784bfca..92315d99c7c 100644 --- a/service/redshift/api_op_DescribeEvents.go +++ b/service/redshift/api_op_DescribeEvents.go @@ -4,6 +4,7 @@ package redshift import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/redshift/types" @@ -174,6 +175,85 @@ func addOperationDescribeEventsMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeEventsPaginator returns a new DescribeEventsPaginator +func NewDescribeEventsPaginator(client DescribeEventsAPIClient, params *DescribeEventsInput, optFns ...func(*DescribeEventsPaginatorOptions)) *DescribeEventsPaginator { + options := DescribeEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEventsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEvents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/redshift/api_op_DescribeHsmClientCertificates.go b/service/redshift/api_op_DescribeHsmClientCertificates.go index a427edf9117..10d6ef3b041 100644 --- a/service/redshift/api_op_DescribeHsmClientCertificates.go +++ b/service/redshift/api_op_DescribeHsmClientCertificates.go @@ -4,6 +4,7 @@ package redshift import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/redshift/types" @@ -151,6 +152,87 @@ func addOperationDescribeHsmClientCertificatesMiddlewares(stack *middleware.Stac return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeHsmClientCertificatesPaginator returns a new +// DescribeHsmClientCertificatesPaginator +func NewDescribeHsmClientCertificatesPaginator(client DescribeHsmClientCertificatesAPIClient, params *DescribeHsmClientCertificatesInput, optFns ...func(*DescribeHsmClientCertificatesPaginatorOptions)) *DescribeHsmClientCertificatesPaginator { + options := DescribeHsmClientCertificatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeHsmClientCertificatesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeHsmClientCertificates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/redshift/api_op_DescribeHsmConfigurations.go b/service/redshift/api_op_DescribeHsmConfigurations.go index cec48b842e9..57b8dc29e03 100644 --- a/service/redshift/api_op_DescribeHsmConfigurations.go +++ b/service/redshift/api_op_DescribeHsmConfigurations.go @@ -4,6 +4,7 @@ package redshift import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/redshift/types" @@ -148,6 +149,87 @@ func addOperationDescribeHsmConfigurationsMiddlewares(stack *middleware.Stack, o return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeHsmConfigurationsPaginator returns a new +// DescribeHsmConfigurationsPaginator +func NewDescribeHsmConfigurationsPaginator(client DescribeHsmConfigurationsAPIClient, params *DescribeHsmConfigurationsInput, optFns ...func(*DescribeHsmConfigurationsPaginatorOptions)) *DescribeHsmConfigurationsPaginator { + options := DescribeHsmConfigurationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeHsmConfigurationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeHsmConfigurations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/redshift/api_op_DescribeNodeConfigurationOptions.go b/service/redshift/api_op_DescribeNodeConfigurationOptions.go index 005fcd9f6dd..148e9718f4c 100644 --- a/service/redshift/api_op_DescribeNodeConfigurationOptions.go +++ b/service/redshift/api_op_DescribeNodeConfigurationOptions.go @@ -4,6 +4,7 @@ package redshift import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/redshift/types" @@ -144,6 +145,87 @@ func addOperationDescribeNodeConfigurationOptionsMiddlewares(stack *middleware.S return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeNodeConfigurationOptionsPaginator returns a new +// DescribeNodeConfigurationOptionsPaginator +func NewDescribeNodeConfigurationOptionsPaginator(client DescribeNodeConfigurationOptionsAPIClient, params *DescribeNodeConfigurationOptionsInput, optFns ...func(*DescribeNodeConfigurationOptionsPaginatorOptions)) *DescribeNodeConfigurationOptionsPaginator { + options := DescribeNodeConfigurationOptionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeNodeConfigurationOptionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeNodeConfigurationOptions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/redshift/api_op_DescribeOrderableClusterOptions.go b/service/redshift/api_op_DescribeOrderableClusterOptions.go index 3c59bbd6795..c6360351c6c 100644 --- a/service/redshift/api_op_DescribeOrderableClusterOptions.go +++ b/service/redshift/api_op_DescribeOrderableClusterOptions.go @@ -4,6 +4,7 @@ package redshift import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/redshift/types" @@ -138,6 +139,87 @@ func addOperationDescribeOrderableClusterOptionsMiddlewares(stack *middleware.St return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeOrderableClusterOptionsPaginator returns a new +// DescribeOrderableClusterOptionsPaginator +func NewDescribeOrderableClusterOptionsPaginator(client DescribeOrderableClusterOptionsAPIClient, params *DescribeOrderableClusterOptionsInput, optFns ...func(*DescribeOrderableClusterOptionsPaginatorOptions)) *DescribeOrderableClusterOptionsPaginator { + options := DescribeOrderableClusterOptionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeOrderableClusterOptionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeOrderableClusterOptions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/redshift/api_op_DescribeReservedNodeOfferings.go b/service/redshift/api_op_DescribeReservedNodeOfferings.go index 06067ea8d02..55a8a1beb28 100644 --- a/service/redshift/api_op_DescribeReservedNodeOfferings.go +++ b/service/redshift/api_op_DescribeReservedNodeOfferings.go @@ -4,6 +4,7 @@ package redshift import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/redshift/types" @@ -132,6 +133,87 @@ func addOperationDescribeReservedNodeOfferingsMiddlewares(stack *middleware.Stac return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeReservedNodeOfferingsPaginator returns a new +// DescribeReservedNodeOfferingsPaginator +func NewDescribeReservedNodeOfferingsPaginator(client DescribeReservedNodeOfferingsAPIClient, params *DescribeReservedNodeOfferingsInput, optFns ...func(*DescribeReservedNodeOfferingsPaginatorOptions)) *DescribeReservedNodeOfferingsPaginator { + options := DescribeReservedNodeOfferingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeReservedNodeOfferingsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeReservedNodeOfferings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/redshift/api_op_DescribeReservedNodes.go b/service/redshift/api_op_DescribeReservedNodes.go index 2d0c022219a..ded67c4b90a 100644 --- a/service/redshift/api_op_DescribeReservedNodes.go +++ b/service/redshift/api_op_DescribeReservedNodes.go @@ -4,6 +4,7 @@ package redshift import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/redshift/types" @@ -122,6 +123,86 @@ func addOperationDescribeReservedNodesMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeReservedNodesPaginator returns a new DescribeReservedNodesPaginator +func NewDescribeReservedNodesPaginator(client DescribeReservedNodesAPIClient, params *DescribeReservedNodesInput, optFns ...func(*DescribeReservedNodesPaginatorOptions)) *DescribeReservedNodesPaginator { + options := DescribeReservedNodesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeReservedNodesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeReservedNodes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/redshift/api_op_DescribeScheduledActions.go b/service/redshift/api_op_DescribeScheduledActions.go index 185957c82dd..0923883fb26 100644 --- a/service/redshift/api_op_DescribeScheduledActions.go +++ b/service/redshift/api_op_DescribeScheduledActions.go @@ -4,6 +4,7 @@ package redshift import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/redshift/types" @@ -142,6 +143,87 @@ func addOperationDescribeScheduledActionsMiddlewares(stack *middleware.Stack, op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeScheduledActionsPaginator returns a new +// DescribeScheduledActionsPaginator +func NewDescribeScheduledActionsPaginator(client DescribeScheduledActionsAPIClient, params *DescribeScheduledActionsInput, optFns ...func(*DescribeScheduledActionsPaginatorOptions)) *DescribeScheduledActionsPaginator { + options := DescribeScheduledActionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeScheduledActionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeScheduledActions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/redshift/api_op_DescribeUsageLimits.go b/service/redshift/api_op_DescribeUsageLimits.go index 4a85c4ee0ad..05ed92ffb67 100644 --- a/service/redshift/api_op_DescribeUsageLimits.go +++ b/service/redshift/api_op_DescribeUsageLimits.go @@ -4,6 +4,7 @@ package redshift import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/redshift/types" @@ -158,6 +159,86 @@ func addOperationDescribeUsageLimitsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeUsageLimitsPaginator returns a new DescribeUsageLimitsPaginator +func NewDescribeUsageLimitsPaginator(client DescribeUsageLimitsAPIClient, params *DescribeUsageLimitsInput, optFns ...func(*DescribeUsageLimitsPaginatorOptions)) *DescribeUsageLimitsPaginator { + options := DescribeUsageLimitsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeUsageLimitsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeUsageLimits(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/redshift/go.mod b/service/redshift/go.mod index 5b8e316f064..b10e04b2cc0 100644 --- a/service/redshift/go.mod +++ b/service/redshift/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/redshift/go.sum b/service/redshift/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/redshift/go.sum +++ b/service/redshift/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index fbe0a417a1d..00000000000 --- a/service/redshift/paginators.go +++ /dev/null @@ -1,1462 +0,0 @@ -// 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/api_op_DescribeTable.go b/service/redshiftdata/api_op_DescribeTable.go index 1cd595b88d7..d36924865a4 100644 --- a/service/redshiftdata/api_op_DescribeTable.go +++ b/service/redshiftdata/api_op_DescribeTable.go @@ -4,6 +4,7 @@ package redshiftdata import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/redshiftdata/types" @@ -159,6 +160,82 @@ func addOperationDescribeTableMiddlewares(stack *middleware.Stack, options Optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeTablePaginator returns a new DescribeTablePaginator +func NewDescribeTablePaginator(client DescribeTableAPIClient, params *DescribeTableInput, optFns ...func(*DescribeTablePaginatorOptions)) *DescribeTablePaginator { + options := DescribeTablePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeTableInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeTable(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/redshiftdata/api_op_GetStatementResult.go b/service/redshiftdata/api_op_GetStatementResult.go index cfefdf62cc3..5beccdfaa5f 100644 --- a/service/redshiftdata/api_op_GetStatementResult.go +++ b/service/redshiftdata/api_op_GetStatementResult.go @@ -4,6 +4,7 @@ package redshiftdata import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/redshiftdata/types" @@ -131,6 +132,78 @@ func addOperationGetStatementResultMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetStatementResultPaginator returns a new GetStatementResultPaginator +func NewGetStatementResultPaginator(client GetStatementResultAPIClient, params *GetStatementResultInput, optFns ...func(*GetStatementResultPaginatorOptions)) *GetStatementResultPaginator { + options := GetStatementResultPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetStatementResultInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetStatementResult(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/redshiftdata/api_op_ListDatabases.go b/service/redshiftdata/api_op_ListDatabases.go index ba01ae39ba4..afd3dbbd6a0 100644 --- a/service/redshiftdata/api_op_ListDatabases.go +++ b/service/redshiftdata/api_op_ListDatabases.go @@ -4,6 +4,7 @@ package redshiftdata import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -145,6 +146,82 @@ func addOperationListDatabasesMiddlewares(stack *middleware.Stack, options Optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDatabasesPaginator returns a new ListDatabasesPaginator +func NewListDatabasesPaginator(client ListDatabasesAPIClient, params *ListDatabasesInput, optFns ...func(*ListDatabasesPaginatorOptions)) *ListDatabasesPaginator { + options := ListDatabasesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDatabasesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDatabases(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/redshiftdata/api_op_ListSchemas.go b/service/redshiftdata/api_op_ListSchemas.go index 7669b837214..00cdf28df34 100644 --- a/service/redshiftdata/api_op_ListSchemas.go +++ b/service/redshiftdata/api_op_ListSchemas.go @@ -4,6 +4,7 @@ package redshiftdata import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -152,6 +153,82 @@ func addOperationListSchemasMiddlewares(stack *middleware.Stack, options Options return 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 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListSchemasPaginator returns a new ListSchemasPaginator +func NewListSchemasPaginator(client ListSchemasAPIClient, params *ListSchemasInput, optFns ...func(*ListSchemasPaginatorOptions)) *ListSchemasPaginator { + options := ListSchemasPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSchemasInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSchemas(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/redshiftdata/api_op_ListStatements.go b/service/redshiftdata/api_op_ListStatements.go index 79ba6849eff..907a2106b73 100644 --- a/service/redshiftdata/api_op_ListStatements.go +++ b/service/redshiftdata/api_op_ListStatements.go @@ -4,6 +4,7 @@ package redshiftdata import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/redshiftdata/types" @@ -148,6 +149,83 @@ func addOperationListStatementsMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListStatementsPaginator returns a new ListStatementsPaginator +func NewListStatementsPaginator(client ListStatementsAPIClient, params *ListStatementsInput, optFns ...func(*ListStatementsPaginatorOptions)) *ListStatementsPaginator { + options := ListStatementsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListStatementsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListStatements(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/redshiftdata/api_op_ListTables.go b/service/redshiftdata/api_op_ListTables.go index 281e98f3cd5..89b97782f57 100644 --- a/service/redshiftdata/api_op_ListTables.go +++ b/service/redshiftdata/api_op_ListTables.go @@ -4,6 +4,7 @@ package redshiftdata import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/redshiftdata/types" @@ -166,6 +167,82 @@ func addOperationListTablesMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTablesPaginator returns a new ListTablesPaginator +func NewListTablesPaginator(client ListTablesAPIClient, params *ListTablesInput, optFns ...func(*ListTablesPaginatorOptions)) *ListTablesPaginator { + options := ListTablesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTablesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTables(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/redshiftdata/go.mod b/service/redshiftdata/go.mod index 3a6d12a9a57..269e67c9257 100644 --- a/service/redshiftdata/go.mod +++ b/service/redshiftdata/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/redshiftdata/go.sum b/service/redshiftdata/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/redshiftdata/go.sum +++ b/service/redshiftdata/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 9624e59b111..00000000000 --- a/service/redshiftdata/paginators.go +++ /dev/null @@ -1,461 +0,0 @@ -// 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/api_op_DescribeProjectVersions.go b/service/rekognition/api_op_DescribeProjectVersions.go index b5a9e8549b4..99558c64267 100644 --- a/service/rekognition/api_op_DescribeProjectVersions.go +++ b/service/rekognition/api_op_DescribeProjectVersions.go @@ -4,6 +4,7 @@ package rekognition import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/rekognition/types" @@ -132,6 +133,85 @@ func addOperationDescribeProjectVersionsMiddlewares(stack *middleware.Stack, opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeProjectVersionsPaginator returns a new +// DescribeProjectVersionsPaginator +func NewDescribeProjectVersionsPaginator(client DescribeProjectVersionsAPIClient, params *DescribeProjectVersionsInput, optFns ...func(*DescribeProjectVersionsPaginatorOptions)) *DescribeProjectVersionsPaginator { + options := DescribeProjectVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeProjectVersionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeProjectVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rekognition/api_op_DescribeProjects.go b/service/rekognition/api_op_DescribeProjects.go index 8d53d1a612d..8880f2f93a7 100644 --- a/service/rekognition/api_op_DescribeProjects.go +++ b/service/rekognition/api_op_DescribeProjects.go @@ -4,6 +4,7 @@ package rekognition import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/rekognition/types" @@ -114,6 +115,83 @@ func addOperationDescribeProjectsMiddlewares(stack *middleware.Stack, options Op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeProjectsPaginator returns a new DescribeProjectsPaginator +func NewDescribeProjectsPaginator(client DescribeProjectsAPIClient, params *DescribeProjectsInput, optFns ...func(*DescribeProjectsPaginatorOptions)) *DescribeProjectsPaginator { + options := DescribeProjectsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeProjectsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeProjects(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rekognition/api_op_GetCelebrityRecognition.go b/service/rekognition/api_op_GetCelebrityRecognition.go index d7d31c193fb..7d449ce71ef 100644 --- a/service/rekognition/api_op_GetCelebrityRecognition.go +++ b/service/rekognition/api_op_GetCelebrityRecognition.go @@ -4,6 +4,7 @@ package rekognition import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/rekognition/types" @@ -169,6 +170,85 @@ func addOperationGetCelebrityRecognitionMiddlewares(stack *middleware.Stack, opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetCelebrityRecognitionPaginator returns a new +// GetCelebrityRecognitionPaginator +func NewGetCelebrityRecognitionPaginator(client GetCelebrityRecognitionAPIClient, params *GetCelebrityRecognitionInput, optFns ...func(*GetCelebrityRecognitionPaginatorOptions)) *GetCelebrityRecognitionPaginator { + options := GetCelebrityRecognitionPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetCelebrityRecognitionInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetCelebrityRecognition(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rekognition/api_op_GetContentModeration.go b/service/rekognition/api_op_GetContentModeration.go index 3b2f2030484..4916be55b2e 100644 --- a/service/rekognition/api_op_GetContentModeration.go +++ b/service/rekognition/api_op_GetContentModeration.go @@ -4,6 +4,7 @@ package rekognition import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/rekognition/types" @@ -164,6 +165,84 @@ func addOperationGetContentModerationMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetContentModerationPaginator returns a new GetContentModerationPaginator +func NewGetContentModerationPaginator(client GetContentModerationAPIClient, params *GetContentModerationInput, optFns ...func(*GetContentModerationPaginatorOptions)) *GetContentModerationPaginator { + options := GetContentModerationPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetContentModerationInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetContentModeration(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rekognition/api_op_GetFaceDetection.go b/service/rekognition/api_op_GetFaceDetection.go index 20e1ce0e970..66dbabf1c12 100644 --- a/service/rekognition/api_op_GetFaceDetection.go +++ b/service/rekognition/api_op_GetFaceDetection.go @@ -4,6 +4,7 @@ package rekognition import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/rekognition/types" @@ -147,6 +148,83 @@ func addOperationGetFaceDetectionMiddlewares(stack *middleware.Stack, options Op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetFaceDetectionPaginator returns a new GetFaceDetectionPaginator +func NewGetFaceDetectionPaginator(client GetFaceDetectionAPIClient, params *GetFaceDetectionInput, optFns ...func(*GetFaceDetectionPaginatorOptions)) *GetFaceDetectionPaginator { + options := GetFaceDetectionPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetFaceDetectionInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetFaceDetection(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rekognition/api_op_GetFaceSearch.go b/service/rekognition/api_op_GetFaceSearch.go index 6ff345c3220..0e630fe8b34 100644 --- a/service/rekognition/api_op_GetFaceSearch.go +++ b/service/rekognition/api_op_GetFaceSearch.go @@ -4,6 +4,7 @@ package rekognition import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/rekognition/types" @@ -163,6 +164,82 @@ func addOperationGetFaceSearchMiddlewares(stack *middleware.Stack, options Optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetFaceSearchPaginator returns a new GetFaceSearchPaginator +func NewGetFaceSearchPaginator(client GetFaceSearchAPIClient, params *GetFaceSearchInput, optFns ...func(*GetFaceSearchPaginatorOptions)) *GetFaceSearchPaginator { + options := GetFaceSearchPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetFaceSearchInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetFaceSearch(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rekognition/api_op_GetLabelDetection.go b/service/rekognition/api_op_GetLabelDetection.go index 12fdf655c1f..81a1fdaedc5 100644 --- a/service/rekognition/api_op_GetLabelDetection.go +++ b/service/rekognition/api_op_GetLabelDetection.go @@ -4,6 +4,7 @@ package rekognition import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/rekognition/types" @@ -161,6 +162,83 @@ func addOperationGetLabelDetectionMiddlewares(stack *middleware.Stack, options O return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetLabelDetectionPaginator returns a new GetLabelDetectionPaginator +func NewGetLabelDetectionPaginator(client GetLabelDetectionAPIClient, params *GetLabelDetectionInput, optFns ...func(*GetLabelDetectionPaginatorOptions)) *GetLabelDetectionPaginator { + options := GetLabelDetectionPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetLabelDetectionInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetLabelDetection(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rekognition/api_op_GetPersonTracking.go b/service/rekognition/api_op_GetPersonTracking.go index cb7dcf8d219..63330831fba 100644 --- a/service/rekognition/api_op_GetPersonTracking.go +++ b/service/rekognition/api_op_GetPersonTracking.go @@ -4,6 +4,7 @@ package rekognition import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/rekognition/types" @@ -161,6 +162,83 @@ func addOperationGetPersonTrackingMiddlewares(stack *middleware.Stack, options O return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetPersonTrackingPaginator returns a new GetPersonTrackingPaginator +func NewGetPersonTrackingPaginator(client GetPersonTrackingAPIClient, params *GetPersonTrackingInput, optFns ...func(*GetPersonTrackingPaginatorOptions)) *GetPersonTrackingPaginator { + options := GetPersonTrackingPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetPersonTrackingInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetPersonTracking(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rekognition/api_op_GetSegmentDetection.go b/service/rekognition/api_op_GetSegmentDetection.go index 1df8b110b3c..c13546de660 100644 --- a/service/rekognition/api_op_GetSegmentDetection.go +++ b/service/rekognition/api_op_GetSegmentDetection.go @@ -4,6 +4,7 @@ package rekognition import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/rekognition/types" @@ -169,6 +170,83 @@ func addOperationGetSegmentDetectionMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetSegmentDetectionPaginator returns a new GetSegmentDetectionPaginator +func NewGetSegmentDetectionPaginator(client GetSegmentDetectionAPIClient, params *GetSegmentDetectionInput, optFns ...func(*GetSegmentDetectionPaginatorOptions)) *GetSegmentDetectionPaginator { + options := GetSegmentDetectionPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetSegmentDetectionInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetSegmentDetection(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rekognition/api_op_GetTextDetection.go b/service/rekognition/api_op_GetTextDetection.go index d39dc0bdb73..f035099826c 100644 --- a/service/rekognition/api_op_GetTextDetection.go +++ b/service/rekognition/api_op_GetTextDetection.go @@ -4,6 +4,7 @@ package rekognition import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/rekognition/types" @@ -153,6 +154,82 @@ func addOperationGetTextDetectionMiddlewares(stack *middleware.Stack, options Op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetTextDetectionPaginator returns a new GetTextDetectionPaginator +func NewGetTextDetectionPaginator(client GetTextDetectionAPIClient, params *GetTextDetectionInput, optFns ...func(*GetTextDetectionPaginatorOptions)) *GetTextDetectionPaginator { + options := GetTextDetectionPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetTextDetectionInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetTextDetection(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rekognition/api_op_ListCollections.go b/service/rekognition/api_op_ListCollections.go index d4a327204e0..5789c61a3ef 100644 --- a/service/rekognition/api_op_ListCollections.go +++ b/service/rekognition/api_op_ListCollections.go @@ -4,6 +4,7 @@ package rekognition import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -115,6 +116,81 @@ func addOperationListCollectionsMiddlewares(stack *middleware.Stack, options Opt return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListCollectionsPaginator returns a new ListCollectionsPaginator +func NewListCollectionsPaginator(client ListCollectionsAPIClient, params *ListCollectionsInput, optFns ...func(*ListCollectionsPaginatorOptions)) *ListCollectionsPaginator { + options := ListCollectionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListCollectionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListCollections(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rekognition/api_op_ListFaces.go b/service/rekognition/api_op_ListFaces.go index 5d61a3b1857..083547a4aa2 100644 --- a/service/rekognition/api_op_ListFaces.go +++ b/service/rekognition/api_op_ListFaces.go @@ -4,6 +4,7 @@ package rekognition import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/rekognition/types" @@ -124,6 +125,80 @@ func addOperationListFacesMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListFacesPaginator returns a new ListFacesPaginator +func NewListFacesPaginator(client ListFacesAPIClient, params *ListFacesInput, optFns ...func(*ListFacesPaginatorOptions)) *ListFacesPaginator { + options := ListFacesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListFacesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListFaces(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rekognition/api_op_ListStreamProcessors.go b/service/rekognition/api_op_ListStreamProcessors.go index e5557b685c1..209521174f9 100644 --- a/service/rekognition/api_op_ListStreamProcessors.go +++ b/service/rekognition/api_op_ListStreamProcessors.go @@ -4,6 +4,7 @@ package rekognition import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/rekognition/types" @@ -112,6 +113,83 @@ func addOperationListStreamProcessorsMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListStreamProcessorsPaginator returns a new ListStreamProcessorsPaginator +func NewListStreamProcessorsPaginator(client ListStreamProcessorsAPIClient, params *ListStreamProcessorsInput, optFns ...func(*ListStreamProcessorsPaginatorOptions)) *ListStreamProcessorsPaginator { + options := ListStreamProcessorsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListStreamProcessorsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListStreamProcessors(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rekognition/go.mod b/service/rekognition/go.mod index 3b7946624e8..02f7f181063 100644 --- a/service/rekognition/go.mod +++ b/service/rekognition/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/rekognition/go.sum b/service/rekognition/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/rekognition/go.sum +++ b/service/rekognition/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 117d06d4f6e..00000000000 --- a/service/rekognition/paginators.go +++ /dev/null @@ -1,1007 +0,0 @@ -// 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/api_op_ListGroupResources.go b/service/resourcegroups/api_op_ListGroupResources.go index 6b8ae8dd5bd..f883d3f9e2e 100644 --- a/service/resourcegroups/api_op_ListGroupResources.go +++ b/service/resourcegroups/api_op_ListGroupResources.go @@ -4,6 +4,7 @@ package resourcegroups import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/resourcegroups/types" @@ -158,6 +159,90 @@ func addOperationListGroupResourcesMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListGroupResourcesPaginator returns a new ListGroupResourcesPaginator +func NewListGroupResourcesPaginator(client ListGroupResourcesAPIClient, params *ListGroupResourcesInput, optFns ...func(*ListGroupResourcesPaginatorOptions)) *ListGroupResourcesPaginator { + options := ListGroupResourcesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListGroupResourcesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListGroupResources(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/resourcegroups/api_op_ListGroups.go b/service/resourcegroups/api_op_ListGroups.go index 8d73eaaf674..b60bdaf7365 100644 --- a/service/resourcegroups/api_op_ListGroups.go +++ b/service/resourcegroups/api_op_ListGroups.go @@ -4,6 +4,7 @@ package resourcegroups import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/resourcegroups/types" @@ -142,6 +143,88 @@ func addOperationListGroupsMiddlewares(stack *middleware.Stack, options Options) return 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 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListGroupsPaginator returns a new ListGroupsPaginator +func NewListGroupsPaginator(client ListGroupsAPIClient, params *ListGroupsInput, optFns ...func(*ListGroupsPaginatorOptions)) *ListGroupsPaginator { + options := ListGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/resourcegroups/api_op_SearchResources.go b/service/resourcegroups/api_op_SearchResources.go index 2702e8ed89c..782cd8cfb5f 100644 --- a/service/resourcegroups/api_op_SearchResources.go +++ b/service/resourcegroups/api_op_SearchResources.go @@ -4,6 +4,7 @@ package resourcegroups import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/resourcegroups/types" @@ -136,6 +137,89 @@ func addOperationSearchResourcesMiddlewares(stack *middleware.Stack, options Opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewSearchResourcesPaginator returns a new SearchResourcesPaginator +func NewSearchResourcesPaginator(client SearchResourcesAPIClient, params *SearchResourcesInput, optFns ...func(*SearchResourcesPaginatorOptions)) *SearchResourcesPaginator { + options := SearchResourcesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchResourcesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearchResources(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/resourcegroups/go.mod b/service/resourcegroups/go.mod index 7dfa72f4ce7..0f9b2802852 100644 --- a/service/resourcegroups/go.mod +++ b/service/resourcegroups/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/resourcegroups/go.sum b/service/resourcegroups/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/resourcegroups/go.sum +++ b/service/resourcegroups/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 31cc59117f5..00000000000 --- a/service/resourcegroups/paginators.go +++ /dev/null @@ -1,257 +0,0 @@ -// 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/api_op_GetComplianceSummary.go b/service/resourcegroupstaggingapi/api_op_GetComplianceSummary.go index dccf77dc1df..e1376396b38 100644 --- a/service/resourcegroupstaggingapi/api_op_GetComplianceSummary.go +++ b/service/resourcegroupstaggingapi/api_op_GetComplianceSummary.go @@ -4,6 +4,7 @@ package resourcegroupstaggingapi import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/types" @@ -158,6 +159,82 @@ func addOperationGetComplianceSummaryMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetComplianceSummaryPaginator returns a new GetComplianceSummaryPaginator +func NewGetComplianceSummaryPaginator(client GetComplianceSummaryAPIClient, params *GetComplianceSummaryInput, optFns ...func(*GetComplianceSummaryPaginatorOptions)) *GetComplianceSummaryPaginator { + options := GetComplianceSummaryPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetComplianceSummaryInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.PaginationToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetComplianceSummary(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/resourcegroupstaggingapi/api_op_GetResources.go b/service/resourcegroupstaggingapi/api_op_GetResources.go index 0472b5ec925..148b8952858 100644 --- a/service/resourcegroupstaggingapi/api_op_GetResources.go +++ b/service/resourcegroupstaggingapi/api_op_GetResources.go @@ -4,6 +4,7 @@ package resourcegroupstaggingapi import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/types" @@ -221,6 +222,82 @@ func addOperationGetResourcesMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetResourcesPaginator returns a new GetResourcesPaginator +func NewGetResourcesPaginator(client GetResourcesAPIClient, params *GetResourcesInput, optFns ...func(*GetResourcesPaginatorOptions)) *GetResourcesPaginator { + options := GetResourcesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetResourcesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.PaginationToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetResources(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/resourcegroupstaggingapi/api_op_GetTagKeys.go b/service/resourcegroupstaggingapi/api_op_GetTagKeys.go index b225de4e7c4..f278efbc7fb 100644 --- a/service/resourcegroupstaggingapi/api_op_GetTagKeys.go +++ b/service/resourcegroupstaggingapi/api_op_GetTagKeys.go @@ -4,6 +4,7 @@ package resourcegroupstaggingapi import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -106,6 +107,76 @@ func addOperationGetTagKeysMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetTagKeysPaginator returns a new GetTagKeysPaginator +func NewGetTagKeysPaginator(client GetTagKeysAPIClient, params *GetTagKeysInput, optFns ...func(*GetTagKeysPaginatorOptions)) *GetTagKeysPaginator { + options := GetTagKeysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetTagKeysInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.PaginationToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetTagKeys(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/resourcegroupstaggingapi/api_op_GetTagValues.go b/service/resourcegroupstaggingapi/api_op_GetTagValues.go index 0d87752a40b..7485052ad2b 100644 --- a/service/resourcegroupstaggingapi/api_op_GetTagValues.go +++ b/service/resourcegroupstaggingapi/api_op_GetTagValues.go @@ -4,6 +4,7 @@ package resourcegroupstaggingapi import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -117,6 +118,76 @@ func addOperationGetTagValuesMiddlewares(stack *middleware.Stack, options Option return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetTagValuesPaginator returns a new GetTagValuesPaginator +func NewGetTagValuesPaginator(client GetTagValuesAPIClient, params *GetTagValuesInput, optFns ...func(*GetTagValuesPaginatorOptions)) *GetTagValuesPaginator { + options := GetTagValuesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetTagValuesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.PaginationToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetTagValues(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/resourcegroupstaggingapi/go.mod b/service/resourcegroupstaggingapi/go.mod index 23da863b444..9739bc5e374 100644 --- a/service/resourcegroupstaggingapi/go.mod +++ b/service/resourcegroupstaggingapi/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/resourcegroupstaggingapi/go.sum b/service/resourcegroupstaggingapi/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/resourcegroupstaggingapi/go.sum +++ b/service/resourcegroupstaggingapi/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 894775e0543..00000000000 --- a/service/resourcegroupstaggingapi/paginators.go +++ /dev/null @@ -1,300 +0,0 @@ -// 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/api_op_ListDeploymentJobs.go b/service/robomaker/api_op_ListDeploymentJobs.go index b573cab055f..466cfd26bb8 100644 --- a/service/robomaker/api_op_ListDeploymentJobs.go +++ b/service/robomaker/api_op_ListDeploymentJobs.go @@ -4,6 +4,7 @@ package robomaker import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/robomaker/types" @@ -126,6 +127,87 @@ func addOperationListDeploymentJobsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDeploymentJobsPaginator returns a new ListDeploymentJobsPaginator +func NewListDeploymentJobsPaginator(client ListDeploymentJobsAPIClient, params *ListDeploymentJobsInput, optFns ...func(*ListDeploymentJobsPaginatorOptions)) *ListDeploymentJobsPaginator { + options := ListDeploymentJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDeploymentJobsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDeploymentJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/robomaker/api_op_ListFleets.go b/service/robomaker/api_op_ListFleets.go index 8520343412e..6fbaa87b965 100644 --- a/service/robomaker/api_op_ListFleets.go +++ b/service/robomaker/api_op_ListFleets.go @@ -4,6 +4,7 @@ package robomaker import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/robomaker/types" @@ -126,6 +127,85 @@ func addOperationListFleetsMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListFleetsPaginator returns a new ListFleetsPaginator +func NewListFleetsPaginator(client ListFleetsAPIClient, params *ListFleetsInput, optFns ...func(*ListFleetsPaginatorOptions)) *ListFleetsPaginator { + options := ListFleetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListFleetsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListFleets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/robomaker/api_op_ListRobotApplications.go b/service/robomaker/api_op_ListRobotApplications.go index da40a6860ea..75596fadecd 100644 --- a/service/robomaker/api_op_ListRobotApplications.go +++ b/service/robomaker/api_op_ListRobotApplications.go @@ -4,6 +4,7 @@ package robomaker import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/robomaker/types" @@ -127,6 +128,87 @@ func addOperationListRobotApplicationsMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListRobotApplicationsPaginator returns a new ListRobotApplicationsPaginator +func NewListRobotApplicationsPaginator(client ListRobotApplicationsAPIClient, params *ListRobotApplicationsInput, optFns ...func(*ListRobotApplicationsPaginatorOptions)) *ListRobotApplicationsPaginator { + options := ListRobotApplicationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRobotApplicationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRobotApplications(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/robomaker/api_op_ListRobots.go b/service/robomaker/api_op_ListRobots.go index 207d1d00dee..5ac54f980db 100644 --- a/service/robomaker/api_op_ListRobots.go +++ b/service/robomaker/api_op_ListRobots.go @@ -4,6 +4,7 @@ package robomaker import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/robomaker/types" @@ -126,6 +127,85 @@ func addOperationListRobotsMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListRobotsPaginator returns a new ListRobotsPaginator +func NewListRobotsPaginator(client ListRobotsAPIClient, params *ListRobotsInput, optFns ...func(*ListRobotsPaginatorOptions)) *ListRobotsPaginator { + options := ListRobotsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRobotsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRobots(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/robomaker/api_op_ListSimulationApplications.go b/service/robomaker/api_op_ListSimulationApplications.go index 219390796f5..5d5e44a577b 100644 --- a/service/robomaker/api_op_ListSimulationApplications.go +++ b/service/robomaker/api_op_ListSimulationApplications.go @@ -4,6 +4,7 @@ package robomaker import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/robomaker/types" @@ -129,6 +130,89 @@ func addOperationListSimulationApplicationsMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListSimulationApplicationsPaginator returns a new +// ListSimulationApplicationsPaginator +func NewListSimulationApplicationsPaginator(client ListSimulationApplicationsAPIClient, params *ListSimulationApplicationsInput, optFns ...func(*ListSimulationApplicationsPaginatorOptions)) *ListSimulationApplicationsPaginator { + options := ListSimulationApplicationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSimulationApplicationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSimulationApplications(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/robomaker/api_op_ListSimulationJobBatches.go b/service/robomaker/api_op_ListSimulationJobBatches.go index 483065bc1e2..939c8d80da9 100644 --- a/service/robomaker/api_op_ListSimulationJobBatches.go +++ b/service/robomaker/api_op_ListSimulationJobBatches.go @@ -4,6 +4,7 @@ package robomaker import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/robomaker/types" @@ -120,6 +121,86 @@ func addOperationListSimulationJobBatchesMiddlewares(stack *middleware.Stack, op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListSimulationJobBatchesPaginator returns a new +// ListSimulationJobBatchesPaginator +func NewListSimulationJobBatchesPaginator(client ListSimulationJobBatchesAPIClient, params *ListSimulationJobBatchesInput, optFns ...func(*ListSimulationJobBatchesPaginatorOptions)) *ListSimulationJobBatchesPaginator { + options := ListSimulationJobBatchesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSimulationJobBatchesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSimulationJobBatches(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/robomaker/api_op_ListSimulationJobs.go b/service/robomaker/api_op_ListSimulationJobs.go index 6b15e610399..ddd79065edb 100644 --- a/service/robomaker/api_op_ListSimulationJobs.go +++ b/service/robomaker/api_op_ListSimulationJobs.go @@ -4,6 +4,7 @@ package robomaker import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/robomaker/types" @@ -128,6 +129,87 @@ func addOperationListSimulationJobsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListSimulationJobsPaginator returns a new ListSimulationJobsPaginator +func NewListSimulationJobsPaginator(client ListSimulationJobsAPIClient, params *ListSimulationJobsInput, optFns ...func(*ListSimulationJobsPaginatorOptions)) *ListSimulationJobsPaginator { + options := ListSimulationJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSimulationJobsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSimulationJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/robomaker/api_op_ListWorldExportJobs.go b/service/robomaker/api_op_ListWorldExportJobs.go index 2f99f4abce3..29991836ddd 100644 --- a/service/robomaker/api_op_ListWorldExportJobs.go +++ b/service/robomaker/api_op_ListWorldExportJobs.go @@ -4,6 +4,7 @@ package robomaker import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/robomaker/types" @@ -123,6 +124,87 @@ func addOperationListWorldExportJobsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListWorldExportJobsPaginator returns a new ListWorldExportJobsPaginator +func NewListWorldExportJobsPaginator(client ListWorldExportJobsAPIClient, params *ListWorldExportJobsInput, optFns ...func(*ListWorldExportJobsPaginatorOptions)) *ListWorldExportJobsPaginator { + options := ListWorldExportJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListWorldExportJobsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListWorldExportJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/robomaker/api_op_ListWorldGenerationJobs.go b/service/robomaker/api_op_ListWorldGenerationJobs.go index 4d88295c219..779c732cefd 100644 --- a/service/robomaker/api_op_ListWorldGenerationJobs.go +++ b/service/robomaker/api_op_ListWorldGenerationJobs.go @@ -4,6 +4,7 @@ package robomaker import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/robomaker/types" @@ -125,6 +126,88 @@ func addOperationListWorldGenerationJobsMiddlewares(stack *middleware.Stack, opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListWorldGenerationJobsPaginator returns a new +// ListWorldGenerationJobsPaginator +func NewListWorldGenerationJobsPaginator(client ListWorldGenerationJobsAPIClient, params *ListWorldGenerationJobsInput, optFns ...func(*ListWorldGenerationJobsPaginatorOptions)) *ListWorldGenerationJobsPaginator { + options := ListWorldGenerationJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListWorldGenerationJobsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListWorldGenerationJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/robomaker/api_op_ListWorldTemplates.go b/service/robomaker/api_op_ListWorldTemplates.go index 3d1ea63a391..d818d6ae2ce 100644 --- a/service/robomaker/api_op_ListWorldTemplates.go +++ b/service/robomaker/api_op_ListWorldTemplates.go @@ -4,6 +4,7 @@ package robomaker import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/robomaker/types" @@ -118,6 +119,87 @@ func addOperationListWorldTemplatesMiddlewares(stack *middleware.Stack, options return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListWorldTemplatesPaginator returns a new ListWorldTemplatesPaginator +func NewListWorldTemplatesPaginator(client ListWorldTemplatesAPIClient, params *ListWorldTemplatesInput, optFns ...func(*ListWorldTemplatesPaginatorOptions)) *ListWorldTemplatesPaginator { + options := ListWorldTemplatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListWorldTemplatesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListWorldTemplates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/robomaker/api_op_ListWorlds.go b/service/robomaker/api_op_ListWorlds.go index 53ebfe8968e..d14d5130d7c 100644 --- a/service/robomaker/api_op_ListWorlds.go +++ b/service/robomaker/api_op_ListWorlds.go @@ -4,6 +4,7 @@ package robomaker import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/robomaker/types" @@ -121,6 +122,85 @@ func addOperationListWorldsMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListWorldsPaginator returns a new ListWorldsPaginator +func NewListWorldsPaginator(client ListWorldsAPIClient, params *ListWorldsInput, optFns ...func(*ListWorldsPaginatorOptions)) *ListWorldsPaginator { + options := ListWorldsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListWorldsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListWorlds(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/robomaker/go.mod b/service/robomaker/go.mod index 1f8f910250e..285dbe48cb7 100644 --- a/service/robomaker/go.mod +++ b/service/robomaker/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/robomaker/go.sum b/service/robomaker/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/robomaker/go.sum +++ b/service/robomaker/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 9d9b6c30621..00000000000 --- a/service/robomaker/paginators.go +++ /dev/null @@ -1,895 +0,0 @@ -// 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.mod b/service/route53/go.mod index 5b771e5bf3d..40f8ef9abec 100644 --- a/service/route53/go.mod +++ b/service/route53/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/route53/go.sum b/service/route53/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/route53/go.sum +++ b/service/route53/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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/api_op_ListDomains.go b/service/route53domains/api_op_ListDomains.go index ce000ba4abd..ea18b14566d 100644 --- a/service/route53domains/api_op_ListDomains.go +++ b/service/route53domains/api_op_ListDomains.go @@ -4,6 +4,7 @@ package route53domains import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/route53domains/types" @@ -116,6 +117,80 @@ func addOperationListDomainsMiddlewares(stack *middleware.Stack, options Options return 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 { + // Number of domains to be returned. Default: 20 + Limit *int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDomainsPaginator returns a new ListDomainsPaginator +func NewListDomainsPaginator(client ListDomainsAPIClient, params *ListDomainsInput, optFns ...func(*ListDomainsPaginatorOptions)) *ListDomainsPaginator { + options := ListDomainsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDomainsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextPageMarker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDomains(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/route53domains/api_op_ListOperations.go b/service/route53domains/api_op_ListOperations.go index 0acb1132354..90797409aa4 100644 --- a/service/route53domains/api_op_ListOperations.go +++ b/service/route53domains/api_op_ListOperations.go @@ -4,6 +4,7 @@ package route53domains import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/route53domains/types" @@ -123,6 +124,81 @@ func addOperationListOperationsMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListOperationsPaginator returns a new ListOperationsPaginator +func NewListOperationsPaginator(client ListOperationsAPIClient, params *ListOperationsInput, optFns ...func(*ListOperationsPaginatorOptions)) *ListOperationsPaginator { + options := ListOperationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListOperationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextPageMarker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListOperations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/route53domains/go.mod b/service/route53domains/go.mod index f552c68dc75..35006ef7239 100644 --- a/service/route53domains/go.mod +++ b/service/route53domains/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/route53domains/go.sum b/service/route53domains/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/route53domains/go.sum +++ b/service/route53domains/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 6e15566af92..00000000000 --- a/service/route53domains/paginators.go +++ /dev/null @@ -1,157 +0,0 @@ -// 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/api_op_ListResolverEndpointIpAddresses.go b/service/route53resolver/api_op_ListResolverEndpointIpAddresses.go index 73275a42a02..0017ccf3472 100644 --- a/service/route53resolver/api_op_ListResolverEndpointIpAddresses.go +++ b/service/route53resolver/api_op_ListResolverEndpointIpAddresses.go @@ -4,6 +4,7 @@ package route53resolver import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/route53resolver/types" @@ -127,6 +128,85 @@ func addOperationListResolverEndpointIpAddressesMiddlewares(stack *middleware.St return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListResolverEndpointIpAddressesPaginator returns a new +// ListResolverEndpointIpAddressesPaginator +func NewListResolverEndpointIpAddressesPaginator(client ListResolverEndpointIpAddressesAPIClient, params *ListResolverEndpointIpAddressesInput, optFns ...func(*ListResolverEndpointIpAddressesPaginatorOptions)) *ListResolverEndpointIpAddressesPaginator { + options := ListResolverEndpointIpAddressesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListResolverEndpointIpAddressesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListResolverEndpointIpAddresses(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/route53resolver/api_op_ListResolverEndpoints.go b/service/route53resolver/api_op_ListResolverEndpoints.go index d6b1bfaf4fc..99673269f85 100644 --- a/service/route53resolver/api_op_ListResolverEndpoints.go +++ b/service/route53resolver/api_op_ListResolverEndpoints.go @@ -4,6 +4,7 @@ package route53resolver import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/route53resolver/types" @@ -123,6 +124,84 @@ func addOperationListResolverEndpointsMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListResolverEndpointsPaginator returns a new ListResolverEndpointsPaginator +func NewListResolverEndpointsPaginator(client ListResolverEndpointsAPIClient, params *ListResolverEndpointsInput, optFns ...func(*ListResolverEndpointsPaginatorOptions)) *ListResolverEndpointsPaginator { + options := ListResolverEndpointsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListResolverEndpointsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListResolverEndpoints(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/route53resolver/api_op_ListResolverQueryLogConfigAssociations.go b/service/route53resolver/api_op_ListResolverQueryLogConfigAssociations.go index 2d8ac1d3852..53ae3718310 100644 --- a/service/route53resolver/api_op_ListResolverQueryLogConfigAssociations.go +++ b/service/route53resolver/api_op_ListResolverQueryLogConfigAssociations.go @@ -4,6 +4,7 @@ package route53resolver import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/route53resolver/types" @@ -197,6 +198,86 @@ func addOperationListResolverQueryLogConfigAssociationsMiddlewares(stack *middle return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListResolverQueryLogConfigAssociationsPaginator returns a new +// ListResolverQueryLogConfigAssociationsPaginator +func NewListResolverQueryLogConfigAssociationsPaginator(client ListResolverQueryLogConfigAssociationsAPIClient, params *ListResolverQueryLogConfigAssociationsInput, optFns ...func(*ListResolverQueryLogConfigAssociationsPaginatorOptions)) *ListResolverQueryLogConfigAssociationsPaginator { + options := ListResolverQueryLogConfigAssociationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListResolverQueryLogConfigAssociationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListResolverQueryLogConfigAssociations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/route53resolver/api_op_ListResolverQueryLogConfigs.go b/service/route53resolver/api_op_ListResolverQueryLogConfigs.go index 17186da6fe3..1825aaa2163 100644 --- a/service/route53resolver/api_op_ListResolverQueryLogConfigs.go +++ b/service/route53resolver/api_op_ListResolverQueryLogConfigs.go @@ -4,6 +4,7 @@ package route53resolver import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/route53resolver/types" @@ -200,6 +201,85 @@ func addOperationListResolverQueryLogConfigsMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListResolverQueryLogConfigsPaginator returns a new +// ListResolverQueryLogConfigsPaginator +func NewListResolverQueryLogConfigsPaginator(client ListResolverQueryLogConfigsAPIClient, params *ListResolverQueryLogConfigsInput, optFns ...func(*ListResolverQueryLogConfigsPaginatorOptions)) *ListResolverQueryLogConfigsPaginator { + options := ListResolverQueryLogConfigsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListResolverQueryLogConfigsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListResolverQueryLogConfigs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/route53resolver/api_op_ListResolverRuleAssociations.go b/service/route53resolver/api_op_ListResolverRuleAssociations.go index bed7ef85ac3..cd9fe5b0c47 100644 --- a/service/route53resolver/api_op_ListResolverRuleAssociations.go +++ b/service/route53resolver/api_op_ListResolverRuleAssociations.go @@ -4,6 +4,7 @@ package route53resolver import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/route53resolver/types" @@ -125,6 +126,85 @@ func addOperationListResolverRuleAssociationsMiddlewares(stack *middleware.Stack return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListResolverRuleAssociationsPaginator returns a new +// ListResolverRuleAssociationsPaginator +func NewListResolverRuleAssociationsPaginator(client ListResolverRuleAssociationsAPIClient, params *ListResolverRuleAssociationsInput, optFns ...func(*ListResolverRuleAssociationsPaginatorOptions)) *ListResolverRuleAssociationsPaginator { + options := ListResolverRuleAssociationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListResolverRuleAssociationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListResolverRuleAssociations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/route53resolver/api_op_ListResolverRules.go b/service/route53resolver/api_op_ListResolverRules.go index 2636c6f54ee..65ff4e7640f 100644 --- a/service/route53resolver/api_op_ListResolverRules.go +++ b/service/route53resolver/api_op_ListResolverRules.go @@ -4,6 +4,7 @@ package route53resolver import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/route53resolver/types" @@ -123,6 +124,83 @@ func addOperationListResolverRulesMiddlewares(stack *middleware.Stack, options O return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListResolverRulesPaginator returns a new ListResolverRulesPaginator +func NewListResolverRulesPaginator(client ListResolverRulesAPIClient, params *ListResolverRulesInput, optFns ...func(*ListResolverRulesPaginatorOptions)) *ListResolverRulesPaginator { + options := ListResolverRulesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListResolverRulesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListResolverRules(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/route53resolver/api_op_ListTagsForResource.go b/service/route53resolver/api_op_ListTagsForResource.go index 8285942e8d3..c49e4dab40e 100644 --- a/service/route53resolver/api_op_ListTagsForResource.go +++ b/service/route53resolver/api_op_ListTagsForResource.go @@ -4,6 +4,7 @@ package route53resolver import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/route53resolver/types" @@ -121,6 +122,84 @@ func addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator +func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator { + options := ListTagsForResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTagsForResourceInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/route53resolver/go.mod b/service/route53resolver/go.mod index 3da84d08bc4..d94269bae06 100644 --- a/service/route53resolver/go.mod +++ b/service/route53resolver/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/route53resolver/go.sum b/service/route53resolver/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/route53resolver/go.sum +++ b/service/route53resolver/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 424e8531e72..00000000000 --- a/service/route53resolver/paginators.go +++ /dev/null @@ -1,558 +0,0 @@ -// 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/api_op_ListObjectsV2.go b/service/s3/api_op_ListObjectsV2.go index 5813ccd63b8..0d1b7386995 100644 --- a/service/s3/api_op_ListObjectsV2.go +++ b/service/s3/api_op_ListObjectsV2.go @@ -4,6 +4,7 @@ package s3 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/s3/types" @@ -265,6 +266,82 @@ func addOperationListObjectsV2Middlewares(stack *middleware.Stack, options Optio return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListObjectsV2Paginator returns a new ListObjectsV2Paginator +func NewListObjectsV2Paginator(client ListObjectsV2APIClient, params *ListObjectsV2Input, optFns ...func(*ListObjectsV2PaginatorOptions)) *ListObjectsV2Paginator { + options := ListObjectsV2PaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListObjectsV2Input{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextContinuationToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListObjectsV2(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/s3/go.mod b/service/s3/go.mod index b9d11504650..c46d77bdb9a 100644 --- a/service/s3/go.mod +++ b/service/s3/go.mod @@ -6,7 +6,7 @@ require ( github.com/aws/aws-sdk-go-v2 v0.29.0 github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v0.3.0 github.com/aws/aws-sdk-go-v2/service/internal/s3shared v0.3.1-0.20201027184009-8eb8fc303e7c - github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/s3/go.sum b/service/s3/go.sum index 5912fa6728c..23bc36dd9f5 100644 --- a/service/s3/go.sum +++ b/service/s3/go.sum @@ -1,6 +1,8 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 5912fa6728c..23bc36dd9f5 100644 --- a/service/s3/internal/configtesting/go.sum +++ b/service/s3/internal/configtesting/go.sum @@ -1,6 +1,8 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 90372af9320..00000000000 --- a/service/s3/paginators.go +++ /dev/null @@ -1,84 +0,0 @@ -// 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/api_op_CreateAccessPoint.go b/service/s3control/api_op_CreateAccessPoint.go index f108b163e6a..313ef35b41b 100644 --- a/service/s3control/api_op_CreateAccessPoint.go +++ b/service/s3control/api_op_CreateAccessPoint.go @@ -195,7 +195,7 @@ func (*endpointPrefix_opCreateAccessPointMiddleware) ID() string { func (m *endpointPrefix_opCreateAccessPointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -218,12 +218,12 @@ func (m *endpointPrefix_opCreateAccessPointMiddleware) HandleSerialize(ctx conte prefix.WriteString(*input.AccountId) } prefix.WriteString(".") - req.HostPrefix = prefix.String() + req.URL.Host = prefix.String() + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opCreateAccessPointMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opCreateAccessPointMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opCreateAccessPointMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opCreateAccessPoint(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/s3control/api_op_CreateJob.go b/service/s3control/api_op_CreateJob.go index a31b150b02e..d1d14d0691a 100644 --- a/service/s3control/api_op_CreateJob.go +++ b/service/s3control/api_op_CreateJob.go @@ -198,7 +198,7 @@ func (*endpointPrefix_opCreateJobMiddleware) ID() string { func (m *endpointPrefix_opCreateJobMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -221,12 +221,12 @@ func (m *endpointPrefix_opCreateJobMiddleware) HandleSerialize(ctx context.Conte prefix.WriteString(*input.AccountId) } prefix.WriteString(".") - req.HostPrefix = prefix.String() + req.URL.Host = prefix.String() + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opCreateJobMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opCreateJobMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opCreateJobMiddleware{}, `OperationSerializer`, middleware.After) } type idempotencyToken_initializeOpCreateJob struct { diff --git a/service/s3control/api_op_DeleteAccessPoint.go b/service/s3control/api_op_DeleteAccessPoint.go index 1c5f41340e7..09d2c5ef7ac 100644 --- a/service/s3control/api_op_DeleteAccessPoint.go +++ b/service/s3control/api_op_DeleteAccessPoint.go @@ -151,7 +151,7 @@ func (*endpointPrefix_opDeleteAccessPointMiddleware) ID() string { func (m *endpointPrefix_opDeleteAccessPointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -174,12 +174,12 @@ func (m *endpointPrefix_opDeleteAccessPointMiddleware) HandleSerialize(ctx conte prefix.WriteString(*input.AccountId) } prefix.WriteString(".") - req.HostPrefix = prefix.String() + req.URL.Host = prefix.String() + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opDeleteAccessPointMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opDeleteAccessPointMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opDeleteAccessPointMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opDeleteAccessPoint(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/s3control/api_op_DeleteAccessPointPolicy.go b/service/s3control/api_op_DeleteAccessPointPolicy.go index ad9c5e16300..3cb93b1697c 100644 --- a/service/s3control/api_op_DeleteAccessPointPolicy.go +++ b/service/s3control/api_op_DeleteAccessPointPolicy.go @@ -147,7 +147,7 @@ func (*endpointPrefix_opDeleteAccessPointPolicyMiddleware) ID() string { func (m *endpointPrefix_opDeleteAccessPointPolicyMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -170,12 +170,12 @@ func (m *endpointPrefix_opDeleteAccessPointPolicyMiddleware) HandleSerialize(ctx prefix.WriteString(*input.AccountId) } prefix.WriteString(".") - req.HostPrefix = prefix.String() + req.URL.Host = prefix.String() + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opDeleteAccessPointPolicyMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opDeleteAccessPointPolicyMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opDeleteAccessPointPolicyMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opDeleteAccessPointPolicy(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/s3control/api_op_DeleteBucket.go b/service/s3control/api_op_DeleteBucket.go index e4ad1c40e92..542097c05ec 100644 --- a/service/s3control/api_op_DeleteBucket.go +++ b/service/s3control/api_op_DeleteBucket.go @@ -157,7 +157,7 @@ func (*endpointPrefix_opDeleteBucketMiddleware) ID() string { func (m *endpointPrefix_opDeleteBucketMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -180,12 +180,12 @@ func (m *endpointPrefix_opDeleteBucketMiddleware) HandleSerialize(ctx context.Co prefix.WriteString(*input.AccountId) } prefix.WriteString(".") - req.HostPrefix = prefix.String() + req.URL.Host = prefix.String() + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opDeleteBucketMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opDeleteBucketMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opDeleteBucketMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opDeleteBucket(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/s3control/api_op_DeleteBucketLifecycleConfiguration.go b/service/s3control/api_op_DeleteBucketLifecycleConfiguration.go index c1bfa18935c..a3a4645177a 100644 --- a/service/s3control/api_op_DeleteBucketLifecycleConfiguration.go +++ b/service/s3control/api_op_DeleteBucketLifecycleConfiguration.go @@ -162,7 +162,7 @@ func (*endpointPrefix_opDeleteBucketLifecycleConfigurationMiddleware) ID() strin func (m *endpointPrefix_opDeleteBucketLifecycleConfigurationMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -185,12 +185,12 @@ func (m *endpointPrefix_opDeleteBucketLifecycleConfigurationMiddleware) HandleSe prefix.WriteString(*input.AccountId) } prefix.WriteString(".") - req.HostPrefix = prefix.String() + req.URL.Host = prefix.String() + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opDeleteBucketLifecycleConfigurationMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opDeleteBucketLifecycleConfigurationMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opDeleteBucketLifecycleConfigurationMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opDeleteBucketLifecycleConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/s3control/api_op_DeleteBucketPolicy.go b/service/s3control/api_op_DeleteBucketPolicy.go index a4e41abc12d..f87b58fd0c1 100644 --- a/service/s3control/api_op_DeleteBucketPolicy.go +++ b/service/s3control/api_op_DeleteBucketPolicy.go @@ -165,7 +165,7 @@ func (*endpointPrefix_opDeleteBucketPolicyMiddleware) ID() string { func (m *endpointPrefix_opDeleteBucketPolicyMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -188,12 +188,12 @@ func (m *endpointPrefix_opDeleteBucketPolicyMiddleware) HandleSerialize(ctx cont prefix.WriteString(*input.AccountId) } prefix.WriteString(".") - req.HostPrefix = prefix.String() + req.URL.Host = prefix.String() + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opDeleteBucketPolicyMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opDeleteBucketPolicyMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opDeleteBucketPolicyMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opDeleteBucketPolicy(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/s3control/api_op_DeleteBucketTagging.go b/service/s3control/api_op_DeleteBucketTagging.go index c558ca6df3c..b8b640c3250 100644 --- a/service/s3control/api_op_DeleteBucketTagging.go +++ b/service/s3control/api_op_DeleteBucketTagging.go @@ -155,7 +155,7 @@ func (*endpointPrefix_opDeleteBucketTaggingMiddleware) ID() string { func (m *endpointPrefix_opDeleteBucketTaggingMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -178,12 +178,12 @@ func (m *endpointPrefix_opDeleteBucketTaggingMiddleware) HandleSerialize(ctx con prefix.WriteString(*input.AccountId) } prefix.WriteString(".") - req.HostPrefix = prefix.String() + req.URL.Host = prefix.String() + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opDeleteBucketTaggingMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opDeleteBucketTaggingMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opDeleteBucketTaggingMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opDeleteBucketTagging(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/s3control/api_op_DeleteJobTagging.go b/service/s3control/api_op_DeleteJobTagging.go index ef1b980b4d1..c2c8655c0fc 100644 --- a/service/s3control/api_op_DeleteJobTagging.go +++ b/service/s3control/api_op_DeleteJobTagging.go @@ -143,7 +143,7 @@ func (*endpointPrefix_opDeleteJobTaggingMiddleware) ID() string { func (m *endpointPrefix_opDeleteJobTaggingMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -166,12 +166,12 @@ func (m *endpointPrefix_opDeleteJobTaggingMiddleware) HandleSerialize(ctx contex prefix.WriteString(*input.AccountId) } prefix.WriteString(".") - req.HostPrefix = prefix.String() + req.URL.Host = prefix.String() + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opDeleteJobTaggingMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opDeleteJobTaggingMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opDeleteJobTaggingMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opDeleteJobTagging(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/s3control/api_op_DeletePublicAccessBlock.go b/service/s3control/api_op_DeletePublicAccessBlock.go index f19cb3e1fca..2d45ceb8e79 100644 --- a/service/s3control/api_op_DeletePublicAccessBlock.go +++ b/service/s3control/api_op_DeletePublicAccessBlock.go @@ -132,7 +132,7 @@ func (*endpointPrefix_opDeletePublicAccessBlockMiddleware) ID() string { func (m *endpointPrefix_opDeletePublicAccessBlockMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -155,12 +155,12 @@ func (m *endpointPrefix_opDeletePublicAccessBlockMiddleware) HandleSerialize(ctx prefix.WriteString(*input.AccountId) } prefix.WriteString(".") - req.HostPrefix = prefix.String() + req.URL.Host = prefix.String() + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opDeletePublicAccessBlockMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opDeletePublicAccessBlockMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opDeletePublicAccessBlockMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opDeletePublicAccessBlock(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/s3control/api_op_DescribeJob.go b/service/s3control/api_op_DescribeJob.go index eb06a74f711..dafa2f3df73 100644 --- a/service/s3control/api_op_DescribeJob.go +++ b/service/s3control/api_op_DescribeJob.go @@ -151,7 +151,7 @@ func (*endpointPrefix_opDescribeJobMiddleware) ID() string { func (m *endpointPrefix_opDescribeJobMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -174,12 +174,12 @@ func (m *endpointPrefix_opDescribeJobMiddleware) HandleSerialize(ctx context.Con prefix.WriteString(*input.AccountId) } prefix.WriteString(".") - req.HostPrefix = prefix.String() + req.URL.Host = prefix.String() + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opDescribeJobMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opDescribeJobMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opDescribeJobMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opDescribeJob(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/s3control/api_op_GetAccessPoint.go b/service/s3control/api_op_GetAccessPoint.go index 442f0cc5f33..dba9dd1d084 100644 --- a/service/s3control/api_op_GetAccessPoint.go +++ b/service/s3control/api_op_GetAccessPoint.go @@ -184,7 +184,7 @@ func (*endpointPrefix_opGetAccessPointMiddleware) ID() string { func (m *endpointPrefix_opGetAccessPointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -207,12 +207,12 @@ func (m *endpointPrefix_opGetAccessPointMiddleware) HandleSerialize(ctx context. prefix.WriteString(*input.AccountId) } prefix.WriteString(".") - req.HostPrefix = prefix.String() + req.URL.Host = prefix.String() + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opGetAccessPointMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opGetAccessPointMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opGetAccessPointMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opGetAccessPoint(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/s3control/api_op_GetAccessPointPolicy.go b/service/s3control/api_op_GetAccessPointPolicy.go index 648c738b506..338777fceb2 100644 --- a/service/s3control/api_op_GetAccessPointPolicy.go +++ b/service/s3control/api_op_GetAccessPointPolicy.go @@ -144,7 +144,7 @@ func (*endpointPrefix_opGetAccessPointPolicyMiddleware) ID() string { func (m *endpointPrefix_opGetAccessPointPolicyMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -167,12 +167,12 @@ func (m *endpointPrefix_opGetAccessPointPolicyMiddleware) HandleSerialize(ctx co prefix.WriteString(*input.AccountId) } prefix.WriteString(".") - req.HostPrefix = prefix.String() + req.URL.Host = prefix.String() + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opGetAccessPointPolicyMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opGetAccessPointPolicyMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opGetAccessPointPolicyMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opGetAccessPointPolicy(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/s3control/api_op_GetAccessPointPolicyStatus.go b/service/s3control/api_op_GetAccessPointPolicyStatus.go index e17d6eb3e3e..9acd74cb4a3 100644 --- a/service/s3control/api_op_GetAccessPointPolicyStatus.go +++ b/service/s3control/api_op_GetAccessPointPolicyStatus.go @@ -135,7 +135,7 @@ func (*endpointPrefix_opGetAccessPointPolicyStatusMiddleware) ID() string { func (m *endpointPrefix_opGetAccessPointPolicyStatusMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -158,12 +158,12 @@ func (m *endpointPrefix_opGetAccessPointPolicyStatusMiddleware) HandleSerialize( prefix.WriteString(*input.AccountId) } prefix.WriteString(".") - req.HostPrefix = prefix.String() + req.URL.Host = prefix.String() + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opGetAccessPointPolicyStatusMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opGetAccessPointPolicyStatusMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opGetAccessPointPolicyStatusMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opGetAccessPointPolicyStatus(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/s3control/api_op_GetBucket.go b/service/s3control/api_op_GetBucket.go index a344077c0b8..cd3a9b4e7c8 100644 --- a/service/s3control/api_op_GetBucket.go +++ b/service/s3control/api_op_GetBucket.go @@ -156,7 +156,7 @@ func (*endpointPrefix_opGetBucketMiddleware) ID() string { func (m *endpointPrefix_opGetBucketMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -179,12 +179,12 @@ func (m *endpointPrefix_opGetBucketMiddleware) HandleSerialize(ctx context.Conte prefix.WriteString(*input.AccountId) } prefix.WriteString(".") - req.HostPrefix = prefix.String() + req.URL.Host = prefix.String() + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opGetBucketMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opGetBucketMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opGetBucketMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opGetBucket(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/s3control/api_op_GetBucketLifecycleConfiguration.go b/service/s3control/api_op_GetBucketLifecycleConfiguration.go index d7144b8f40a..26b6a5d4cea 100644 --- a/service/s3control/api_op_GetBucketLifecycleConfiguration.go +++ b/service/s3control/api_op_GetBucketLifecycleConfiguration.go @@ -182,7 +182,7 @@ func (*endpointPrefix_opGetBucketLifecycleConfigurationMiddleware) ID() string { func (m *endpointPrefix_opGetBucketLifecycleConfigurationMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -205,12 +205,12 @@ func (m *endpointPrefix_opGetBucketLifecycleConfigurationMiddleware) HandleSeria prefix.WriteString(*input.AccountId) } prefix.WriteString(".") - req.HostPrefix = prefix.String() + req.URL.Host = prefix.String() + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opGetBucketLifecycleConfigurationMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opGetBucketLifecycleConfigurationMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opGetBucketLifecycleConfigurationMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opGetBucketLifecycleConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/s3control/api_op_GetBucketPolicy.go b/service/s3control/api_op_GetBucketPolicy.go index 9f967592b90..35957cb9361 100644 --- a/service/s3control/api_op_GetBucketPolicy.go +++ b/service/s3control/api_op_GetBucketPolicy.go @@ -171,7 +171,7 @@ func (*endpointPrefix_opGetBucketPolicyMiddleware) ID() string { func (m *endpointPrefix_opGetBucketPolicyMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -194,12 +194,12 @@ func (m *endpointPrefix_opGetBucketPolicyMiddleware) HandleSerialize(ctx context prefix.WriteString(*input.AccountId) } prefix.WriteString(".") - req.HostPrefix = prefix.String() + req.URL.Host = prefix.String() + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opGetBucketPolicyMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opGetBucketPolicyMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opGetBucketPolicyMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opGetBucketPolicy(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/s3control/api_op_GetBucketTagging.go b/service/s3control/api_op_GetBucketTagging.go index 7be3a07ad49..22e7875168a 100644 --- a/service/s3control/api_op_GetBucketTagging.go +++ b/service/s3control/api_op_GetBucketTagging.go @@ -170,7 +170,7 @@ func (*endpointPrefix_opGetBucketTaggingMiddleware) ID() string { func (m *endpointPrefix_opGetBucketTaggingMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -193,12 +193,12 @@ func (m *endpointPrefix_opGetBucketTaggingMiddleware) HandleSerialize(ctx contex prefix.WriteString(*input.AccountId) } prefix.WriteString(".") - req.HostPrefix = prefix.String() + req.URL.Host = prefix.String() + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opGetBucketTaggingMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opGetBucketTaggingMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opGetBucketTaggingMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opGetBucketTagging(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/s3control/api_op_GetJobTagging.go b/service/s3control/api_op_GetJobTagging.go index c5b6f831eba..c632ef6d680 100644 --- a/service/s3control/api_op_GetJobTagging.go +++ b/service/s3control/api_op_GetJobTagging.go @@ -147,7 +147,7 @@ func (*endpointPrefix_opGetJobTaggingMiddleware) ID() string { func (m *endpointPrefix_opGetJobTaggingMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -170,12 +170,12 @@ func (m *endpointPrefix_opGetJobTaggingMiddleware) HandleSerialize(ctx context.C prefix.WriteString(*input.AccountId) } prefix.WriteString(".") - req.HostPrefix = prefix.String() + req.URL.Host = prefix.String() + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opGetJobTaggingMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opGetJobTaggingMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opGetJobTaggingMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opGetJobTagging(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/s3control/api_op_GetPublicAccessBlock.go b/service/s3control/api_op_GetPublicAccessBlock.go index c936f2470db..377902729fb 100644 --- a/service/s3control/api_op_GetPublicAccessBlock.go +++ b/service/s3control/api_op_GetPublicAccessBlock.go @@ -137,7 +137,7 @@ func (*endpointPrefix_opGetPublicAccessBlockMiddleware) ID() string { func (m *endpointPrefix_opGetPublicAccessBlockMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -160,12 +160,12 @@ func (m *endpointPrefix_opGetPublicAccessBlockMiddleware) HandleSerialize(ctx co prefix.WriteString(*input.AccountId) } prefix.WriteString(".") - req.HostPrefix = prefix.String() + req.URL.Host = prefix.String() + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opGetPublicAccessBlockMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opGetPublicAccessBlockMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opGetPublicAccessBlockMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opGetPublicAccessBlock(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/s3control/api_op_ListAccessPoints.go b/service/s3control/api_op_ListAccessPoints.go index b58d3131d22..a94d1d56f81 100644 --- a/service/s3control/api_op_ListAccessPoints.go +++ b/service/s3control/api_op_ListAccessPoints.go @@ -175,7 +175,7 @@ func (*endpointPrefix_opListAccessPointsMiddleware) ID() string { func (m *endpointPrefix_opListAccessPointsMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -198,12 +198,90 @@ func (m *endpointPrefix_opListAccessPointsMiddleware) HandleSerialize(ctx contex prefix.WriteString(*input.AccountId) } prefix.WriteString(".") - req.HostPrefix = prefix.String() + req.URL.Host = prefix.String() + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opListAccessPointsMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opListAccessPointsMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opListAccessPointsMiddleware{}, `OperationSerializer`, middleware.After) +} + +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAccessPointsPaginator returns a new ListAccessPointsPaginator +func NewListAccessPointsPaginator(client ListAccessPointsAPIClient, params *ListAccessPointsInput, optFns ...func(*ListAccessPointsPaginatorOptions)) *ListAccessPointsPaginator { + options := ListAccessPointsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAccessPointsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil } func newServiceMetadataMiddleware_opListAccessPoints(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/s3control/api_op_ListJobs.go b/service/s3control/api_op_ListJobs.go index 580ba919af7..80da75791a4 100644 --- a/service/s3control/api_op_ListJobs.go +++ b/service/s3control/api_op_ListJobs.go @@ -166,7 +166,7 @@ func (*endpointPrefix_opListJobsMiddleware) ID() string { func (m *endpointPrefix_opListJobsMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -189,12 +189,89 @@ func (m *endpointPrefix_opListJobsMiddleware) HandleSerialize(ctx context.Contex prefix.WriteString(*input.AccountId) } prefix.WriteString(".") - req.HostPrefix = prefix.String() + req.URL.Host = prefix.String() + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opListJobsMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opListJobsMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opListJobsMiddleware{}, `OperationSerializer`, middleware.After) +} + +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListJobsPaginator returns a new ListJobsPaginator +func NewListJobsPaginator(client ListJobsAPIClient, params *ListJobsInput, optFns ...func(*ListJobsPaginatorOptions)) *ListJobsPaginator { + options := ListJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListJobsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil } func newServiceMetadataMiddleware_opListJobs(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/s3control/api_op_ListRegionalBuckets.go b/service/s3control/api_op_ListRegionalBuckets.go index 5ef02d5d309..e1772a91bdb 100644 --- a/service/s3control/api_op_ListRegionalBuckets.go +++ b/service/s3control/api_op_ListRegionalBuckets.go @@ -147,7 +147,7 @@ func (*endpointPrefix_opListRegionalBucketsMiddleware) ID() string { func (m *endpointPrefix_opListRegionalBucketsMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -170,12 +170,88 @@ func (m *endpointPrefix_opListRegionalBucketsMiddleware) HandleSerialize(ctx con prefix.WriteString(*input.AccountId) } prefix.WriteString(".") - req.HostPrefix = prefix.String() + req.URL.Host = prefix.String() + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opListRegionalBucketsMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opListRegionalBucketsMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opListRegionalBucketsMiddleware{}, `OperationSerializer`, middleware.After) +} + +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListRegionalBucketsPaginator returns a new ListRegionalBucketsPaginator +func NewListRegionalBucketsPaginator(client ListRegionalBucketsAPIClient, params *ListRegionalBucketsInput, optFns ...func(*ListRegionalBucketsPaginatorOptions)) *ListRegionalBucketsPaginator { + options := ListRegionalBucketsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRegionalBucketsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil } func newServiceMetadataMiddleware_opListRegionalBuckets(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/s3control/api_op_PutAccessPointPolicy.go b/service/s3control/api_op_PutAccessPointPolicy.go index d3e64e15106..c3defa6198e 100644 --- a/service/s3control/api_op_PutAccessPointPolicy.go +++ b/service/s3control/api_op_PutAccessPointPolicy.go @@ -159,7 +159,7 @@ func (*endpointPrefix_opPutAccessPointPolicyMiddleware) ID() string { func (m *endpointPrefix_opPutAccessPointPolicyMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -182,12 +182,12 @@ func (m *endpointPrefix_opPutAccessPointPolicyMiddleware) HandleSerialize(ctx co prefix.WriteString(*input.AccountId) } prefix.WriteString(".") - req.HostPrefix = prefix.String() + req.URL.Host = prefix.String() + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opPutAccessPointPolicyMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opPutAccessPointPolicyMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opPutAccessPointPolicyMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opPutAccessPointPolicy(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/s3control/api_op_PutBucketLifecycleConfiguration.go b/service/s3control/api_op_PutBucketLifecycleConfiguration.go index f1fc94b0115..19526645988 100644 --- a/service/s3control/api_op_PutBucketLifecycleConfiguration.go +++ b/service/s3control/api_op_PutBucketLifecycleConfiguration.go @@ -157,7 +157,7 @@ func (*endpointPrefix_opPutBucketLifecycleConfigurationMiddleware) ID() string { func (m *endpointPrefix_opPutBucketLifecycleConfigurationMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -180,12 +180,12 @@ func (m *endpointPrefix_opPutBucketLifecycleConfigurationMiddleware) HandleSeria prefix.WriteString(*input.AccountId) } prefix.WriteString(".") - req.HostPrefix = prefix.String() + req.URL.Host = prefix.String() + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opPutBucketLifecycleConfigurationMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opPutBucketLifecycleConfigurationMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opPutBucketLifecycleConfigurationMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opPutBucketLifecycleConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/s3control/api_op_PutBucketPolicy.go b/service/s3control/api_op_PutBucketPolicy.go index 7c6cdf10837..d330d3efeb1 100644 --- a/service/s3control/api_op_PutBucketPolicy.go +++ b/service/s3control/api_op_PutBucketPolicy.go @@ -176,7 +176,7 @@ func (*endpointPrefix_opPutBucketPolicyMiddleware) ID() string { func (m *endpointPrefix_opPutBucketPolicyMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -199,12 +199,12 @@ func (m *endpointPrefix_opPutBucketPolicyMiddleware) HandleSerialize(ctx context prefix.WriteString(*input.AccountId) } prefix.WriteString(".") - req.HostPrefix = prefix.String() + req.URL.Host = prefix.String() + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opPutBucketPolicyMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opPutBucketPolicyMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opPutBucketPolicyMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opPutBucketPolicy(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/s3control/api_op_PutBucketTagging.go b/service/s3control/api_op_PutBucketTagging.go index 0fb655ff07b..6ab0bc89eb6 100644 --- a/service/s3control/api_op_PutBucketTagging.go +++ b/service/s3control/api_op_PutBucketTagging.go @@ -212,7 +212,7 @@ func (*endpointPrefix_opPutBucketTaggingMiddleware) ID() string { func (m *endpointPrefix_opPutBucketTaggingMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -235,12 +235,12 @@ func (m *endpointPrefix_opPutBucketTaggingMiddleware) HandleSerialize(ctx contex prefix.WriteString(*input.AccountId) } prefix.WriteString(".") - req.HostPrefix = prefix.String() + req.URL.Host = prefix.String() + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opPutBucketTaggingMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opPutBucketTaggingMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opPutBucketTaggingMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opPutBucketTagging(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/s3control/api_op_PutJobTagging.go b/service/s3control/api_op_PutJobTagging.go index bc50640862e..af1244dc520 100644 --- a/service/s3control/api_op_PutJobTagging.go +++ b/service/s3control/api_op_PutJobTagging.go @@ -190,7 +190,7 @@ func (*endpointPrefix_opPutJobTaggingMiddleware) ID() string { func (m *endpointPrefix_opPutJobTaggingMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -213,12 +213,12 @@ func (m *endpointPrefix_opPutJobTaggingMiddleware) HandleSerialize(ctx context.C prefix.WriteString(*input.AccountId) } prefix.WriteString(".") - req.HostPrefix = prefix.String() + req.URL.Host = prefix.String() + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opPutJobTaggingMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opPutJobTaggingMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opPutJobTaggingMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opPutJobTagging(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/s3control/api_op_PutPublicAccessBlock.go b/service/s3control/api_op_PutPublicAccessBlock.go index a26739e71fa..2ac705ffc30 100644 --- a/service/s3control/api_op_PutPublicAccessBlock.go +++ b/service/s3control/api_op_PutPublicAccessBlock.go @@ -139,7 +139,7 @@ func (*endpointPrefix_opPutPublicAccessBlockMiddleware) ID() string { func (m *endpointPrefix_opPutPublicAccessBlockMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -162,12 +162,12 @@ func (m *endpointPrefix_opPutPublicAccessBlockMiddleware) HandleSerialize(ctx co prefix.WriteString(*input.AccountId) } prefix.WriteString(".") - req.HostPrefix = prefix.String() + req.URL.Host = prefix.String() + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opPutPublicAccessBlockMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opPutPublicAccessBlockMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opPutPublicAccessBlockMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opPutPublicAccessBlock(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/s3control/api_op_UpdateJobPriority.go b/service/s3control/api_op_UpdateJobPriority.go index a337bc46981..3ef0fddaf0e 100644 --- a/service/s3control/api_op_UpdateJobPriority.go +++ b/service/s3control/api_op_UpdateJobPriority.go @@ -161,7 +161,7 @@ func (*endpointPrefix_opUpdateJobPriorityMiddleware) ID() string { func (m *endpointPrefix_opUpdateJobPriorityMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -184,12 +184,12 @@ func (m *endpointPrefix_opUpdateJobPriorityMiddleware) HandleSerialize(ctx conte prefix.WriteString(*input.AccountId) } prefix.WriteString(".") - req.HostPrefix = prefix.String() + req.URL.Host = prefix.String() + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opUpdateJobPriorityMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opUpdateJobPriorityMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opUpdateJobPriorityMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opUpdateJobPriority(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/s3control/api_op_UpdateJobStatus.go b/service/s3control/api_op_UpdateJobStatus.go index 78950698668..72c186f805b 100644 --- a/service/s3control/api_op_UpdateJobStatus.go +++ b/service/s3control/api_op_UpdateJobStatus.go @@ -166,7 +166,7 @@ func (*endpointPrefix_opUpdateJobStatusMiddleware) ID() string { func (m *endpointPrefix_opUpdateJobStatusMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -189,12 +189,12 @@ func (m *endpointPrefix_opUpdateJobStatusMiddleware) HandleSerialize(ctx context prefix.WriteString(*input.AccountId) } prefix.WriteString(".") - req.HostPrefix = prefix.String() + req.URL.Host = prefix.String() + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opUpdateJobStatusMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opUpdateJobStatusMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opUpdateJobStatusMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opUpdateJobStatus(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/s3control/go.mod b/service/s3control/go.mod index 8d2d952a19f..e5940c42728 100644 --- a/service/s3control/go.mod +++ b/service/s3control/go.mod @@ -5,7 +5,7 @@ go 1.15 require ( github.com/aws/aws-sdk-go-v2 v0.29.0 github.com/aws/aws-sdk-go-v2/service/internal/s3shared v0.3.1-0.20201027184009-8eb8fc303e7c - github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/s3control/go.sum b/service/s3control/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/s3control/go.sum +++ b/service/s3control/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 16a69e1e41b..00000000000 --- a/service/s3control/paginators.go +++ /dev/null @@ -1,239 +0,0 @@ -// 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/api_op_ListEndpoints.go b/service/s3outposts/api_op_ListEndpoints.go index 2971fa308e9..b9b4edddaf4 100644 --- a/service/s3outposts/api_op_ListEndpoints.go +++ b/service/s3outposts/api_op_ListEndpoints.go @@ -4,6 +4,7 @@ package s3outposts import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/s3outposts/types" @@ -116,6 +117,80 @@ func addOperationListEndpointsMiddlewares(stack *middleware.Stack, options Optio return 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 max number of endpoints that can be returned on the request. + Limit *int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListEndpointsPaginator returns a new ListEndpointsPaginator +func NewListEndpointsPaginator(client ListEndpointsAPIClient, params *ListEndpointsInput, optFns ...func(*ListEndpointsPaginatorOptions)) *ListEndpointsPaginator { + options := ListEndpointsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListEndpointsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListEndpoints(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/s3outposts/go.mod b/service/s3outposts/go.mod index 6ad758e7d7b..f5af558ae00 100644 --- a/service/s3outposts/go.mod +++ b/service/s3outposts/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/s3outposts/go.sum b/service/s3outposts/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/s3outposts/go.sum +++ b/service/s3outposts/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 301aa76e5ae..00000000000 --- a/service/s3outposts/paginators.go +++ /dev/null @@ -1,82 +0,0 @@ -// 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/api_op_ListAlgorithms.go b/service/sagemaker/api_op_ListAlgorithms.go index e9624aca3b5..6da0a54b386 100644 --- a/service/sagemaker/api_op_ListAlgorithms.go +++ b/service/sagemaker/api_op_ListAlgorithms.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sagemaker/types" @@ -129,6 +130,81 @@ func addOperationListAlgorithmsMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAlgorithmsPaginator returns a new ListAlgorithmsPaginator +func NewListAlgorithmsPaginator(client ListAlgorithmsAPIClient, params *ListAlgorithmsInput, optFns ...func(*ListAlgorithmsPaginatorOptions)) *ListAlgorithmsPaginator { + options := ListAlgorithmsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAlgorithmsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAlgorithms(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListApps.go b/service/sagemaker/api_op_ListApps.go index e5b8aca995e..85f5d1c177c 100644 --- a/service/sagemaker/api_op_ListApps.go +++ b/service/sagemaker/api_op_ListApps.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sagemaker/types" @@ -119,6 +120,80 @@ func addOperationListAppsMiddlewares(stack *middleware.Stack, options Options) ( return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAppsPaginator returns a new ListAppsPaginator +func NewListAppsPaginator(client ListAppsAPIClient, params *ListAppsInput, optFns ...func(*ListAppsPaginatorOptions)) *ListAppsPaginator { + options := ListAppsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAppsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListApps(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListAutoMLJobs.go b/service/sagemaker/api_op_ListAutoMLJobs.go index 1f691201be5..3e03072b658 100644 --- a/service/sagemaker/api_op_ListAutoMLJobs.go +++ b/service/sagemaker/api_op_ListAutoMLJobs.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sagemaker/types" @@ -134,6 +135,81 @@ func addOperationListAutoMLJobsMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAutoMLJobsPaginator returns a new ListAutoMLJobsPaginator +func NewListAutoMLJobsPaginator(client ListAutoMLJobsAPIClient, params *ListAutoMLJobsInput, optFns ...func(*ListAutoMLJobsPaginatorOptions)) *ListAutoMLJobsPaginator { + options := ListAutoMLJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAutoMLJobsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAutoMLJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListCandidatesForAutoMLJob.go b/service/sagemaker/api_op_ListCandidatesForAutoMLJob.go index e7bab993ac2..c4e1bb39588 100644 --- a/service/sagemaker/api_op_ListCandidatesForAutoMLJob.go +++ b/service/sagemaker/api_op_ListCandidatesForAutoMLJob.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sagemaker/types" @@ -129,6 +130,83 @@ func addOperationListCandidatesForAutoMLJobMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListCandidatesForAutoMLJobPaginator returns a new +// ListCandidatesForAutoMLJobPaginator +func NewListCandidatesForAutoMLJobPaginator(client ListCandidatesForAutoMLJobAPIClient, params *ListCandidatesForAutoMLJobInput, optFns ...func(*ListCandidatesForAutoMLJobPaginatorOptions)) *ListCandidatesForAutoMLJobPaginator { + options := ListCandidatesForAutoMLJobPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListCandidatesForAutoMLJobInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListCandidatesForAutoMLJob(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListCodeRepositories.go b/service/sagemaker/api_op_ListCodeRepositories.go index 2083a7cc33b..aa518f66d31 100644 --- a/service/sagemaker/api_op_ListCodeRepositories.go +++ b/service/sagemaker/api_op_ListCodeRepositories.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sagemaker/types" @@ -152,6 +153,82 @@ func addOperationListCodeRepositoriesMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListCodeRepositoriesPaginator returns a new ListCodeRepositoriesPaginator +func NewListCodeRepositoriesPaginator(client ListCodeRepositoriesAPIClient, params *ListCodeRepositoriesInput, optFns ...func(*ListCodeRepositoriesPaginatorOptions)) *ListCodeRepositoriesPaginator { + options := ListCodeRepositoriesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListCodeRepositoriesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListCodeRepositories(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListCompilationJobs.go b/service/sagemaker/api_op_ListCompilationJobs.go index f684e4d35e1..d99f55f9ba2 100644 --- a/service/sagemaker/api_op_ListCompilationJobs.go +++ b/service/sagemaker/api_op_ListCompilationJobs.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sagemaker/types" @@ -145,6 +146,82 @@ func addOperationListCompilationJobsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListCompilationJobsPaginator returns a new ListCompilationJobsPaginator +func NewListCompilationJobsPaginator(client ListCompilationJobsAPIClient, params *ListCompilationJobsInput, optFns ...func(*ListCompilationJobsPaginatorOptions)) *ListCompilationJobsPaginator { + options := ListCompilationJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListCompilationJobsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListCompilationJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListDomains.go b/service/sagemaker/api_op_ListDomains.go index c5e7d11a71f..2facca4b703 100644 --- a/service/sagemaker/api_op_ListDomains.go +++ b/service/sagemaker/api_op_ListDomains.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sagemaker/types" @@ -107,6 +108,80 @@ func addOperationListDomainsMiddlewares(stack *middleware.Stack, options Options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDomainsPaginator returns a new ListDomainsPaginator +func NewListDomainsPaginator(client ListDomainsAPIClient, params *ListDomainsInput, optFns ...func(*ListDomainsPaginatorOptions)) *ListDomainsPaginator { + options := ListDomainsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDomainsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDomains(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListEndpointConfigs.go b/service/sagemaker/api_op_ListEndpointConfigs.go index 98029015c89..000431a86a6 100644 --- a/service/sagemaker/api_op_ListEndpointConfigs.go +++ b/service/sagemaker/api_op_ListEndpointConfigs.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sagemaker/types" @@ -129,6 +130,82 @@ func addOperationListEndpointConfigsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListEndpointConfigsPaginator returns a new ListEndpointConfigsPaginator +func NewListEndpointConfigsPaginator(client ListEndpointConfigsAPIClient, params *ListEndpointConfigsInput, optFns ...func(*ListEndpointConfigsPaginatorOptions)) *ListEndpointConfigsPaginator { + options := ListEndpointConfigsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListEndpointConfigsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListEndpointConfigs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListEndpoints.go b/service/sagemaker/api_op_ListEndpoints.go index baeddf0ef7b..ed07514302b 100644 --- a/service/sagemaker/api_op_ListEndpoints.go +++ b/service/sagemaker/api_op_ListEndpoints.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sagemaker/types" @@ -140,6 +141,80 @@ func addOperationListEndpointsMiddlewares(stack *middleware.Stack, options Optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListEndpointsPaginator returns a new ListEndpointsPaginator +func NewListEndpointsPaginator(client ListEndpointsAPIClient, params *ListEndpointsInput, optFns ...func(*ListEndpointsPaginatorOptions)) *ListEndpointsPaginator { + options := ListEndpointsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListEndpointsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListEndpoints(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListExperiments.go b/service/sagemaker/api_op_ListExperiments.go index 29b6f04ea31..b440d633c08 100644 --- a/service/sagemaker/api_op_ListExperiments.go +++ b/service/sagemaker/api_op_ListExperiments.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sagemaker/types" @@ -122,6 +123,82 @@ func addOperationListExperimentsMiddlewares(stack *middleware.Stack, options Opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListExperimentsPaginator returns a new ListExperimentsPaginator +func NewListExperimentsPaginator(client ListExperimentsAPIClient, params *ListExperimentsInput, optFns ...func(*ListExperimentsPaginatorOptions)) *ListExperimentsPaginator { + options := ListExperimentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListExperimentsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListExperiments(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListFlowDefinitions.go b/service/sagemaker/api_op_ListFlowDefinitions.go index abb9ade21be..e894066cf17 100644 --- a/service/sagemaker/api_op_ListFlowDefinitions.go +++ b/service/sagemaker/api_op_ListFlowDefinitions.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sagemaker/types" @@ -122,6 +123,84 @@ func addOperationListFlowDefinitionsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListFlowDefinitionsPaginator returns a new ListFlowDefinitionsPaginator +func NewListFlowDefinitionsPaginator(client ListFlowDefinitionsAPIClient, params *ListFlowDefinitionsInput, optFns ...func(*ListFlowDefinitionsPaginatorOptions)) *ListFlowDefinitionsPaginator { + options := ListFlowDefinitionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListFlowDefinitionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListFlowDefinitions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListHumanTaskUis.go b/service/sagemaker/api_op_ListHumanTaskUis.go index 2e3f5239f0c..7d283cfe647 100644 --- a/service/sagemaker/api_op_ListHumanTaskUis.go +++ b/service/sagemaker/api_op_ListHumanTaskUis.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sagemaker/types" @@ -122,6 +123,83 @@ func addOperationListHumanTaskUisMiddlewares(stack *middleware.Stack, options Op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListHumanTaskUisPaginator returns a new ListHumanTaskUisPaginator +func NewListHumanTaskUisPaginator(client ListHumanTaskUisAPIClient, params *ListHumanTaskUisInput, optFns ...func(*ListHumanTaskUisPaginatorOptions)) *ListHumanTaskUisPaginator { + options := ListHumanTaskUisPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListHumanTaskUisInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListHumanTaskUis(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListHyperParameterTuningJobs.go b/service/sagemaker/api_op_ListHyperParameterTuningJobs.go index e5961a3c6b3..a88a6129a37 100644 --- a/service/sagemaker/api_op_ListHyperParameterTuningJobs.go +++ b/service/sagemaker/api_op_ListHyperParameterTuningJobs.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sagemaker/types" @@ -143,6 +144,83 @@ func addOperationListHyperParameterTuningJobsMiddlewares(stack *middleware.Stack return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListHyperParameterTuningJobsPaginator returns a new +// ListHyperParameterTuningJobsPaginator +func NewListHyperParameterTuningJobsPaginator(client ListHyperParameterTuningJobsAPIClient, params *ListHyperParameterTuningJobsInput, optFns ...func(*ListHyperParameterTuningJobsPaginatorOptions)) *ListHyperParameterTuningJobsPaginator { + options := ListHyperParameterTuningJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListHyperParameterTuningJobsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListHyperParameterTuningJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListImageVersions.go b/service/sagemaker/api_op_ListImageVersions.go index c70bc8e157c..fbdc47daa98 100644 --- a/service/sagemaker/api_op_ListImageVersions.go +++ b/service/sagemaker/api_op_ListImageVersions.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sagemaker/types" @@ -135,6 +136,82 @@ func addOperationListImageVersionsMiddlewares(stack *middleware.Stack, options O return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListImageVersionsPaginator returns a new ListImageVersionsPaginator +func NewListImageVersionsPaginator(client ListImageVersionsAPIClient, params *ListImageVersionsInput, optFns ...func(*ListImageVersionsPaginatorOptions)) *ListImageVersionsPaginator { + options := ListImageVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListImageVersionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListImageVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListImages.go b/service/sagemaker/api_op_ListImages.go index f56b0f136a0..6ce59801428 100644 --- a/service/sagemaker/api_op_ListImages.go +++ b/service/sagemaker/api_op_ListImages.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sagemaker/types" @@ -130,6 +131,80 @@ func addOperationListImagesMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListImagesPaginator returns a new ListImagesPaginator +func NewListImagesPaginator(client ListImagesAPIClient, params *ListImagesInput, optFns ...func(*ListImagesPaginatorOptions)) *ListImagesPaginator { + options := ListImagesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListImagesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListImages(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListLabelingJobs.go b/service/sagemaker/api_op_ListLabelingJobs.go index 1abf0c6b780..8ed07f105ce 100644 --- a/service/sagemaker/api_op_ListLabelingJobs.go +++ b/service/sagemaker/api_op_ListLabelingJobs.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sagemaker/types" @@ -138,6 +139,81 @@ func addOperationListLabelingJobsMiddlewares(stack *middleware.Stack, options Op return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListLabelingJobsPaginator returns a new ListLabelingJobsPaginator +func NewListLabelingJobsPaginator(client ListLabelingJobsAPIClient, params *ListLabelingJobsInput, optFns ...func(*ListLabelingJobsPaginatorOptions)) *ListLabelingJobsPaginator { + options := ListLabelingJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListLabelingJobsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListLabelingJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListLabelingJobsForWorkteam.go b/service/sagemaker/api_op_ListLabelingJobsForWorkteam.go index 9e9823395fc..b8b9f3617d5 100644 --- a/service/sagemaker/api_op_ListLabelingJobsForWorkteam.go +++ b/service/sagemaker/api_op_ListLabelingJobsForWorkteam.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sagemaker/types" @@ -138,6 +139,83 @@ func addOperationListLabelingJobsForWorkteamMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListLabelingJobsForWorkteamPaginator returns a new +// ListLabelingJobsForWorkteamPaginator +func NewListLabelingJobsForWorkteamPaginator(client ListLabelingJobsForWorkteamAPIClient, params *ListLabelingJobsForWorkteamInput, optFns ...func(*ListLabelingJobsForWorkteamPaginatorOptions)) *ListLabelingJobsForWorkteamPaginator { + options := ListLabelingJobsForWorkteamPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListLabelingJobsForWorkteamInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListLabelingJobsForWorkteam(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListModelPackages.go b/service/sagemaker/api_op_ListModelPackages.go index e163842b6db..56856276ecd 100644 --- a/service/sagemaker/api_op_ListModelPackages.go +++ b/service/sagemaker/api_op_ListModelPackages.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sagemaker/types" @@ -129,6 +130,81 @@ func addOperationListModelPackagesMiddlewares(stack *middleware.Stack, options O return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListModelPackagesPaginator returns a new ListModelPackagesPaginator +func NewListModelPackagesPaginator(client ListModelPackagesAPIClient, params *ListModelPackagesInput, optFns ...func(*ListModelPackagesPaginatorOptions)) *ListModelPackagesPaginator { + options := ListModelPackagesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListModelPackagesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListModelPackages(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListModels.go b/service/sagemaker/api_op_ListModels.go index aa46abe7fcc..1f8e6130d87 100644 --- a/service/sagemaker/api_op_ListModels.go +++ b/service/sagemaker/api_op_ListModels.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sagemaker/types" @@ -128,6 +129,80 @@ func addOperationListModelsMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListModelsPaginator returns a new ListModelsPaginator +func NewListModelsPaginator(client ListModelsAPIClient, params *ListModelsInput, optFns ...func(*ListModelsPaginatorOptions)) *ListModelsPaginator { + options := ListModelsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListModelsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListModels(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListMonitoringExecutions.go b/service/sagemaker/api_op_ListMonitoringExecutions.go index 5cdc0105561..f3501450bdb 100644 --- a/service/sagemaker/api_op_ListMonitoringExecutions.go +++ b/service/sagemaker/api_op_ListMonitoringExecutions.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sagemaker/types" @@ -145,6 +146,83 @@ func addOperationListMonitoringExecutionsMiddlewares(stack *middleware.Stack, op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListMonitoringExecutionsPaginator returns a new +// ListMonitoringExecutionsPaginator +func NewListMonitoringExecutionsPaginator(client ListMonitoringExecutionsAPIClient, params *ListMonitoringExecutionsInput, optFns ...func(*ListMonitoringExecutionsPaginatorOptions)) *ListMonitoringExecutionsPaginator { + options := ListMonitoringExecutionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListMonitoringExecutionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListMonitoringExecutions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListMonitoringSchedules.go b/service/sagemaker/api_op_ListMonitoringSchedules.go index 26ddd9c2c2e..278d7da7d70 100644 --- a/service/sagemaker/api_op_ListMonitoringSchedules.go +++ b/service/sagemaker/api_op_ListMonitoringSchedules.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sagemaker/types" @@ -141,6 +142,83 @@ func addOperationListMonitoringSchedulesMiddlewares(stack *middleware.Stack, opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListMonitoringSchedulesPaginator returns a new +// ListMonitoringSchedulesPaginator +func NewListMonitoringSchedulesPaginator(client ListMonitoringSchedulesAPIClient, params *ListMonitoringSchedulesInput, optFns ...func(*ListMonitoringSchedulesPaginatorOptions)) *ListMonitoringSchedulesPaginator { + options := ListMonitoringSchedulesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListMonitoringSchedulesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListMonitoringSchedules(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListNotebookInstanceLifecycleConfigs.go b/service/sagemaker/api_op_ListNotebookInstanceLifecycleConfigs.go index 0d7aff45bfa..a2da1be2698 100644 --- a/service/sagemaker/api_op_ListNotebookInstanceLifecycleConfigs.go +++ b/service/sagemaker/api_op_ListNotebookInstanceLifecycleConfigs.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sagemaker/types" @@ -137,6 +138,83 @@ func addOperationListNotebookInstanceLifecycleConfigsMiddlewares(stack *middlewa return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListNotebookInstanceLifecycleConfigsPaginator returns a new +// ListNotebookInstanceLifecycleConfigsPaginator +func NewListNotebookInstanceLifecycleConfigsPaginator(client ListNotebookInstanceLifecycleConfigsAPIClient, params *ListNotebookInstanceLifecycleConfigsInput, optFns ...func(*ListNotebookInstanceLifecycleConfigsPaginatorOptions)) *ListNotebookInstanceLifecycleConfigsPaginator { + options := ListNotebookInstanceLifecycleConfigsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListNotebookInstanceLifecycleConfigsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListNotebookInstanceLifecycleConfigs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListNotebookInstances.go b/service/sagemaker/api_op_ListNotebookInstances.go index c5fdde4b4c0..acfb2a2335c 100644 --- a/service/sagemaker/api_op_ListNotebookInstances.go +++ b/service/sagemaker/api_op_ListNotebookInstances.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sagemaker/types" @@ -158,6 +159,82 @@ func addOperationListNotebookInstancesMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListNotebookInstancesPaginator returns a new ListNotebookInstancesPaginator +func NewListNotebookInstancesPaginator(client ListNotebookInstancesAPIClient, params *ListNotebookInstancesInput, optFns ...func(*ListNotebookInstancesPaginatorOptions)) *ListNotebookInstancesPaginator { + options := ListNotebookInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListNotebookInstancesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListNotebookInstances(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListProcessingJobs.go b/service/sagemaker/api_op_ListProcessingJobs.go index ab472820984..a28ac5d89c9 100644 --- a/service/sagemaker/api_op_ListProcessingJobs.go +++ b/service/sagemaker/api_op_ListProcessingJobs.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sagemaker/types" @@ -136,6 +137,82 @@ func addOperationListProcessingJobsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListProcessingJobsPaginator returns a new ListProcessingJobsPaginator +func NewListProcessingJobsPaginator(client ListProcessingJobsAPIClient, params *ListProcessingJobsInput, optFns ...func(*ListProcessingJobsPaginatorOptions)) *ListProcessingJobsPaginator { + options := ListProcessingJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListProcessingJobsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListProcessingJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListSubscribedWorkteams.go b/service/sagemaker/api_op_ListSubscribedWorkteams.go index 5e043bf5330..fd544ccfe93 100644 --- a/service/sagemaker/api_op_ListSubscribedWorkteams.go +++ b/service/sagemaker/api_op_ListSubscribedWorkteams.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sagemaker/types" @@ -116,6 +117,83 @@ func addOperationListSubscribedWorkteamsMiddlewares(stack *middleware.Stack, opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListSubscribedWorkteamsPaginator returns a new +// ListSubscribedWorkteamsPaginator +func NewListSubscribedWorkteamsPaginator(client ListSubscribedWorkteamsAPIClient, params *ListSubscribedWorkteamsInput, optFns ...func(*ListSubscribedWorkteamsPaginatorOptions)) *ListSubscribedWorkteamsPaginator { + options := ListSubscribedWorkteamsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSubscribedWorkteamsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSubscribedWorkteams(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListTags.go b/service/sagemaker/api_op_ListTags.go index 9597492bb51..fef270e8d97 100644 --- a/service/sagemaker/api_op_ListTags.go +++ b/service/sagemaker/api_op_ListTags.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sagemaker/types" @@ -116,6 +117,80 @@ func addOperationListTagsMiddlewares(stack *middleware.Stack, options Options) ( return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTagsPaginator returns a new ListTagsPaginator +func NewListTagsPaginator(client ListTagsAPIClient, params *ListTagsInput, optFns ...func(*ListTagsPaginatorOptions)) *ListTagsPaginator { + options := ListTagsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTagsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTags(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListTrainingJobs.go b/service/sagemaker/api_op_ListTrainingJobs.go index 45f3fea683a..5831a275eea 100644 --- a/service/sagemaker/api_op_ListTrainingJobs.go +++ b/service/sagemaker/api_op_ListTrainingJobs.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sagemaker/types" @@ -140,6 +141,81 @@ func addOperationListTrainingJobsMiddlewares(stack *middleware.Stack, options Op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTrainingJobsPaginator returns a new ListTrainingJobsPaginator +func NewListTrainingJobsPaginator(client ListTrainingJobsAPIClient, params *ListTrainingJobsInput, optFns ...func(*ListTrainingJobsPaginatorOptions)) *ListTrainingJobsPaginator { + options := ListTrainingJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTrainingJobsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTrainingJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListTrainingJobsForHyperParameterTuningJob.go b/service/sagemaker/api_op_ListTrainingJobsForHyperParameterTuningJob.go index e64deb20970..3c24ae6ce95 100644 --- a/service/sagemaker/api_op_ListTrainingJobsForHyperParameterTuningJob.go +++ b/service/sagemaker/api_op_ListTrainingJobsForHyperParameterTuningJob.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sagemaker/types" @@ -132,6 +133,83 @@ func addOperationListTrainingJobsForHyperParameterTuningJobMiddlewares(stack *mi return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTrainingJobsForHyperParameterTuningJobPaginator returns a new +// ListTrainingJobsForHyperParameterTuningJobPaginator +func NewListTrainingJobsForHyperParameterTuningJobPaginator(client ListTrainingJobsForHyperParameterTuningJobAPIClient, params *ListTrainingJobsForHyperParameterTuningJobInput, optFns ...func(*ListTrainingJobsForHyperParameterTuningJobPaginatorOptions)) *ListTrainingJobsForHyperParameterTuningJobPaginator { + options := ListTrainingJobsForHyperParameterTuningJobPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTrainingJobsForHyperParameterTuningJobInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTrainingJobsForHyperParameterTuningJob(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListTransformJobs.go b/service/sagemaker/api_op_ListTransformJobs.go index 06548d79715..de797074b14 100644 --- a/service/sagemaker/api_op_ListTransformJobs.go +++ b/service/sagemaker/api_op_ListTransformJobs.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sagemaker/types" @@ -137,6 +138,82 @@ func addOperationListTransformJobsMiddlewares(stack *middleware.Stack, options O return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTransformJobsPaginator returns a new ListTransformJobsPaginator +func NewListTransformJobsPaginator(client ListTransformJobsAPIClient, params *ListTransformJobsInput, optFns ...func(*ListTransformJobsPaginatorOptions)) *ListTransformJobsPaginator { + options := ListTransformJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTransformJobsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTransformJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListTrialComponents.go b/service/sagemaker/api_op_ListTrialComponents.go index 8cf20ea8a23..eac72addbd3 100644 --- a/service/sagemaker/api_op_ListTrialComponents.go +++ b/service/sagemaker/api_op_ListTrialComponents.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sagemaker/types" @@ -142,6 +143,83 @@ func addOperationListTrialComponentsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTrialComponentsPaginator returns a new ListTrialComponentsPaginator +func NewListTrialComponentsPaginator(client ListTrialComponentsAPIClient, params *ListTrialComponentsInput, optFns ...func(*ListTrialComponentsPaginatorOptions)) *ListTrialComponentsPaginator { + options := ListTrialComponentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTrialComponentsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTrialComponents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListTrials.go b/service/sagemaker/api_op_ListTrials.go index a6e1893f8e8..c298770deb2 100644 --- a/service/sagemaker/api_op_ListTrials.go +++ b/service/sagemaker/api_op_ListTrials.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sagemaker/types" @@ -130,6 +131,80 @@ func addOperationListTrialsMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTrialsPaginator returns a new ListTrialsPaginator +func NewListTrialsPaginator(client ListTrialsAPIClient, params *ListTrialsInput, optFns ...func(*ListTrialsPaginatorOptions)) *ListTrialsPaginator { + options := ListTrialsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTrialsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTrials(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListUserProfiles.go b/service/sagemaker/api_op_ListUserProfiles.go index fd22ad72765..d0e13a35dc2 100644 --- a/service/sagemaker/api_op_ListUserProfiles.go +++ b/service/sagemaker/api_op_ListUserProfiles.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sagemaker/types" @@ -119,6 +120,81 @@ func addOperationListUserProfilesMiddlewares(stack *middleware.Stack, options Op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListUserProfilesPaginator returns a new ListUserProfilesPaginator +func NewListUserProfilesPaginator(client ListUserProfilesAPIClient, params *ListUserProfilesInput, optFns ...func(*ListUserProfilesPaginatorOptions)) *ListUserProfilesPaginator { + options := ListUserProfilesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListUserProfilesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListUserProfiles(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListWorkforces.go b/service/sagemaker/api_op_ListWorkforces.go index 947536a0f4b..bf1f9f25a43 100644 --- a/service/sagemaker/api_op_ListWorkforces.go +++ b/service/sagemaker/api_op_ListWorkforces.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sagemaker/types" @@ -117,6 +118,81 @@ func addOperationListWorkforcesMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListWorkforcesPaginator returns a new ListWorkforcesPaginator +func NewListWorkforcesPaginator(client ListWorkforcesAPIClient, params *ListWorkforcesInput, optFns ...func(*ListWorkforcesPaginatorOptions)) *ListWorkforcesPaginator { + options := ListWorkforcesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListWorkforcesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListWorkforces(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListWorkteams.go b/service/sagemaker/api_op_ListWorkteams.go index f60974b39b4..4782605eacb 100644 --- a/service/sagemaker/api_op_ListWorkteams.go +++ b/service/sagemaker/api_op_ListWorkteams.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sagemaker/types" @@ -122,6 +123,80 @@ func addOperationListWorkteamsMiddlewares(stack *middleware.Stack, options Optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListWorkteamsPaginator returns a new ListWorkteamsPaginator +func NewListWorkteamsPaginator(client ListWorkteamsAPIClient, params *ListWorkteamsInput, optFns ...func(*ListWorkteamsPaginatorOptions)) *ListWorkteamsPaginator { + options := ListWorkteamsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListWorkteamsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListWorkteams(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_Search.go b/service/sagemaker/api_op_Search.go index 2c78acff4b0..179dccafb40 100644 --- a/service/sagemaker/api_op_Search.go +++ b/service/sagemaker/api_op_Search.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sagemaker/types" @@ -135,6 +136,80 @@ func addOperationSearchMiddlewares(stack *middleware.Stack, options Options) (er return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewSearchPaginator returns a new SearchPaginator +func NewSearchPaginator(client SearchAPIClient, params *SearchInput, optFns ...func(*SearchPaginatorOptions)) *SearchPaginator { + options := SearchPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearch(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/go.mod b/service/sagemaker/go.mod index 2cd613aeca8..94392c53eb3 100644 --- a/service/sagemaker/go.mod +++ b/service/sagemaker/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/sagemaker/go.sum b/service/sagemaker/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/sagemaker/go.sum +++ b/service/sagemaker/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 5476c0efc84..00000000000 --- a/service/sagemaker/paginators.go +++ /dev/null @@ -1,2655 +0,0 @@ -// 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/api_op_ListHumanLoops.go b/service/sagemakera2iruntime/api_op_ListHumanLoops.go index 5f7ac38f17b..f9f1616482b 100644 --- a/service/sagemakera2iruntime/api_op_ListHumanLoops.go +++ b/service/sagemakera2iruntime/api_op_ListHumanLoops.go @@ -4,6 +4,7 @@ package sagemakera2iruntime import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sagemakera2iruntime/types" @@ -131,6 +132,83 @@ func addOperationListHumanLoopsMiddlewares(stack *middleware.Stack, options Opti return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListHumanLoopsPaginator returns a new ListHumanLoopsPaginator +func NewListHumanLoopsPaginator(client ListHumanLoopsAPIClient, params *ListHumanLoopsInput, optFns ...func(*ListHumanLoopsPaginatorOptions)) *ListHumanLoopsPaginator { + options := ListHumanLoopsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListHumanLoopsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListHumanLoops(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemakera2iruntime/go.mod b/service/sagemakera2iruntime/go.mod index 9d15c1aab4a..6ab7dc6da71 100644 --- a/service/sagemakera2iruntime/go.mod +++ b/service/sagemakera2iruntime/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/sagemakera2iruntime/go.sum b/service/sagemakera2iruntime/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/sagemakera2iruntime/go.sum +++ b/service/sagemakera2iruntime/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index c2026a59704..00000000000 --- a/service/sagemakera2iruntime/paginators.go +++ /dev/null @@ -1,85 +0,0 @@ -// 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.mod b/service/sagemakerruntime/go.mod index f7e90433281..df3c6866a46 100644 --- a/service/sagemakerruntime/go.mod +++ b/service/sagemakerruntime/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/sagemakerruntime/go.sum b/service/sagemakerruntime/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/sagemakerruntime/go.sum +++ b/service/sagemakerruntime/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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.mod b/service/savingsplans/go.mod index fe4fa9b4229..1d6c3189dbc 100644 --- a/service/savingsplans/go.mod +++ b/service/savingsplans/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/savingsplans/go.sum b/service/savingsplans/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/savingsplans/go.sum +++ b/service/savingsplans/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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/api_op_ListDiscoverers.go b/service/schemas/api_op_ListDiscoverers.go index d5468b73c71..f4e34773971 100644 --- a/service/schemas/api_op_ListDiscoverers.go +++ b/service/schemas/api_op_ListDiscoverers.go @@ -4,6 +4,7 @@ package schemas import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/schemas/types" @@ -116,6 +117,80 @@ func addOperationListDiscoverersMiddlewares(stack *middleware.Stack, options Opt return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDiscoverersPaginator returns a new ListDiscoverersPaginator +func NewListDiscoverersPaginator(client ListDiscoverersAPIClient, params *ListDiscoverersInput, optFns ...func(*ListDiscoverersPaginatorOptions)) *ListDiscoverersPaginator { + options := ListDiscoverersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDiscoverersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDiscoverers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/schemas/api_op_ListRegistries.go b/service/schemas/api_op_ListRegistries.go index 04070f0e331..479e9f5a0c3 100644 --- a/service/schemas/api_op_ListRegistries.go +++ b/service/schemas/api_op_ListRegistries.go @@ -4,6 +4,7 @@ package schemas import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/schemas/types" @@ -115,6 +116,80 @@ func addOperationListRegistriesMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListRegistriesPaginator returns a new ListRegistriesPaginator +func NewListRegistriesPaginator(client ListRegistriesAPIClient, params *ListRegistriesInput, optFns ...func(*ListRegistriesPaginatorOptions)) *ListRegistriesPaginator { + options := ListRegistriesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRegistriesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRegistries(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/schemas/api_op_ListSchemaVersions.go b/service/schemas/api_op_ListSchemaVersions.go index 05170afe591..7004f04c971 100644 --- a/service/schemas/api_op_ListSchemaVersions.go +++ b/service/schemas/api_op_ListSchemaVersions.go @@ -4,6 +4,7 @@ package schemas import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/schemas/types" @@ -121,6 +122,81 @@ func addOperationListSchemaVersionsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListSchemaVersionsPaginator returns a new ListSchemaVersionsPaginator +func NewListSchemaVersionsPaginator(client ListSchemaVersionsAPIClient, params *ListSchemaVersionsInput, optFns ...func(*ListSchemaVersionsPaginatorOptions)) *ListSchemaVersionsPaginator { + options := ListSchemaVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSchemaVersionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSchemaVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/schemas/api_op_ListSchemas.go b/service/schemas/api_op_ListSchemas.go index 5084aa0ffb6..a6fb78dbb8b 100644 --- a/service/schemas/api_op_ListSchemas.go +++ b/service/schemas/api_op_ListSchemas.go @@ -4,6 +4,7 @@ package schemas import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/schemas/types" @@ -120,6 +121,79 @@ func addOperationListSchemasMiddlewares(stack *middleware.Stack, options Options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListSchemasPaginator returns a new ListSchemasPaginator +func NewListSchemasPaginator(client ListSchemasAPIClient, params *ListSchemasInput, optFns ...func(*ListSchemasPaginatorOptions)) *ListSchemasPaginator { + options := ListSchemasPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSchemasInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSchemas(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/schemas/api_op_SearchSchemas.go b/service/schemas/api_op_SearchSchemas.go index cc59693cf77..6c9b7b6e9a7 100644 --- a/service/schemas/api_op_SearchSchemas.go +++ b/service/schemas/api_op_SearchSchemas.go @@ -4,6 +4,7 @@ package schemas import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/schemas/types" @@ -122,6 +123,79 @@ func addOperationSearchSchemasMiddlewares(stack *middleware.Stack, options Optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewSearchSchemasPaginator returns a new SearchSchemasPaginator +func NewSearchSchemasPaginator(client SearchSchemasAPIClient, params *SearchSchemasInput, optFns ...func(*SearchSchemasPaginatorOptions)) *SearchSchemasPaginator { + options := SearchSchemasPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchSchemasInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearchSchemas(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/schemas/go.mod b/service/schemas/go.mod index 442a554b8a8..1065b068464 100644 --- a/service/schemas/go.mod +++ b/service/schemas/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/schemas/go.sum b/service/schemas/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/schemas/go.sum +++ b/service/schemas/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 117275d9a37..00000000000 --- a/service/schemas/paginators.go +++ /dev/null @@ -1,377 +0,0 @@ -// 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/api_op_ListSecretVersionIds.go b/service/secretsmanager/api_op_ListSecretVersionIds.go index f7e2ce90ae6..e6e28f45ceb 100644 --- a/service/secretsmanager/api_op_ListSecretVersionIds.go +++ b/service/secretsmanager/api_op_ListSecretVersionIds.go @@ -4,6 +4,7 @@ package secretsmanager import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/secretsmanager/types" @@ -178,6 +179,90 @@ func addOperationListSecretVersionIdsMiddlewares(stack *middleware.Stack, option return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListSecretVersionIdsPaginator returns a new ListSecretVersionIdsPaginator +func NewListSecretVersionIdsPaginator(client ListSecretVersionIdsAPIClient, params *ListSecretVersionIdsInput, optFns ...func(*ListSecretVersionIdsPaginatorOptions)) *ListSecretVersionIdsPaginator { + options := ListSecretVersionIdsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSecretVersionIdsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSecretVersionIds(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/secretsmanager/api_op_ListSecrets.go b/service/secretsmanager/api_op_ListSecrets.go index 18897469962..04dd8e817d4 100644 --- a/service/secretsmanager/api_op_ListSecrets.go +++ b/service/secretsmanager/api_op_ListSecrets.go @@ -4,6 +4,7 @@ package secretsmanager import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/secretsmanager/types" @@ -145,6 +146,88 @@ func addOperationListSecretsMiddlewares(stack *middleware.Stack, options Options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListSecretsPaginator returns a new ListSecretsPaginator +func NewListSecretsPaginator(client ListSecretsAPIClient, params *ListSecretsInput, optFns ...func(*ListSecretsPaginatorOptions)) *ListSecretsPaginator { + options := ListSecretsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSecretsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSecrets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/secretsmanager/go.mod b/service/secretsmanager/go.mod index 56d50f81a9c..5ee356e28b9 100644 --- a/service/secretsmanager/go.mod +++ b/service/secretsmanager/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/secretsmanager/go.sum b/service/secretsmanager/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/secretsmanager/go.sum +++ b/service/secretsmanager/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 298c8bd0d80..00000000000 --- a/service/secretsmanager/paginators.go +++ /dev/null @@ -1,174 +0,0 @@ -// 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/api_op_DescribeActionTargets.go b/service/securityhub/api_op_DescribeActionTargets.go index 45ba417dc7f..132020d6ef8 100644 --- a/service/securityhub/api_op_DescribeActionTargets.go +++ b/service/securityhub/api_op_DescribeActionTargets.go @@ -4,6 +4,7 @@ package securityhub import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/securityhub/types" @@ -114,6 +115,82 @@ func addOperationDescribeActionTargetsMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeActionTargetsPaginator returns a new DescribeActionTargetsPaginator +func NewDescribeActionTargetsPaginator(client DescribeActionTargetsAPIClient, params *DescribeActionTargetsInput, optFns ...func(*DescribeActionTargetsPaginatorOptions)) *DescribeActionTargetsPaginator { + options := DescribeActionTargetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeActionTargetsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeActionTargets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/securityhub/api_op_DescribeProducts.go b/service/securityhub/api_op_DescribeProducts.go index 60a529ecdcb..de7949aea3e 100644 --- a/service/securityhub/api_op_DescribeProducts.go +++ b/service/securityhub/api_op_DescribeProducts.go @@ -4,6 +4,7 @@ package securityhub import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/securityhub/types" @@ -111,6 +112,81 @@ func addOperationDescribeProductsMiddlewares(stack *middleware.Stack, options Op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeProductsPaginator returns a new DescribeProductsPaginator +func NewDescribeProductsPaginator(client DescribeProductsAPIClient, params *DescribeProductsInput, optFns ...func(*DescribeProductsPaginatorOptions)) *DescribeProductsPaginator { + options := DescribeProductsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeProductsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeProducts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/securityhub/api_op_DescribeStandards.go b/service/securityhub/api_op_DescribeStandards.go index 2d957dd6d98..5fa6cbca5f3 100644 --- a/service/securityhub/api_op_DescribeStandards.go +++ b/service/securityhub/api_op_DescribeStandards.go @@ -4,6 +4,7 @@ package securityhub import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/securityhub/types" @@ -109,6 +110,81 @@ func addOperationDescribeStandardsMiddlewares(stack *middleware.Stack, options O return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeStandardsPaginator returns a new DescribeStandardsPaginator +func NewDescribeStandardsPaginator(client DescribeStandardsAPIClient, params *DescribeStandardsInput, optFns ...func(*DescribeStandardsPaginatorOptions)) *DescribeStandardsPaginator { + options := DescribeStandardsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeStandardsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeStandards(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/securityhub/api_op_DescribeStandardsControls.go b/service/securityhub/api_op_DescribeStandardsControls.go index 5d3b8fc088b..2abe7a909e3 100644 --- a/service/securityhub/api_op_DescribeStandardsControls.go +++ b/service/securityhub/api_op_DescribeStandardsControls.go @@ -4,6 +4,7 @@ package securityhub import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/securityhub/types" @@ -118,6 +119,83 @@ func addOperationDescribeStandardsControlsMiddlewares(stack *middleware.Stack, o return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeStandardsControlsPaginator returns a new +// DescribeStandardsControlsPaginator +func NewDescribeStandardsControlsPaginator(client DescribeStandardsControlsAPIClient, params *DescribeStandardsControlsInput, optFns ...func(*DescribeStandardsControlsPaginatorOptions)) *DescribeStandardsControlsPaginator { + options := DescribeStandardsControlsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeStandardsControlsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeStandardsControls(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/securityhub/api_op_GetEnabledStandards.go b/service/securityhub/api_op_GetEnabledStandards.go index 2d6aa89add5..257511ed10f 100644 --- a/service/securityhub/api_op_GetEnabledStandards.go +++ b/service/securityhub/api_op_GetEnabledStandards.go @@ -4,6 +4,7 @@ package securityhub import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/securityhub/types" @@ -112,6 +113,82 @@ func addOperationGetEnabledStandardsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetEnabledStandardsPaginator returns a new GetEnabledStandardsPaginator +func NewGetEnabledStandardsPaginator(client GetEnabledStandardsAPIClient, params *GetEnabledStandardsInput, optFns ...func(*GetEnabledStandardsPaginatorOptions)) *GetEnabledStandardsPaginator { + options := GetEnabledStandardsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetEnabledStandardsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetEnabledStandards(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/securityhub/api_op_GetFindings.go b/service/securityhub/api_op_GetFindings.go index 1c9318bd28b..9d7deeb2a93 100644 --- a/service/securityhub/api_op_GetFindings.go +++ b/service/securityhub/api_op_GetFindings.go @@ -4,6 +4,7 @@ package securityhub import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/securityhub/types" @@ -120,6 +121,80 @@ func addOperationGetFindingsMiddlewares(stack *middleware.Stack, options Options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetFindingsPaginator returns a new GetFindingsPaginator +func NewGetFindingsPaginator(client GetFindingsAPIClient, params *GetFindingsInput, optFns ...func(*GetFindingsPaginatorOptions)) *GetFindingsPaginator { + options := GetFindingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetFindingsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetFindings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/securityhub/api_op_GetInsights.go b/service/securityhub/api_op_GetInsights.go index 31a413ee634..3efe791f1d5 100644 --- a/service/securityhub/api_op_GetInsights.go +++ b/service/securityhub/api_op_GetInsights.go @@ -4,6 +4,7 @@ package securityhub import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/securityhub/types" @@ -115,6 +116,80 @@ func addOperationGetInsightsMiddlewares(stack *middleware.Stack, options Options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetInsightsPaginator returns a new GetInsightsPaginator +func NewGetInsightsPaginator(client GetInsightsAPIClient, params *GetInsightsInput, optFns ...func(*GetInsightsPaginatorOptions)) *GetInsightsPaginator { + options := GetInsightsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetInsightsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetInsights(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/securityhub/api_op_ListEnabledProductsForImport.go b/service/securityhub/api_op_ListEnabledProductsForImport.go index fc2fef47989..bd824cf98bd 100644 --- a/service/securityhub/api_op_ListEnabledProductsForImport.go +++ b/service/securityhub/api_op_ListEnabledProductsForImport.go @@ -4,6 +4,7 @@ package securityhub import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -109,6 +110,83 @@ func addOperationListEnabledProductsForImportMiddlewares(stack *middleware.Stack return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListEnabledProductsForImportPaginator returns a new +// ListEnabledProductsForImportPaginator +func NewListEnabledProductsForImportPaginator(client ListEnabledProductsForImportAPIClient, params *ListEnabledProductsForImportInput, optFns ...func(*ListEnabledProductsForImportPaginatorOptions)) *ListEnabledProductsForImportPaginator { + options := ListEnabledProductsForImportPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListEnabledProductsForImportInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListEnabledProductsForImport(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/securityhub/api_op_ListInvitations.go b/service/securityhub/api_op_ListInvitations.go index 7cda97a1b72..bdc6f07c30d 100644 --- a/service/securityhub/api_op_ListInvitations.go +++ b/service/securityhub/api_op_ListInvitations.go @@ -4,6 +4,7 @@ package securityhub import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/securityhub/types" @@ -109,6 +110,81 @@ func addOperationListInvitationsMiddlewares(stack *middleware.Stack, options Opt return 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 items to return in the response. + Limit *int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListInvitationsPaginator returns a new ListInvitationsPaginator +func NewListInvitationsPaginator(client ListInvitationsAPIClient, params *ListInvitationsInput, optFns ...func(*ListInvitationsPaginatorOptions)) *ListInvitationsPaginator { + options := ListInvitationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListInvitationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListInvitations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/securityhub/api_op_ListMembers.go b/service/securityhub/api_op_ListMembers.go index 6a809d49c76..2ff529a2fee 100644 --- a/service/securityhub/api_op_ListMembers.go +++ b/service/securityhub/api_op_ListMembers.go @@ -4,6 +4,7 @@ package securityhub import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/securityhub/types" @@ -117,6 +118,80 @@ func addOperationListMembersMiddlewares(stack *middleware.Stack, options Options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListMembersPaginator returns a new ListMembersPaginator +func NewListMembersPaginator(client ListMembersAPIClient, params *ListMembersInput, optFns ...func(*ListMembersPaginatorOptions)) *ListMembersPaginator { + options := ListMembersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListMembersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListMembers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/securityhub/go.mod b/service/securityhub/go.mod index f22aa558a25..ebfcaf34464 100644 --- a/service/securityhub/go.mod +++ b/service/securityhub/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/securityhub/go.sum b/service/securityhub/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/securityhub/go.sum +++ b/service/securityhub/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 7e705baf952..00000000000 --- a/service/securityhub/paginators.go +++ /dev/null @@ -1,761 +0,0 @@ -// 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/api_op_ListApplicationDependencies.go b/service/serverlessapplicationrepository/api_op_ListApplicationDependencies.go index f7fba057178..5e29eb36f3a 100644 --- a/service/serverlessapplicationrepository/api_op_ListApplicationDependencies.go +++ b/service/serverlessapplicationrepository/api_op_ListApplicationDependencies.go @@ -4,6 +4,7 @@ package serverlessapplicationrepository import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/serverlessapplicationrepository/types" @@ -116,6 +117,83 @@ func addOperationListApplicationDependenciesMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListApplicationDependenciesPaginator returns a new +// ListApplicationDependenciesPaginator +func NewListApplicationDependenciesPaginator(client ListApplicationDependenciesAPIClient, params *ListApplicationDependenciesInput, optFns ...func(*ListApplicationDependenciesPaginatorOptions)) *ListApplicationDependenciesPaginator { + options := ListApplicationDependenciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListApplicationDependenciesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListApplicationDependencies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/serverlessapplicationrepository/api_op_ListApplicationVersions.go b/service/serverlessapplicationrepository/api_op_ListApplicationVersions.go index 980da7154ad..78ae2b59ab6 100644 --- a/service/serverlessapplicationrepository/api_op_ListApplicationVersions.go +++ b/service/serverlessapplicationrepository/api_op_ListApplicationVersions.go @@ -4,6 +4,7 @@ package serverlessapplicationrepository import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/serverlessapplicationrepository/types" @@ -113,6 +114,83 @@ func addOperationListApplicationVersionsMiddlewares(stack *middleware.Stack, opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListApplicationVersionsPaginator returns a new +// ListApplicationVersionsPaginator +func NewListApplicationVersionsPaginator(client ListApplicationVersionsAPIClient, params *ListApplicationVersionsInput, optFns ...func(*ListApplicationVersionsPaginatorOptions)) *ListApplicationVersionsPaginator { + options := ListApplicationVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListApplicationVersionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListApplicationVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/serverlessapplicationrepository/api_op_ListApplications.go b/service/serverlessapplicationrepository/api_op_ListApplications.go index dc1514ce187..15bd44c06f9 100644 --- a/service/serverlessapplicationrepository/api_op_ListApplications.go +++ b/service/serverlessapplicationrepository/api_op_ListApplications.go @@ -4,6 +4,7 @@ package serverlessapplicationrepository import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/serverlessapplicationrepository/types" @@ -105,6 +106,81 @@ func addOperationListApplicationsMiddlewares(stack *middleware.Stack, options Op return 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 total number of items to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListApplicationsPaginator returns a new ListApplicationsPaginator +func NewListApplicationsPaginator(client ListApplicationsAPIClient, params *ListApplicationsInput, optFns ...func(*ListApplicationsPaginatorOptions)) *ListApplicationsPaginator { + options := ListApplicationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListApplicationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListApplications(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/serverlessapplicationrepository/go.mod b/service/serverlessapplicationrepository/go.mod index dcea593ee01..625ca78db46 100644 --- a/service/serverlessapplicationrepository/go.mod +++ b/service/serverlessapplicationrepository/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/serverlessapplicationrepository/go.sum b/service/serverlessapplicationrepository/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/serverlessapplicationrepository/go.sum +++ b/service/serverlessapplicationrepository/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 2d0d757727f..00000000000 --- a/service/serverlessapplicationrepository/paginators.go +++ /dev/null @@ -1,237 +0,0 @@ -// 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/api_op_GetProvisionedProductOutputs.go b/service/servicecatalog/api_op_GetProvisionedProductOutputs.go index bb278e054cf..71d77ce124e 100644 --- a/service/servicecatalog/api_op_GetProvisionedProductOutputs.go +++ b/service/servicecatalog/api_op_GetProvisionedProductOutputs.go @@ -4,6 +4,7 @@ package servicecatalog import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/servicecatalog/types" @@ -130,6 +131,83 @@ func addOperationGetProvisionedProductOutputsMiddlewares(stack *middleware.Stack return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetProvisionedProductOutputsPaginator returns a new +// GetProvisionedProductOutputsPaginator +func NewGetProvisionedProductOutputsPaginator(client GetProvisionedProductOutputsAPIClient, params *GetProvisionedProductOutputsInput, optFns ...func(*GetProvisionedProductOutputsPaginatorOptions)) *GetProvisionedProductOutputsPaginator { + options := GetProvisionedProductOutputsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetProvisionedProductOutputsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetProvisionedProductOutputs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicecatalog/api_op_ListAcceptedPortfolioShares.go b/service/servicecatalog/api_op_ListAcceptedPortfolioShares.go index 889d7d32b3b..3c406fd673c 100644 --- a/service/servicecatalog/api_op_ListAcceptedPortfolioShares.go +++ b/service/servicecatalog/api_op_ListAcceptedPortfolioShares.go @@ -4,6 +4,7 @@ package servicecatalog import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/servicecatalog/types" @@ -128,6 +129,83 @@ func addOperationListAcceptedPortfolioSharesMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAcceptedPortfolioSharesPaginator returns a new +// ListAcceptedPortfolioSharesPaginator +func NewListAcceptedPortfolioSharesPaginator(client ListAcceptedPortfolioSharesAPIClient, params *ListAcceptedPortfolioSharesInput, optFns ...func(*ListAcceptedPortfolioSharesPaginatorOptions)) *ListAcceptedPortfolioSharesPaginator { + options := ListAcceptedPortfolioSharesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAcceptedPortfolioSharesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAcceptedPortfolioShares(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicecatalog/api_op_ListBudgetsForResource.go b/service/servicecatalog/api_op_ListBudgetsForResource.go index bdee1f0a392..a394bfe2908 100644 --- a/service/servicecatalog/api_op_ListBudgetsForResource.go +++ b/service/servicecatalog/api_op_ListBudgetsForResource.go @@ -4,6 +4,7 @@ package servicecatalog import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/servicecatalog/types" @@ -124,6 +125,82 @@ func addOperationListBudgetsForResourceMiddlewares(stack *middleware.Stack, opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListBudgetsForResourcePaginator returns a new ListBudgetsForResourcePaginator +func NewListBudgetsForResourcePaginator(client ListBudgetsForResourceAPIClient, params *ListBudgetsForResourceInput, optFns ...func(*ListBudgetsForResourcePaginatorOptions)) *ListBudgetsForResourcePaginator { + options := ListBudgetsForResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListBudgetsForResourceInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListBudgetsForResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicecatalog/api_op_ListConstraintsForPortfolio.go b/service/servicecatalog/api_op_ListConstraintsForPortfolio.go index 6b5b35f5071..c8d57e0a7d8 100644 --- a/service/servicecatalog/api_op_ListConstraintsForPortfolio.go +++ b/service/servicecatalog/api_op_ListConstraintsForPortfolio.go @@ -4,6 +4,7 @@ package servicecatalog import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/servicecatalog/types" @@ -127,6 +128,83 @@ func addOperationListConstraintsForPortfolioMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListConstraintsForPortfolioPaginator returns a new +// ListConstraintsForPortfolioPaginator +func NewListConstraintsForPortfolioPaginator(client ListConstraintsForPortfolioAPIClient, params *ListConstraintsForPortfolioInput, optFns ...func(*ListConstraintsForPortfolioPaginatorOptions)) *ListConstraintsForPortfolioPaginator { + options := ListConstraintsForPortfolioPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListConstraintsForPortfolioInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListConstraintsForPortfolio(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicecatalog/api_op_ListLaunchPaths.go b/service/servicecatalog/api_op_ListLaunchPaths.go index 3aa69068d64..bcdac7b1d4c 100644 --- a/service/servicecatalog/api_op_ListLaunchPaths.go +++ b/service/servicecatalog/api_op_ListLaunchPaths.go @@ -4,6 +4,7 @@ package servicecatalog import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/servicecatalog/types" @@ -126,6 +127,81 @@ func addOperationListLaunchPathsMiddlewares(stack *middleware.Stack, options Opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListLaunchPathsPaginator returns a new ListLaunchPathsPaginator +func NewListLaunchPathsPaginator(client ListLaunchPathsAPIClient, params *ListLaunchPathsInput, optFns ...func(*ListLaunchPathsPaginatorOptions)) *ListLaunchPathsPaginator { + options := ListLaunchPathsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListLaunchPathsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListLaunchPaths(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicecatalog/api_op_ListOrganizationPortfolioAccess.go b/service/servicecatalog/api_op_ListOrganizationPortfolioAccess.go index c884da0c4c3..b505b3580a9 100644 --- a/service/servicecatalog/api_op_ListOrganizationPortfolioAccess.go +++ b/service/servicecatalog/api_op_ListOrganizationPortfolioAccess.go @@ -4,6 +4,7 @@ package servicecatalog import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/servicecatalog/types" @@ -142,6 +143,83 @@ func addOperationListOrganizationPortfolioAccessMiddlewares(stack *middleware.St return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListOrganizationPortfolioAccessPaginator returns a new +// ListOrganizationPortfolioAccessPaginator +func NewListOrganizationPortfolioAccessPaginator(client ListOrganizationPortfolioAccessAPIClient, params *ListOrganizationPortfolioAccessInput, optFns ...func(*ListOrganizationPortfolioAccessPaginatorOptions)) *ListOrganizationPortfolioAccessPaginator { + options := ListOrganizationPortfolioAccessPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListOrganizationPortfolioAccessInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListOrganizationPortfolioAccess(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicecatalog/api_op_ListPortfolioAccess.go b/service/servicecatalog/api_op_ListPortfolioAccess.go index de2b23e703d..be80d005f13 100644 --- a/service/servicecatalog/api_op_ListPortfolioAccess.go +++ b/service/servicecatalog/api_op_ListPortfolioAccess.go @@ -4,6 +4,7 @@ package servicecatalog import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -130,6 +131,82 @@ func addOperationListPortfolioAccessMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListPortfolioAccessPaginator returns a new ListPortfolioAccessPaginator +func NewListPortfolioAccessPaginator(client ListPortfolioAccessAPIClient, params *ListPortfolioAccessInput, optFns ...func(*ListPortfolioAccessPaginatorOptions)) *ListPortfolioAccessPaginator { + options := ListPortfolioAccessPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPortfolioAccessInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPortfolioAccess(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicecatalog/api_op_ListPortfolios.go b/service/servicecatalog/api_op_ListPortfolios.go index 8bb14f62a76..ccd8c1ba746 100644 --- a/service/servicecatalog/api_op_ListPortfolios.go +++ b/service/servicecatalog/api_op_ListPortfolios.go @@ -4,6 +4,7 @@ package servicecatalog import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/servicecatalog/types" @@ -116,6 +117,81 @@ func addOperationListPortfoliosMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListPortfoliosPaginator returns a new ListPortfoliosPaginator +func NewListPortfoliosPaginator(client ListPortfoliosAPIClient, params *ListPortfoliosInput, optFns ...func(*ListPortfoliosPaginatorOptions)) *ListPortfoliosPaginator { + options := ListPortfoliosPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPortfoliosInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPortfolios(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicecatalog/api_op_ListPortfoliosForProduct.go b/service/servicecatalog/api_op_ListPortfoliosForProduct.go index c26378cecdb..881aa06184d 100644 --- a/service/servicecatalog/api_op_ListPortfoliosForProduct.go +++ b/service/servicecatalog/api_op_ListPortfoliosForProduct.go @@ -4,6 +4,7 @@ package servicecatalog import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/servicecatalog/types" @@ -124,6 +125,83 @@ func addOperationListPortfoliosForProductMiddlewares(stack *middleware.Stack, op return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListPortfoliosForProductPaginator returns a new +// ListPortfoliosForProductPaginator +func NewListPortfoliosForProductPaginator(client ListPortfoliosForProductAPIClient, params *ListPortfoliosForProductInput, optFns ...func(*ListPortfoliosForProductPaginatorOptions)) *ListPortfoliosForProductPaginator { + options := ListPortfoliosForProductPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPortfoliosForProductInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPortfoliosForProduct(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicecatalog/api_op_ListPrincipalsForPortfolio.go b/service/servicecatalog/api_op_ListPrincipalsForPortfolio.go index 208732a5455..50f41f3db84 100644 --- a/service/servicecatalog/api_op_ListPrincipalsForPortfolio.go +++ b/service/servicecatalog/api_op_ListPrincipalsForPortfolio.go @@ -4,6 +4,7 @@ package servicecatalog import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/servicecatalog/types" @@ -124,6 +125,83 @@ func addOperationListPrincipalsForPortfolioMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListPrincipalsForPortfolioPaginator returns a new +// ListPrincipalsForPortfolioPaginator +func NewListPrincipalsForPortfolioPaginator(client ListPrincipalsForPortfolioAPIClient, params *ListPrincipalsForPortfolioInput, optFns ...func(*ListPrincipalsForPortfolioPaginatorOptions)) *ListPrincipalsForPortfolioPaginator { + options := ListPrincipalsForPortfolioPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPrincipalsForPortfolioInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPrincipalsForPortfolio(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicecatalog/api_op_ListProvisioningArtifactsForServiceAction.go b/service/servicecatalog/api_op_ListProvisioningArtifactsForServiceAction.go index 3de06c9ddb3..eafa1929ae9 100644 --- a/service/servicecatalog/api_op_ListProvisioningArtifactsForServiceAction.go +++ b/service/servicecatalog/api_op_ListProvisioningArtifactsForServiceAction.go @@ -4,6 +4,7 @@ package servicecatalog import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/servicecatalog/types" @@ -126,6 +127,83 @@ func addOperationListProvisioningArtifactsForServiceActionMiddlewares(stack *mid return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListProvisioningArtifactsForServiceActionPaginator returns a new +// ListProvisioningArtifactsForServiceActionPaginator +func NewListProvisioningArtifactsForServiceActionPaginator(client ListProvisioningArtifactsForServiceActionAPIClient, params *ListProvisioningArtifactsForServiceActionInput, optFns ...func(*ListProvisioningArtifactsForServiceActionPaginatorOptions)) *ListProvisioningArtifactsForServiceActionPaginator { + options := ListProvisioningArtifactsForServiceActionPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListProvisioningArtifactsForServiceActionInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListProvisioningArtifactsForServiceAction(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicecatalog/api_op_ListResourcesForTagOption.go b/service/servicecatalog/api_op_ListResourcesForTagOption.go index 34407549f42..3acdd0e1efa 100644 --- a/service/servicecatalog/api_op_ListResourcesForTagOption.go +++ b/service/servicecatalog/api_op_ListResourcesForTagOption.go @@ -4,6 +4,7 @@ package servicecatalog import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/servicecatalog/types" @@ -122,6 +123,83 @@ func addOperationListResourcesForTagOptionMiddlewares(stack *middleware.Stack, o return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListResourcesForTagOptionPaginator returns a new +// ListResourcesForTagOptionPaginator +func NewListResourcesForTagOptionPaginator(client ListResourcesForTagOptionAPIClient, params *ListResourcesForTagOptionInput, optFns ...func(*ListResourcesForTagOptionPaginatorOptions)) *ListResourcesForTagOptionPaginator { + options := ListResourcesForTagOptionPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListResourcesForTagOptionInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.PageToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListResourcesForTagOption(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicecatalog/api_op_ListServiceActions.go b/service/servicecatalog/api_op_ListServiceActions.go index 960af1c174c..8a0b8fdd3f7 100644 --- a/service/servicecatalog/api_op_ListServiceActions.go +++ b/service/servicecatalog/api_op_ListServiceActions.go @@ -4,6 +4,7 @@ package servicecatalog import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/servicecatalog/types" @@ -117,6 +118,82 @@ func addOperationListServiceActionsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListServiceActionsPaginator returns a new ListServiceActionsPaginator +func NewListServiceActionsPaginator(client ListServiceActionsAPIClient, params *ListServiceActionsInput, optFns ...func(*ListServiceActionsPaginatorOptions)) *ListServiceActionsPaginator { + options := ListServiceActionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListServiceActionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListServiceActions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicecatalog/api_op_ListServiceActionsForProvisioningArtifact.go b/service/servicecatalog/api_op_ListServiceActionsForProvisioningArtifact.go index a4f597ee881..c47d79cab17 100644 --- a/service/servicecatalog/api_op_ListServiceActionsForProvisioningArtifact.go +++ b/service/servicecatalog/api_op_ListServiceActionsForProvisioningArtifact.go @@ -4,6 +4,7 @@ package servicecatalog import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/servicecatalog/types" @@ -131,6 +132,83 @@ func addOperationListServiceActionsForProvisioningArtifactMiddlewares(stack *mid return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListServiceActionsForProvisioningArtifactPaginator returns a new +// ListServiceActionsForProvisioningArtifactPaginator +func NewListServiceActionsForProvisioningArtifactPaginator(client ListServiceActionsForProvisioningArtifactAPIClient, params *ListServiceActionsForProvisioningArtifactInput, optFns ...func(*ListServiceActionsForProvisioningArtifactPaginatorOptions)) *ListServiceActionsForProvisioningArtifactPaginator { + options := ListServiceActionsForProvisioningArtifactPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListServiceActionsForProvisioningArtifactInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListServiceActionsForProvisioningArtifact(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicecatalog/api_op_ListTagOptions.go b/service/servicecatalog/api_op_ListTagOptions.go index faa794eb204..370c670a573 100644 --- a/service/servicecatalog/api_op_ListTagOptions.go +++ b/service/servicecatalog/api_op_ListTagOptions.go @@ -4,6 +4,7 @@ package servicecatalog import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/servicecatalog/types" @@ -111,6 +112,81 @@ func addOperationListTagOptionsMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTagOptionsPaginator returns a new ListTagOptionsPaginator +func NewListTagOptionsPaginator(client ListTagOptionsAPIClient, params *ListTagOptionsInput, optFns ...func(*ListTagOptionsPaginatorOptions)) *ListTagOptionsPaginator { + options := ListTagOptionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTagOptionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.PageToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTagOptions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicecatalog/api_op_SearchProducts.go b/service/servicecatalog/api_op_SearchProducts.go index 697d35c0df5..6b17779cac1 100644 --- a/service/servicecatalog/api_op_SearchProducts.go +++ b/service/servicecatalog/api_op_SearchProducts.go @@ -4,6 +4,7 @@ package servicecatalog import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/servicecatalog/types" @@ -129,6 +130,81 @@ func addOperationSearchProductsMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewSearchProductsPaginator returns a new SearchProductsPaginator +func NewSearchProductsPaginator(client SearchProductsAPIClient, params *SearchProductsInput, optFns ...func(*SearchProductsPaginatorOptions)) *SearchProductsPaginator { + options := SearchProductsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchProductsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearchProducts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicecatalog/api_op_SearchProductsAsAdmin.go b/service/servicecatalog/api_op_SearchProductsAsAdmin.go index 333a5c10a25..0f939edd0c8 100644 --- a/service/servicecatalog/api_op_SearchProductsAsAdmin.go +++ b/service/servicecatalog/api_op_SearchProductsAsAdmin.go @@ -4,6 +4,7 @@ package servicecatalog import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/servicecatalog/types" @@ -132,6 +133,82 @@ func addOperationSearchProductsAsAdminMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewSearchProductsAsAdminPaginator returns a new SearchProductsAsAdminPaginator +func NewSearchProductsAsAdminPaginator(client SearchProductsAsAdminAPIClient, params *SearchProductsAsAdminInput, optFns ...func(*SearchProductsAsAdminPaginatorOptions)) *SearchProductsAsAdminPaginator { + options := SearchProductsAsAdminPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchProductsAsAdminInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearchProductsAsAdmin(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicecatalog/api_op_SearchProvisionedProducts.go b/service/servicecatalog/api_op_SearchProvisionedProducts.go index 7fc867707ec..01fdec54a6c 100644 --- a/service/servicecatalog/api_op_SearchProvisionedProducts.go +++ b/service/servicecatalog/api_op_SearchProvisionedProducts.go @@ -4,6 +4,7 @@ package servicecatalog import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/servicecatalog/types" @@ -137,6 +138,83 @@ func addOperationSearchProvisionedProductsMiddlewares(stack *middleware.Stack, o return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewSearchProvisionedProductsPaginator returns a new +// SearchProvisionedProductsPaginator +func NewSearchProvisionedProductsPaginator(client SearchProvisionedProductsAPIClient, params *SearchProvisionedProductsInput, optFns ...func(*SearchProvisionedProductsPaginatorOptions)) *SearchProvisionedProductsPaginator { + options := SearchProvisionedProductsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchProvisionedProductsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearchProvisionedProducts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicecatalog/go.mod b/service/servicecatalog/go.mod index 7a67e3aadb1..ed07c06ace7 100644 --- a/service/servicecatalog/go.mod +++ b/service/servicecatalog/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/servicecatalog/go.sum b/service/servicecatalog/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/servicecatalog/go.sum +++ b/service/servicecatalog/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index cbef60caa1f..00000000000 --- a/service/servicecatalog/paginators.go +++ /dev/null @@ -1,1382 +0,0 @@ -// 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/api_op_DiscoverInstances.go b/service/servicediscovery/api_op_DiscoverInstances.go index 11bfb04b08b..e08482c796d 100644 --- a/service/servicediscovery/api_op_DiscoverInstances.go +++ b/service/servicediscovery/api_op_DiscoverInstances.go @@ -147,7 +147,7 @@ func (*endpointPrefix_opDiscoverInstancesMiddleware) ID() string { func (m *endpointPrefix_opDiscoverInstancesMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { - if smithyhttp.GetHostnameImmutable(ctx) { + if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } @@ -156,12 +156,12 @@ func (m *endpointPrefix_opDiscoverInstancesMiddleware) HandleSerialize(ctx conte return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.HostPrefix = "data-" + req.URL.Host = "data-" + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opDiscoverInstancesMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opDiscoverInstancesMiddleware{}, `OperationSerializer`, middleware.Before) + return stack.Serialize.Insert(&endpointPrefix_opDiscoverInstancesMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opDiscoverInstances(region string) *awsmiddleware.RegisterServiceMetadata { diff --git a/service/servicediscovery/api_op_GetInstancesHealthStatus.go b/service/servicediscovery/api_op_GetInstancesHealthStatus.go index 348322e8da4..62299cda3de 100644 --- a/service/servicediscovery/api_op_GetInstancesHealthStatus.go +++ b/service/servicediscovery/api_op_GetInstancesHealthStatus.go @@ -4,6 +4,7 @@ package servicediscovery import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/servicediscovery/types" @@ -133,6 +134,85 @@ func addOperationGetInstancesHealthStatusMiddlewares(stack *middleware.Stack, op return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetInstancesHealthStatusPaginator returns a new +// GetInstancesHealthStatusPaginator +func NewGetInstancesHealthStatusPaginator(client GetInstancesHealthStatusAPIClient, params *GetInstancesHealthStatusInput, optFns ...func(*GetInstancesHealthStatusPaginatorOptions)) *GetInstancesHealthStatusPaginator { + options := GetInstancesHealthStatusPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetInstancesHealthStatusInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetInstancesHealthStatus(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicediscovery/api_op_ListInstances.go b/service/servicediscovery/api_op_ListInstances.go index 374793b057e..6c73b0433d6 100644 --- a/service/servicediscovery/api_op_ListInstances.go +++ b/service/servicediscovery/api_op_ListInstances.go @@ -4,6 +4,7 @@ package servicediscovery import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/servicediscovery/types" @@ -122,6 +123,82 @@ func addOperationListInstancesMiddlewares(stack *middleware.Stack, options Optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListInstancesPaginator returns a new ListInstancesPaginator +func NewListInstancesPaginator(client ListInstancesAPIClient, params *ListInstancesInput, optFns ...func(*ListInstancesPaginatorOptions)) *ListInstancesPaginator { + options := ListInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListInstancesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListInstances(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicediscovery/api_op_ListNamespaces.go b/service/servicediscovery/api_op_ListNamespaces.go index ac5f363b561..3ac91b95251 100644 --- a/service/servicediscovery/api_op_ListNamespaces.go +++ b/service/servicediscovery/api_op_ListNamespaces.go @@ -4,6 +4,7 @@ package servicediscovery import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/servicediscovery/types" @@ -129,6 +130,83 @@ func addOperationListNamespacesMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListNamespacesPaginator returns a new ListNamespacesPaginator +func NewListNamespacesPaginator(client ListNamespacesAPIClient, params *ListNamespacesInput, optFns ...func(*ListNamespacesPaginatorOptions)) *ListNamespacesPaginator { + options := ListNamespacesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListNamespacesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListNamespaces(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicediscovery/api_op_ListOperations.go b/service/servicediscovery/api_op_ListOperations.go index 4c5fe95df79..f22928947a6 100644 --- a/service/servicediscovery/api_op_ListOperations.go +++ b/service/servicediscovery/api_op_ListOperations.go @@ -4,6 +4,7 @@ package servicediscovery import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/servicediscovery/types" @@ -128,6 +129,83 @@ func addOperationListOperationsMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListOperationsPaginator returns a new ListOperationsPaginator +func NewListOperationsPaginator(client ListOperationsAPIClient, params *ListOperationsInput, optFns ...func(*ListOperationsPaginatorOptions)) *ListOperationsPaginator { + options := ListOperationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListOperationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListOperations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicediscovery/api_op_ListServices.go b/service/servicediscovery/api_op_ListServices.go index 606eb95b8f9..716b83cbbbf 100644 --- a/service/servicediscovery/api_op_ListServices.go +++ b/service/servicediscovery/api_op_ListServices.go @@ -4,6 +4,7 @@ package servicediscovery import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/servicediscovery/types" @@ -128,6 +129,82 @@ func addOperationListServicesMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListServicesPaginator returns a new ListServicesPaginator +func NewListServicesPaginator(client ListServicesAPIClient, params *ListServicesInput, optFns ...func(*ListServicesPaginatorOptions)) *ListServicesPaginator { + options := ListServicesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListServicesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListServices(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicediscovery/go.mod b/service/servicediscovery/go.mod index d2689176787..eb79b553dab 100644 --- a/service/servicediscovery/go.mod +++ b/service/servicediscovery/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/servicediscovery/go.sum b/service/servicediscovery/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/servicediscovery/go.sum +++ b/service/servicediscovery/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index fcf7c24722c..00000000000 --- a/service/servicediscovery/paginators.go +++ /dev/null @@ -1,393 +0,0 @@ -// 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/api_op_ListAWSDefaultServiceQuotas.go b/service/servicequotas/api_op_ListAWSDefaultServiceQuotas.go index 428aac64842..e74c6f5c43b 100644 --- a/service/servicequotas/api_op_ListAWSDefaultServiceQuotas.go +++ b/service/servicequotas/api_op_ListAWSDefaultServiceQuotas.go @@ -4,6 +4,7 @@ package servicequotas import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/servicequotas/types" @@ -139,6 +140,89 @@ func addOperationListAWSDefaultServiceQuotasMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAWSDefaultServiceQuotasPaginator returns a new +// ListAWSDefaultServiceQuotasPaginator +func NewListAWSDefaultServiceQuotasPaginator(client ListAWSDefaultServiceQuotasAPIClient, params *ListAWSDefaultServiceQuotasInput, optFns ...func(*ListAWSDefaultServiceQuotasPaginatorOptions)) *ListAWSDefaultServiceQuotasPaginator { + options := ListAWSDefaultServiceQuotasPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAWSDefaultServiceQuotasInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAWSDefaultServiceQuotas(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicequotas/api_op_ListRequestedServiceQuotaChangeHistory.go b/service/servicequotas/api_op_ListRequestedServiceQuotaChangeHistory.go index 0f937c9f31c..3ff8e187303 100644 --- a/service/servicequotas/api_op_ListRequestedServiceQuotaChangeHistory.go +++ b/service/servicequotas/api_op_ListRequestedServiceQuotaChangeHistory.go @@ -4,6 +4,7 @@ package servicequotas import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/servicequotas/types" @@ -126,6 +127,89 @@ func addOperationListRequestedServiceQuotaChangeHistoryMiddlewares(stack *middle return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListRequestedServiceQuotaChangeHistoryPaginator returns a new +// ListRequestedServiceQuotaChangeHistoryPaginator +func NewListRequestedServiceQuotaChangeHistoryPaginator(client ListRequestedServiceQuotaChangeHistoryAPIClient, params *ListRequestedServiceQuotaChangeHistoryInput, optFns ...func(*ListRequestedServiceQuotaChangeHistoryPaginatorOptions)) *ListRequestedServiceQuotaChangeHistoryPaginator { + options := ListRequestedServiceQuotaChangeHistoryPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRequestedServiceQuotaChangeHistoryInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRequestedServiceQuotaChangeHistory(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicequotas/api_op_ListRequestedServiceQuotaChangeHistoryByQuota.go b/service/servicequotas/api_op_ListRequestedServiceQuotaChangeHistoryByQuota.go index 73a302251ad..9bce9cc0731 100644 --- a/service/servicequotas/api_op_ListRequestedServiceQuotaChangeHistoryByQuota.go +++ b/service/servicequotas/api_op_ListRequestedServiceQuotaChangeHistoryByQuota.go @@ -4,6 +4,7 @@ package servicequotas import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/servicequotas/types" @@ -139,6 +140,89 @@ func addOperationListRequestedServiceQuotaChangeHistoryByQuotaMiddlewares(stack return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListRequestedServiceQuotaChangeHistoryByQuotaPaginator returns a new +// ListRequestedServiceQuotaChangeHistoryByQuotaPaginator +func NewListRequestedServiceQuotaChangeHistoryByQuotaPaginator(client ListRequestedServiceQuotaChangeHistoryByQuotaAPIClient, params *ListRequestedServiceQuotaChangeHistoryByQuotaInput, optFns ...func(*ListRequestedServiceQuotaChangeHistoryByQuotaPaginatorOptions)) *ListRequestedServiceQuotaChangeHistoryByQuotaPaginator { + options := ListRequestedServiceQuotaChangeHistoryByQuotaPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRequestedServiceQuotaChangeHistoryByQuotaInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRequestedServiceQuotaChangeHistoryByQuota(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicequotas/api_op_ListServiceQuotaIncreaseRequestsInTemplate.go b/service/servicequotas/api_op_ListServiceQuotaIncreaseRequestsInTemplate.go index 8b16de5b23d..0b4b829c646 100644 --- a/service/servicequotas/api_op_ListServiceQuotaIncreaseRequestsInTemplate.go +++ b/service/servicequotas/api_op_ListServiceQuotaIncreaseRequestsInTemplate.go @@ -4,6 +4,7 @@ package servicequotas import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/servicequotas/types" @@ -127,6 +128,89 @@ func addOperationListServiceQuotaIncreaseRequestsInTemplateMiddlewares(stack *mi return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListServiceQuotaIncreaseRequestsInTemplatePaginator returns a new +// ListServiceQuotaIncreaseRequestsInTemplatePaginator +func NewListServiceQuotaIncreaseRequestsInTemplatePaginator(client ListServiceQuotaIncreaseRequestsInTemplateAPIClient, params *ListServiceQuotaIncreaseRequestsInTemplateInput, optFns ...func(*ListServiceQuotaIncreaseRequestsInTemplatePaginatorOptions)) *ListServiceQuotaIncreaseRequestsInTemplatePaginator { + options := ListServiceQuotaIncreaseRequestsInTemplatePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListServiceQuotaIncreaseRequestsInTemplateInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListServiceQuotaIncreaseRequestsInTemplate(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicequotas/api_op_ListServiceQuotas.go b/service/servicequotas/api_op_ListServiceQuotas.go index c57c234eda7..7c9c8f586e0 100644 --- a/service/servicequotas/api_op_ListServiceQuotas.go +++ b/service/servicequotas/api_op_ListServiceQuotas.go @@ -4,6 +4,7 @@ package servicequotas import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/servicequotas/types" @@ -137,6 +138,87 @@ func addOperationListServiceQuotasMiddlewares(stack *middleware.Stack, options O return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListServiceQuotasPaginator returns a new ListServiceQuotasPaginator +func NewListServiceQuotasPaginator(client ListServiceQuotasAPIClient, params *ListServiceQuotasInput, optFns ...func(*ListServiceQuotasPaginatorOptions)) *ListServiceQuotasPaginator { + options := ListServiceQuotasPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListServiceQuotasInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListServiceQuotas(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicequotas/api_op_ListServices.go b/service/servicequotas/api_op_ListServices.go index b4dc1de1ac9..d098a596633 100644 --- a/service/servicequotas/api_op_ListServices.go +++ b/service/servicequotas/api_op_ListServices.go @@ -4,6 +4,7 @@ package servicequotas import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/servicequotas/types" @@ -122,6 +123,86 @@ func addOperationListServicesMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListServicesPaginator returns a new ListServicesPaginator +func NewListServicesPaginator(client ListServicesAPIClient, params *ListServicesInput, optFns ...func(*ListServicesPaginatorOptions)) *ListServicesPaginator { + options := ListServicesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListServicesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListServices(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicequotas/go.mod b/service/servicequotas/go.mod index 5f0f988ed0a..ab455883bb8 100644 --- a/service/servicequotas/go.mod +++ b/service/servicequotas/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/servicequotas/go.sum b/service/servicequotas/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/servicequotas/go.sum +++ b/service/servicequotas/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 9baf7128db0..00000000000 --- a/service/servicequotas/paginators.go +++ /dev/null @@ -1,501 +0,0 @@ -// 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/api_op_ListCustomVerificationEmailTemplates.go b/service/ses/api_op_ListCustomVerificationEmailTemplates.go index f080afd28ef..da42dbdbf80 100644 --- a/service/ses/api_op_ListCustomVerificationEmailTemplates.go +++ b/service/ses/api_op_ListCustomVerificationEmailTemplates.go @@ -4,6 +4,7 @@ package ses import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ses/types" @@ -122,6 +123,86 @@ func addOperationListCustomVerificationEmailTemplatesMiddlewares(stack *middlewa return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListCustomVerificationEmailTemplatesPaginator returns a new +// ListCustomVerificationEmailTemplatesPaginator +func NewListCustomVerificationEmailTemplatesPaginator(client ListCustomVerificationEmailTemplatesAPIClient, params *ListCustomVerificationEmailTemplatesInput, optFns ...func(*ListCustomVerificationEmailTemplatesPaginatorOptions)) *ListCustomVerificationEmailTemplatesPaginator { + options := ListCustomVerificationEmailTemplatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListCustomVerificationEmailTemplatesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListCustomVerificationEmailTemplates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ses/api_op_ListIdentities.go b/service/ses/api_op_ListIdentities.go index 39e6377b242..5898a3102f0 100644 --- a/service/ses/api_op_ListIdentities.go +++ b/service/ses/api_op_ListIdentities.go @@ -4,6 +4,7 @@ package ses import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ses/types" @@ -118,6 +119,81 @@ func addOperationListIdentitiesMiddlewares(stack *middleware.Stack, options Opti return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListIdentitiesPaginator returns a new ListIdentitiesPaginator +func NewListIdentitiesPaginator(client ListIdentitiesAPIClient, params *ListIdentitiesInput, optFns ...func(*ListIdentitiesPaginatorOptions)) *ListIdentitiesPaginator { + options := ListIdentitiesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListIdentitiesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListIdentities(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ses/go.mod b/service/ses/go.mod index 33d7b2f38b2..499b7ebccd7 100644 --- a/service/ses/go.mod +++ b/service/ses/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/ses/go.sum b/service/ses/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/ses/go.sum +++ b/service/ses/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index cb84e61a320..00000000000 --- a/service/ses/paginators.go +++ /dev/null @@ -1,163 +0,0 @@ -// 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/api_op_GetDedicatedIps.go b/service/sesv2/api_op_GetDedicatedIps.go index b8edf08946e..b7362772752 100644 --- a/service/sesv2/api_op_GetDedicatedIps.go +++ b/service/sesv2/api_op_GetDedicatedIps.go @@ -4,6 +4,7 @@ package sesv2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sesv2/types" @@ -117,6 +118,84 @@ func addOperationGetDedicatedIpsMiddlewares(stack *middleware.Stack, options Opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetDedicatedIpsPaginator returns a new GetDedicatedIpsPaginator +func NewGetDedicatedIpsPaginator(client GetDedicatedIpsAPIClient, params *GetDedicatedIpsInput, optFns ...func(*GetDedicatedIpsPaginatorOptions)) *GetDedicatedIpsPaginator { + options := GetDedicatedIpsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetDedicatedIpsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetDedicatedIps(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sesv2/api_op_ListConfigurationSets.go b/service/sesv2/api_op_ListConfigurationSets.go index 56f9a46ec0c..e0bf1929c51 100644 --- a/service/sesv2/api_op_ListConfigurationSets.go +++ b/service/sesv2/api_op_ListConfigurationSets.go @@ -4,6 +4,7 @@ package sesv2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -120,6 +121,85 @@ func addOperationListConfigurationSetsMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListConfigurationSetsPaginator returns a new ListConfigurationSetsPaginator +func NewListConfigurationSetsPaginator(client ListConfigurationSetsAPIClient, params *ListConfigurationSetsInput, optFns ...func(*ListConfigurationSetsPaginatorOptions)) *ListConfigurationSetsPaginator { + options := ListConfigurationSetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListConfigurationSetsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListConfigurationSets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sesv2/api_op_ListContactLists.go b/service/sesv2/api_op_ListContactLists.go index 71793cfb66f..98643567d19 100644 --- a/service/sesv2/api_op_ListContactLists.go +++ b/service/sesv2/api_op_ListContactLists.go @@ -4,6 +4,7 @@ package sesv2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sesv2/types" @@ -113,6 +114,84 @@ func addOperationListContactListsMiddlewares(stack *middleware.Stack, options Op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListContactListsPaginator returns a new ListContactListsPaginator +func NewListContactListsPaginator(client ListContactListsAPIClient, params *ListContactListsInput, optFns ...func(*ListContactListsPaginatorOptions)) *ListContactListsPaginator { + options := ListContactListsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListContactListsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListContactLists(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sesv2/api_op_ListContacts.go b/service/sesv2/api_op_ListContacts.go index c8c05745802..d7951be3c5f 100644 --- a/service/sesv2/api_op_ListContacts.go +++ b/service/sesv2/api_op_ListContacts.go @@ -4,6 +4,7 @@ package sesv2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sesv2/types" @@ -124,6 +125,84 @@ func addOperationListContactsMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListContactsPaginator returns a new ListContactsPaginator +func NewListContactsPaginator(client ListContactsAPIClient, params *ListContactsInput, optFns ...func(*ListContactsPaginatorOptions)) *ListContactsPaginator { + options := ListContactsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListContactsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListContacts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sesv2/api_op_ListCustomVerificationEmailTemplates.go b/service/sesv2/api_op_ListCustomVerificationEmailTemplates.go index d09f6847a35..6ead4524f29 100644 --- a/service/sesv2/api_op_ListCustomVerificationEmailTemplates.go +++ b/service/sesv2/api_op_ListCustomVerificationEmailTemplates.go @@ -4,6 +4,7 @@ package sesv2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sesv2/types" @@ -121,6 +122,87 @@ func addOperationListCustomVerificationEmailTemplatesMiddlewares(stack *middlewa return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListCustomVerificationEmailTemplatesPaginator returns a new +// ListCustomVerificationEmailTemplatesPaginator +func NewListCustomVerificationEmailTemplatesPaginator(client ListCustomVerificationEmailTemplatesAPIClient, params *ListCustomVerificationEmailTemplatesInput, optFns ...func(*ListCustomVerificationEmailTemplatesPaginatorOptions)) *ListCustomVerificationEmailTemplatesPaginator { + options := ListCustomVerificationEmailTemplatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListCustomVerificationEmailTemplatesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListCustomVerificationEmailTemplates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sesv2/api_op_ListDedicatedIpPools.go b/service/sesv2/api_op_ListDedicatedIpPools.go index 131e84eec3b..677bc979ff6 100644 --- a/service/sesv2/api_op_ListDedicatedIpPools.go +++ b/service/sesv2/api_op_ListDedicatedIpPools.go @@ -4,6 +4,7 @@ package sesv2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -114,6 +115,85 @@ func addOperationListDedicatedIpPoolsMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDedicatedIpPoolsPaginator returns a new ListDedicatedIpPoolsPaginator +func NewListDedicatedIpPoolsPaginator(client ListDedicatedIpPoolsAPIClient, params *ListDedicatedIpPoolsInput, optFns ...func(*ListDedicatedIpPoolsPaginatorOptions)) *ListDedicatedIpPoolsPaginator { + options := ListDedicatedIpPoolsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDedicatedIpPoolsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDedicatedIpPools(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sesv2/api_op_ListDeliverabilityTestReports.go b/service/sesv2/api_op_ListDeliverabilityTestReports.go index 700b92d7b40..dbf86a95c6c 100644 --- a/service/sesv2/api_op_ListDeliverabilityTestReports.go +++ b/service/sesv2/api_op_ListDeliverabilityTestReports.go @@ -4,6 +4,7 @@ package sesv2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sesv2/types" @@ -123,6 +124,87 @@ func addOperationListDeliverabilityTestReportsMiddlewares(stack *middleware.Stac return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDeliverabilityTestReportsPaginator returns a new +// ListDeliverabilityTestReportsPaginator +func NewListDeliverabilityTestReportsPaginator(client ListDeliverabilityTestReportsAPIClient, params *ListDeliverabilityTestReportsInput, optFns ...func(*ListDeliverabilityTestReportsPaginatorOptions)) *ListDeliverabilityTestReportsPaginator { + options := ListDeliverabilityTestReportsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDeliverabilityTestReportsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDeliverabilityTestReports(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sesv2/api_op_ListDomainDeliverabilityCampaigns.go b/service/sesv2/api_op_ListDomainDeliverabilityCampaigns.go index 2e4cd2280f6..52c7112c613 100644 --- a/service/sesv2/api_op_ListDomainDeliverabilityCampaigns.go +++ b/service/sesv2/api_op_ListDomainDeliverabilityCampaigns.go @@ -4,6 +4,7 @@ package sesv2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sesv2/types" @@ -146,6 +147,86 @@ func addOperationListDomainDeliverabilityCampaignsMiddlewares(stack *middleware. return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDomainDeliverabilityCampaignsPaginator returns a new +// ListDomainDeliverabilityCampaignsPaginator +func NewListDomainDeliverabilityCampaignsPaginator(client ListDomainDeliverabilityCampaignsAPIClient, params *ListDomainDeliverabilityCampaignsInput, optFns ...func(*ListDomainDeliverabilityCampaignsPaginatorOptions)) *ListDomainDeliverabilityCampaignsPaginator { + options := ListDomainDeliverabilityCampaignsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDomainDeliverabilityCampaignsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDomainDeliverabilityCampaigns(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sesv2/api_op_ListEmailIdentities.go b/service/sesv2/api_op_ListEmailIdentities.go index b69e38f582b..e3b40c97151 100644 --- a/service/sesv2/api_op_ListEmailIdentities.go +++ b/service/sesv2/api_op_ListEmailIdentities.go @@ -4,6 +4,7 @@ package sesv2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sesv2/types" @@ -123,6 +124,86 @@ func addOperationListEmailIdentitiesMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListEmailIdentitiesPaginator returns a new ListEmailIdentitiesPaginator +func NewListEmailIdentitiesPaginator(client ListEmailIdentitiesAPIClient, params *ListEmailIdentitiesInput, optFns ...func(*ListEmailIdentitiesPaginatorOptions)) *ListEmailIdentitiesPaginator { + options := ListEmailIdentitiesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListEmailIdentitiesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListEmailIdentities(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sesv2/api_op_ListEmailTemplates.go b/service/sesv2/api_op_ListEmailTemplates.go index b14663af187..0d99e38bf33 100644 --- a/service/sesv2/api_op_ListEmailTemplates.go +++ b/service/sesv2/api_op_ListEmailTemplates.go @@ -4,6 +4,7 @@ package sesv2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sesv2/types" @@ -119,6 +120,86 @@ func addOperationListEmailTemplatesMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListEmailTemplatesPaginator returns a new ListEmailTemplatesPaginator +func NewListEmailTemplatesPaginator(client ListEmailTemplatesAPIClient, params *ListEmailTemplatesInput, optFns ...func(*ListEmailTemplatesPaginatorOptions)) *ListEmailTemplatesPaginator { + options := ListEmailTemplatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListEmailTemplatesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListEmailTemplates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sesv2/api_op_ListImportJobs.go b/service/sesv2/api_op_ListImportJobs.go index 4dccbf80c15..3fc4bf4b7d0 100644 --- a/service/sesv2/api_op_ListImportJobs.go +++ b/service/sesv2/api_op_ListImportJobs.go @@ -4,6 +4,7 @@ package sesv2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sesv2/types" @@ -120,6 +121,84 @@ func addOperationListImportJobsMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListImportJobsPaginator returns a new ListImportJobsPaginator +func NewListImportJobsPaginator(client ListImportJobsAPIClient, params *ListImportJobsInput, optFns ...func(*ListImportJobsPaginatorOptions)) *ListImportJobsPaginator { + options := ListImportJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListImportJobsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListImportJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sesv2/api_op_ListSuppressedDestinations.go b/service/sesv2/api_op_ListSuppressedDestinations.go index 9c4173d08c5..5565dc620f3 100644 --- a/service/sesv2/api_op_ListSuppressedDestinations.go +++ b/service/sesv2/api_op_ListSuppressedDestinations.go @@ -4,6 +4,7 @@ package sesv2 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sesv2/types" @@ -131,6 +132,86 @@ func addOperationListSuppressedDestinationsMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListSuppressedDestinationsPaginator returns a new +// ListSuppressedDestinationsPaginator +func NewListSuppressedDestinationsPaginator(client ListSuppressedDestinationsAPIClient, params *ListSuppressedDestinationsInput, optFns ...func(*ListSuppressedDestinationsPaginatorOptions)) *ListSuppressedDestinationsPaginator { + options := ListSuppressedDestinationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSuppressedDestinationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSuppressedDestinations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sesv2/go.mod b/service/sesv2/go.mod index 28f0c2d7a24..330df28dc95 100644 --- a/service/sesv2/go.mod +++ b/service/sesv2/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/sesv2/go.sum b/service/sesv2/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/sesv2/go.sum +++ b/service/sesv2/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 0c548ef4b86..00000000000 --- a/service/sesv2/paginators.go +++ /dev/null @@ -1,960 +0,0 @@ -// 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/api_op_GetExecutionHistory.go b/service/sfn/api_op_GetExecutionHistory.go index 1d78093d43f..53b628d5c6d 100644 --- a/service/sfn/api_op_GetExecutionHistory.go +++ b/service/sfn/api_op_GetExecutionHistory.go @@ -4,6 +4,7 @@ package sfn import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sfn/types" @@ -142,6 +143,86 @@ func addOperationGetExecutionHistoryMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetExecutionHistoryPaginator returns a new GetExecutionHistoryPaginator +func NewGetExecutionHistoryPaginator(client GetExecutionHistoryAPIClient, params *GetExecutionHistoryInput, optFns ...func(*GetExecutionHistoryPaginatorOptions)) *GetExecutionHistoryPaginator { + options := GetExecutionHistoryPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetExecutionHistoryInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetExecutionHistory(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sfn/api_op_ListActivities.go b/service/sfn/api_op_ListActivities.go index d1c317ac498..86f87e666aa 100644 --- a/service/sfn/api_op_ListActivities.go +++ b/service/sfn/api_op_ListActivities.go @@ -4,6 +4,7 @@ package sfn import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sfn/types" @@ -125,6 +126,85 @@ func addOperationListActivitiesMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListActivitiesPaginator returns a new ListActivitiesPaginator +func NewListActivitiesPaginator(client ListActivitiesAPIClient, params *ListActivitiesInput, optFns ...func(*ListActivitiesPaginatorOptions)) *ListActivitiesPaginator { + options := ListActivitiesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListActivitiesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListActivities(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sfn/api_op_ListExecutions.go b/service/sfn/api_op_ListExecutions.go index 53f647e9ea7..99750dfb848 100644 --- a/service/sfn/api_op_ListExecutions.go +++ b/service/sfn/api_op_ListExecutions.go @@ -4,6 +4,7 @@ package sfn import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sfn/types" @@ -139,6 +140,85 @@ func addOperationListExecutionsMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListExecutionsPaginator returns a new ListExecutionsPaginator +func NewListExecutionsPaginator(client ListExecutionsAPIClient, params *ListExecutionsInput, optFns ...func(*ListExecutionsPaginatorOptions)) *ListExecutionsPaginator { + options := ListExecutionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListExecutionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListExecutions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sfn/api_op_ListStateMachines.go b/service/sfn/api_op_ListStateMachines.go index 9f60f78c97e..42370c152ac 100644 --- a/service/sfn/api_op_ListStateMachines.go +++ b/service/sfn/api_op_ListStateMachines.go @@ -4,6 +4,7 @@ package sfn import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sfn/types" @@ -121,6 +122,85 @@ func addOperationListStateMachinesMiddlewares(stack *middleware.Stack, options O return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListStateMachinesPaginator returns a new ListStateMachinesPaginator +func NewListStateMachinesPaginator(client ListStateMachinesAPIClient, params *ListStateMachinesInput, optFns ...func(*ListStateMachinesPaginatorOptions)) *ListStateMachinesPaginator { + options := ListStateMachinesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListStateMachinesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListStateMachines(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sfn/go.mod b/service/sfn/go.mod index 78481091235..8ed3d6dd722 100644 --- a/service/sfn/go.mod +++ b/service/sfn/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/sfn/go.sum b/service/sfn/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/sfn/go.sum +++ b/service/sfn/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 3acbc58215e..00000000000 --- a/service/sfn/paginators.go +++ /dev/null @@ -1,325 +0,0 @@ -// 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/api_op_ListAttacks.go b/service/shield/api_op_ListAttacks.go index 63234e2a852..a0387c7792d 100644 --- a/service/shield/api_op_ListAttacks.go +++ b/service/shield/api_op_ListAttacks.go @@ -4,6 +4,7 @@ package shield import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/shield/types" @@ -135,6 +136,85 @@ func addOperationListAttacksMiddlewares(stack *middleware.Stack, options Options return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAttacksPaginator returns a new ListAttacksPaginator +func NewListAttacksPaginator(client ListAttacksAPIClient, params *ListAttacksInput, optFns ...func(*ListAttacksPaginatorOptions)) *ListAttacksPaginator { + options := ListAttacksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAttacksInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAttacks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/shield/api_op_ListProtections.go b/service/shield/api_op_ListProtections.go index b227a96e2d3..ec55989d2ba 100644 --- a/service/shield/api_op_ListProtections.go +++ b/service/shield/api_op_ListProtections.go @@ -4,6 +4,7 @@ package shield import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/shield/types" @@ -118,6 +119,86 @@ func addOperationListProtectionsMiddlewares(stack *middleware.Stack, options Opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListProtectionsPaginator returns a new ListProtectionsPaginator +func NewListProtectionsPaginator(client ListProtectionsAPIClient, params *ListProtectionsInput, optFns ...func(*ListProtectionsPaginatorOptions)) *ListProtectionsPaginator { + options := ListProtectionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListProtectionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListProtections(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/shield/go.mod b/service/shield/go.mod index 0843ee69aa9..bf0326f6a76 100644 --- a/service/shield/go.mod +++ b/service/shield/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/shield/go.sum b/service/shield/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/shield/go.sum +++ b/service/shield/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index dbc308f56cc..00000000000 --- a/service/shield/paginators.go +++ /dev/null @@ -1,167 +0,0 @@ -// 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/api_op_ListSigningJobs.go b/service/signer/api_op_ListSigningJobs.go index 436ab88323a..5fa98d27f59 100644 --- a/service/signer/api_op_ListSigningJobs.go +++ b/service/signer/api_op_ListSigningJobs.go @@ -4,6 +4,7 @@ package signer import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/signer/types" @@ -127,6 +128,84 @@ func addOperationListSigningJobsMiddlewares(stack *middleware.Stack, options Opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListSigningJobsPaginator returns a new ListSigningJobsPaginator +func NewListSigningJobsPaginator(client ListSigningJobsAPIClient, params *ListSigningJobsInput, optFns ...func(*ListSigningJobsPaginatorOptions)) *ListSigningJobsPaginator { + options := ListSigningJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSigningJobsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSigningJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/signer/api_op_ListSigningPlatforms.go b/service/signer/api_op_ListSigningPlatforms.go index 3a11593978c..c46685558dd 100644 --- a/service/signer/api_op_ListSigningPlatforms.go +++ b/service/signer/api_op_ListSigningPlatforms.go @@ -4,6 +4,7 @@ package signer import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/signer/types" @@ -122,6 +123,82 @@ func addOperationListSigningPlatformsMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListSigningPlatformsPaginator returns a new ListSigningPlatformsPaginator +func NewListSigningPlatformsPaginator(client ListSigningPlatformsAPIClient, params *ListSigningPlatformsInput, optFns ...func(*ListSigningPlatformsPaginatorOptions)) *ListSigningPlatformsPaginator { + options := ListSigningPlatformsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSigningPlatformsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSigningPlatforms(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/signer/api_op_ListSigningProfiles.go b/service/signer/api_op_ListSigningProfiles.go index 7e0002a4583..fb37ccddc16 100644 --- a/service/signer/api_op_ListSigningProfiles.go +++ b/service/signer/api_op_ListSigningProfiles.go @@ -4,6 +4,7 @@ package signer import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/signer/types" @@ -118,6 +119,82 @@ func addOperationListSigningProfilesMiddlewares(stack *middleware.Stack, options return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListSigningProfilesPaginator returns a new ListSigningProfilesPaginator +func NewListSigningProfilesPaginator(client ListSigningProfilesAPIClient, params *ListSigningProfilesInput, optFns ...func(*ListSigningProfilesPaginatorOptions)) *ListSigningProfilesPaginator { + options := ListSigningProfilesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSigningProfilesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSigningProfiles(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/signer/go.mod b/service/signer/go.mod index cf78940a86d..fab3fe20560 100644 --- a/service/signer/go.mod +++ b/service/signer/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/signer/go.sum b/service/signer/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/signer/go.sum +++ b/service/signer/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index d25a29f978e..00000000000 --- a/service/signer/paginators.go +++ /dev/null @@ -1,238 +0,0 @@ -// 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/api_op_GetConnectors.go b/service/sms/api_op_GetConnectors.go index 8a848c13e4b..18ece5e92b9 100644 --- a/service/sms/api_op_GetConnectors.go +++ b/service/sms/api_op_GetConnectors.go @@ -4,6 +4,7 @@ package sms import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sms/types" @@ -108,6 +109,82 @@ func addOperationGetConnectorsMiddlewares(stack *middleware.Stack, options Optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetConnectorsPaginator returns a new GetConnectorsPaginator +func NewGetConnectorsPaginator(client GetConnectorsAPIClient, params *GetConnectorsInput, optFns ...func(*GetConnectorsPaginatorOptions)) *GetConnectorsPaginator { + options := GetConnectorsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetConnectorsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetConnectors(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sms/api_op_GetReplicationJobs.go b/service/sms/api_op_GetReplicationJobs.go index fb6408a4aa4..4d33488b160 100644 --- a/service/sms/api_op_GetReplicationJobs.go +++ b/service/sms/api_op_GetReplicationJobs.go @@ -4,6 +4,7 @@ package sms import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sms/types" @@ -111,6 +112,84 @@ func addOperationGetReplicationJobsMiddlewares(stack *middleware.Stack, options return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetReplicationJobsPaginator returns a new GetReplicationJobsPaginator +func NewGetReplicationJobsPaginator(client GetReplicationJobsAPIClient, params *GetReplicationJobsInput, optFns ...func(*GetReplicationJobsPaginatorOptions)) *GetReplicationJobsPaginator { + options := GetReplicationJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetReplicationJobsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetReplicationJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sms/api_op_GetReplicationRuns.go b/service/sms/api_op_GetReplicationRuns.go index 00703a1cf10..79af3a81965 100644 --- a/service/sms/api_op_GetReplicationRuns.go +++ b/service/sms/api_op_GetReplicationRuns.go @@ -4,6 +4,7 @@ package sms import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sms/types" @@ -119,6 +120,84 @@ func addOperationGetReplicationRunsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetReplicationRunsPaginator returns a new GetReplicationRunsPaginator +func NewGetReplicationRunsPaginator(client GetReplicationRunsAPIClient, params *GetReplicationRunsInput, optFns ...func(*GetReplicationRunsPaginatorOptions)) *GetReplicationRunsPaginator { + options := GetReplicationRunsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetReplicationRunsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetReplicationRuns(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sms/api_op_GetServers.go b/service/sms/api_op_GetServers.go index 32339b7ae41..44e43b39ff9 100644 --- a/service/sms/api_op_GetServers.go +++ b/service/sms/api_op_GetServers.go @@ -4,6 +4,7 @@ package sms import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sms/types" @@ -119,6 +120,82 @@ func addOperationGetServersMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetServersPaginator returns a new GetServersPaginator +func NewGetServersPaginator(client GetServersAPIClient, params *GetServersInput, optFns ...func(*GetServersPaginatorOptions)) *GetServersPaginator { + options := GetServersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetServersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetServers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sms/go.mod b/service/sms/go.mod index fd0e841039e..a59fe2246d3 100644 --- a/service/sms/go.mod +++ b/service/sms/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/sms/go.sum b/service/sms/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/sms/go.sum +++ b/service/sms/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 8fae071c849..00000000000 --- a/service/sms/paginators.go +++ /dev/null @@ -1,316 +0,0 @@ -// 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/api_op_DescribeAddresses.go b/service/snowball/api_op_DescribeAddresses.go index d6d464f3e5b..54416c60a08 100644 --- a/service/snowball/api_op_DescribeAddresses.go +++ b/service/snowball/api_op_DescribeAddresses.go @@ -4,6 +4,7 @@ package snowball import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/snowball/types" @@ -111,6 +112,81 @@ func addOperationDescribeAddressesMiddlewares(stack *middleware.Stack, options O return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeAddressesPaginator returns a new DescribeAddressesPaginator +func NewDescribeAddressesPaginator(client DescribeAddressesAPIClient, params *DescribeAddressesInput, optFns ...func(*DescribeAddressesPaginatorOptions)) *DescribeAddressesPaginator { + options := DescribeAddressesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeAddressesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeAddresses(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/snowball/api_op_ListJobs.go b/service/snowball/api_op_ListJobs.go index 12ae9eb7ff3..2eef33b7cf2 100644 --- a/service/snowball/api_op_ListJobs.go +++ b/service/snowball/api_op_ListJobs.go @@ -4,6 +4,7 @@ package snowball import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/snowball/types" @@ -114,6 +115,80 @@ func addOperationListJobsMiddlewares(stack *middleware.Stack, options Options) ( return 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 number of JobListEntry objects to return. + Limit *int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListJobsPaginator returns a new ListJobsPaginator +func NewListJobsPaginator(client ListJobsAPIClient, params *ListJobsInput, optFns ...func(*ListJobsPaginatorOptions)) *ListJobsPaginator { + options := ListJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListJobsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/snowball/go.mod b/service/snowball/go.mod index 3068fae291e..d7ecb377998 100644 --- a/service/snowball/go.mod +++ b/service/snowball/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/snowball/go.sum b/service/snowball/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/snowball/go.sum +++ b/service/snowball/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 3e7ee6e84b1..00000000000 --- a/service/snowball/paginators.go +++ /dev/null @@ -1,157 +0,0 @@ -// 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/api_op_ListEndpointsByPlatformApplication.go b/service/sns/api_op_ListEndpointsByPlatformApplication.go index 85c65a13873..a3e18dcef26 100644 --- a/service/sns/api_op_ListEndpointsByPlatformApplication.go +++ b/service/sns/api_op_ListEndpointsByPlatformApplication.go @@ -4,6 +4,7 @@ package sns import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sns/types" @@ -124,6 +125,79 @@ func addOperationListEndpointsByPlatformApplicationMiddlewares(stack *middleware return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListEndpointsByPlatformApplicationPaginator returns a new +// ListEndpointsByPlatformApplicationPaginator +func NewListEndpointsByPlatformApplicationPaginator(client ListEndpointsByPlatformApplicationAPIClient, params *ListEndpointsByPlatformApplicationInput, optFns ...func(*ListEndpointsByPlatformApplicationPaginatorOptions)) *ListEndpointsByPlatformApplicationPaginator { + options := ListEndpointsByPlatformApplicationPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListEndpointsByPlatformApplicationInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListEndpointsByPlatformApplication(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sns/api_op_ListPlatformApplications.go b/service/sns/api_op_ListPlatformApplications.go index 71b03b1c98d..090eea3fb96 100644 --- a/service/sns/api_op_ListPlatformApplications.go +++ b/service/sns/api_op_ListPlatformApplications.go @@ -4,6 +4,7 @@ package sns import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sns/types" @@ -115,6 +116,79 @@ func addOperationListPlatformApplicationsMiddlewares(stack *middleware.Stack, op return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListPlatformApplicationsPaginator returns a new +// ListPlatformApplicationsPaginator +func NewListPlatformApplicationsPaginator(client ListPlatformApplicationsAPIClient, params *ListPlatformApplicationsInput, optFns ...func(*ListPlatformApplicationsPaginatorOptions)) *ListPlatformApplicationsPaginator { + options := ListPlatformApplicationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPlatformApplicationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPlatformApplications(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sns/api_op_ListSubscriptions.go b/service/sns/api_op_ListSubscriptions.go index 61d93960e83..3328c41c835 100644 --- a/service/sns/api_op_ListSubscriptions.go +++ b/service/sns/api_op_ListSubscriptions.go @@ -4,6 +4,7 @@ package sns import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sns/types" @@ -109,6 +110,77 @@ func addOperationListSubscriptionsMiddlewares(stack *middleware.Stack, options O return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListSubscriptionsPaginator returns a new ListSubscriptionsPaginator +func NewListSubscriptionsPaginator(client ListSubscriptionsAPIClient, params *ListSubscriptionsInput, optFns ...func(*ListSubscriptionsPaginatorOptions)) *ListSubscriptionsPaginator { + options := ListSubscriptionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSubscriptionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSubscriptions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sns/api_op_ListSubscriptionsByTopic.go b/service/sns/api_op_ListSubscriptionsByTopic.go index 6e5999f89b4..66b8f50c03a 100644 --- a/service/sns/api_op_ListSubscriptionsByTopic.go +++ b/service/sns/api_op_ListSubscriptionsByTopic.go @@ -4,6 +4,7 @@ package sns import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sns/types" @@ -117,6 +118,79 @@ func addOperationListSubscriptionsByTopicMiddlewares(stack *middleware.Stack, op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListSubscriptionsByTopicPaginator returns a new +// ListSubscriptionsByTopicPaginator +func NewListSubscriptionsByTopicPaginator(client ListSubscriptionsByTopicAPIClient, params *ListSubscriptionsByTopicInput, optFns ...func(*ListSubscriptionsByTopicPaginatorOptions)) *ListSubscriptionsByTopicPaginator { + options := ListSubscriptionsByTopicPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSubscriptionsByTopicInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSubscriptionsByTopic(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sns/api_op_ListTopics.go b/service/sns/api_op_ListTopics.go index 035d5ab8414..9e02b2a899c 100644 --- a/service/sns/api_op_ListTopics.go +++ b/service/sns/api_op_ListTopics.go @@ -4,6 +4,7 @@ package sns import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sns/types" @@ -107,6 +108,76 @@ func addOperationListTopicsMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTopicsPaginator returns a new ListTopicsPaginator +func NewListTopicsPaginator(client ListTopicsAPIClient, params *ListTopicsInput, optFns ...func(*ListTopicsPaginatorOptions)) *ListTopicsPaginator { + options := ListTopicsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTopicsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTopics(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sns/go.mod b/service/sns/go.mod index 2159ec79554..beb40eae831 100644 --- a/service/sns/go.mod +++ b/service/sns/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/sns/go.sum b/service/sns/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/sns/go.sum +++ b/service/sns/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 85173a9f8c1..00000000000 --- a/service/sns/paginators.go +++ /dev/null @@ -1,368 +0,0 @@ -// 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/api_op_ListDeadLetterSourceQueues.go b/service/sqs/api_op_ListDeadLetterSourceQueues.go index b1218dc9c99..322653e0816 100644 --- a/service/sqs/api_op_ListDeadLetterSourceQueues.go +++ b/service/sqs/api_op_ListDeadLetterSourceQueues.go @@ -4,6 +4,7 @@ package sqs import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -131,6 +132,84 @@ func addOperationListDeadLetterSourceQueuesMiddlewares(stack *middleware.Stack, return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDeadLetterSourceQueuesPaginator returns a new +// ListDeadLetterSourceQueuesPaginator +func NewListDeadLetterSourceQueuesPaginator(client ListDeadLetterSourceQueuesAPIClient, params *ListDeadLetterSourceQueuesInput, optFns ...func(*ListDeadLetterSourceQueuesPaginatorOptions)) *ListDeadLetterSourceQueuesPaginator { + options := ListDeadLetterSourceQueuesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDeadLetterSourceQueuesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDeadLetterSourceQueues(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sqs/api_op_ListQueues.go b/service/sqs/api_op_ListQueues.go index f92b6e4dfa1..91d2d170a77 100644 --- a/service/sqs/api_op_ListQueues.go +++ b/service/sqs/api_op_ListQueues.go @@ -4,6 +4,7 @@ package sqs import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -127,6 +128,81 @@ func addOperationListQueuesMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListQueuesPaginator returns a new ListQueuesPaginator +func NewListQueuesPaginator(client ListQueuesAPIClient, params *ListQueuesInput, optFns ...func(*ListQueuesPaginatorOptions)) *ListQueuesPaginator { + options := ListQueuesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListQueuesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListQueues(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sqs/go.mod b/service/sqs/go.mod index b84741bd681..bfab8ae5936 100644 --- a/service/sqs/go.mod +++ b/service/sqs/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/sqs/go.sum b/service/sqs/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/sqs/go.sum +++ b/service/sqs/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index f76779af23d..00000000000 --- a/service/sqs/paginators.go +++ /dev/null @@ -1,161 +0,0 @@ -// 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/api_op_DescribeActivations.go b/service/ssm/api_op_DescribeActivations.go index a5ec88c8093..e837204793b 100644 --- a/service/ssm/api_op_DescribeActivations.go +++ b/service/ssm/api_op_DescribeActivations.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -112,6 +113,83 @@ func addOperationDescribeActivationsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeActivationsPaginator returns a new DescribeActivationsPaginator +func NewDescribeActivationsPaginator(client DescribeActivationsAPIClient, params *DescribeActivationsInput, optFns ...func(*DescribeActivationsPaginatorOptions)) *DescribeActivationsPaginator { + options := DescribeActivationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeActivationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeActivations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribeAssociationExecutionTargets.go b/service/ssm/api_op_DescribeAssociationExecutionTargets.go index 08f421519b5..fe077b20a76 100644 --- a/service/ssm/api_op_DescribeAssociationExecutionTargets.go +++ b/service/ssm/api_op_DescribeAssociationExecutionTargets.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -126,6 +127,84 @@ func addOperationDescribeAssociationExecutionTargetsMiddlewares(stack *middlewar return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeAssociationExecutionTargetsPaginator returns a new +// DescribeAssociationExecutionTargetsPaginator +func NewDescribeAssociationExecutionTargetsPaginator(client DescribeAssociationExecutionTargetsAPIClient, params *DescribeAssociationExecutionTargetsInput, optFns ...func(*DescribeAssociationExecutionTargetsPaginatorOptions)) *DescribeAssociationExecutionTargetsPaginator { + options := DescribeAssociationExecutionTargetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeAssociationExecutionTargetsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeAssociationExecutionTargets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribeAssociationExecutions.go b/service/ssm/api_op_DescribeAssociationExecutions.go index 23aa74af42b..de45f5486cf 100644 --- a/service/ssm/api_op_DescribeAssociationExecutions.go +++ b/service/ssm/api_op_DescribeAssociationExecutions.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -119,6 +120,84 @@ func addOperationDescribeAssociationExecutionsMiddlewares(stack *middleware.Stac return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeAssociationExecutionsPaginator returns a new +// DescribeAssociationExecutionsPaginator +func NewDescribeAssociationExecutionsPaginator(client DescribeAssociationExecutionsAPIClient, params *DescribeAssociationExecutionsInput, optFns ...func(*DescribeAssociationExecutionsPaginatorOptions)) *DescribeAssociationExecutionsPaginator { + options := DescribeAssociationExecutionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeAssociationExecutionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeAssociationExecutions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribeAutomationExecutions.go b/service/ssm/api_op_DescribeAutomationExecutions.go index d85cde98462..0759442a578 100644 --- a/service/ssm/api_op_DescribeAutomationExecutions.go +++ b/service/ssm/api_op_DescribeAutomationExecutions.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -115,6 +116,84 @@ func addOperationDescribeAutomationExecutionsMiddlewares(stack *middleware.Stack return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeAutomationExecutionsPaginator returns a new +// DescribeAutomationExecutionsPaginator +func NewDescribeAutomationExecutionsPaginator(client DescribeAutomationExecutionsAPIClient, params *DescribeAutomationExecutionsInput, optFns ...func(*DescribeAutomationExecutionsPaginatorOptions)) *DescribeAutomationExecutionsPaginator { + options := DescribeAutomationExecutionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeAutomationExecutionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeAutomationExecutions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribeAutomationStepExecutions.go b/service/ssm/api_op_DescribeAutomationStepExecutions.go index 864fcd1d052..8dda2be32fe 100644 --- a/service/ssm/api_op_DescribeAutomationStepExecutions.go +++ b/service/ssm/api_op_DescribeAutomationStepExecutions.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -126,6 +127,84 @@ func addOperationDescribeAutomationStepExecutionsMiddlewares(stack *middleware.S return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeAutomationStepExecutionsPaginator returns a new +// DescribeAutomationStepExecutionsPaginator +func NewDescribeAutomationStepExecutionsPaginator(client DescribeAutomationStepExecutionsAPIClient, params *DescribeAutomationStepExecutionsInput, optFns ...func(*DescribeAutomationStepExecutionsPaginatorOptions)) *DescribeAutomationStepExecutionsPaginator { + options := DescribeAutomationStepExecutionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeAutomationStepExecutionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeAutomationStepExecutions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribeAvailablePatches.go b/service/ssm/api_op_DescribeAvailablePatches.go index 5bc881c0de1..a60bb381c82 100644 --- a/service/ssm/api_op_DescribeAvailablePatches.go +++ b/service/ssm/api_op_DescribeAvailablePatches.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -110,6 +111,83 @@ func addOperationDescribeAvailablePatchesMiddlewares(stack *middleware.Stack, op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeAvailablePatchesPaginator returns a new +// DescribeAvailablePatchesPaginator +func NewDescribeAvailablePatchesPaginator(client DescribeAvailablePatchesAPIClient, params *DescribeAvailablePatchesInput, optFns ...func(*DescribeAvailablePatchesPaginatorOptions)) *DescribeAvailablePatchesPaginator { + options := DescribeAvailablePatchesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeAvailablePatchesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeAvailablePatches(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribeEffectiveInstanceAssociations.go b/service/ssm/api_op_DescribeEffectiveInstanceAssociations.go index 69cd2fd0609..49e190d8def 100644 --- a/service/ssm/api_op_DescribeEffectiveInstanceAssociations.go +++ b/service/ssm/api_op_DescribeEffectiveInstanceAssociations.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -116,6 +117,84 @@ func addOperationDescribeEffectiveInstanceAssociationsMiddlewares(stack *middlew return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeEffectiveInstanceAssociationsPaginator returns a new +// DescribeEffectiveInstanceAssociationsPaginator +func NewDescribeEffectiveInstanceAssociationsPaginator(client DescribeEffectiveInstanceAssociationsAPIClient, params *DescribeEffectiveInstanceAssociationsInput, optFns ...func(*DescribeEffectiveInstanceAssociationsPaginatorOptions)) *DescribeEffectiveInstanceAssociationsPaginator { + options := DescribeEffectiveInstanceAssociationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEffectiveInstanceAssociationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEffectiveInstanceAssociations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribeEffectivePatchesForPatchBaseline.go b/service/ssm/api_op_DescribeEffectivePatchesForPatchBaseline.go index 2d5c2ad8135..dcc722bb9bd 100644 --- a/service/ssm/api_op_DescribeEffectivePatchesForPatchBaseline.go +++ b/service/ssm/api_op_DescribeEffectivePatchesForPatchBaseline.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -117,6 +118,83 @@ func addOperationDescribeEffectivePatchesForPatchBaselineMiddlewares(stack *midd return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeEffectivePatchesForPatchBaselinePaginator returns a new +// DescribeEffectivePatchesForPatchBaselinePaginator +func NewDescribeEffectivePatchesForPatchBaselinePaginator(client DescribeEffectivePatchesForPatchBaselineAPIClient, params *DescribeEffectivePatchesForPatchBaselineInput, optFns ...func(*DescribeEffectivePatchesForPatchBaselinePaginatorOptions)) *DescribeEffectivePatchesForPatchBaselinePaginator { + options := DescribeEffectivePatchesForPatchBaselinePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEffectivePatchesForPatchBaselineInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEffectivePatchesForPatchBaseline(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribeInstanceAssociationsStatus.go b/service/ssm/api_op_DescribeInstanceAssociationsStatus.go index 80eca6903f1..6737a818827 100644 --- a/service/ssm/api_op_DescribeInstanceAssociationsStatus.go +++ b/service/ssm/api_op_DescribeInstanceAssociationsStatus.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -116,6 +117,84 @@ func addOperationDescribeInstanceAssociationsStatusMiddlewares(stack *middleware return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeInstanceAssociationsStatusPaginator returns a new +// DescribeInstanceAssociationsStatusPaginator +func NewDescribeInstanceAssociationsStatusPaginator(client DescribeInstanceAssociationsStatusAPIClient, params *DescribeInstanceAssociationsStatusInput, optFns ...func(*DescribeInstanceAssociationsStatusPaginatorOptions)) *DescribeInstanceAssociationsStatusPaginator { + options := DescribeInstanceAssociationsStatusPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeInstanceAssociationsStatusInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeInstanceAssociationsStatus(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribeInstanceInformation.go b/service/ssm/api_op_DescribeInstanceInformation.go index c42c84a5e08..ee51bd72a1b 100644 --- a/service/ssm/api_op_DescribeInstanceInformation.go +++ b/service/ssm/api_op_DescribeInstanceInformation.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -130,6 +131,84 @@ func addOperationDescribeInstanceInformationMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeInstanceInformationPaginator returns a new +// DescribeInstanceInformationPaginator +func NewDescribeInstanceInformationPaginator(client DescribeInstanceInformationAPIClient, params *DescribeInstanceInformationInput, optFns ...func(*DescribeInstanceInformationPaginatorOptions)) *DescribeInstanceInformationPaginator { + options := DescribeInstanceInformationPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeInstanceInformationInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeInstanceInformation(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribeInstancePatchStates.go b/service/ssm/api_op_DescribeInstancePatchStates.go index 8de6f619e42..6fde6dd3c9a 100644 --- a/service/ssm/api_op_DescribeInstancePatchStates.go +++ b/service/ssm/api_op_DescribeInstancePatchStates.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -115,6 +116,83 @@ func addOperationDescribeInstancePatchStatesMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeInstancePatchStatesPaginator returns a new +// DescribeInstancePatchStatesPaginator +func NewDescribeInstancePatchStatesPaginator(client DescribeInstancePatchStatesAPIClient, params *DescribeInstancePatchStatesInput, optFns ...func(*DescribeInstancePatchStatesPaginatorOptions)) *DescribeInstancePatchStatesPaginator { + options := DescribeInstancePatchStatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeInstancePatchStatesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeInstancePatchStates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribeInstancePatchStatesForPatchGroup.go b/service/ssm/api_op_DescribeInstancePatchStatesForPatchGroup.go index a60cec35099..e9236e9acc5 100644 --- a/service/ssm/api_op_DescribeInstancePatchStatesForPatchGroup.go +++ b/service/ssm/api_op_DescribeInstancePatchStatesForPatchGroup.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -122,6 +123,83 @@ func addOperationDescribeInstancePatchStatesForPatchGroupMiddlewares(stack *midd return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeInstancePatchStatesForPatchGroupPaginator returns a new +// DescribeInstancePatchStatesForPatchGroupPaginator +func NewDescribeInstancePatchStatesForPatchGroupPaginator(client DescribeInstancePatchStatesForPatchGroupAPIClient, params *DescribeInstancePatchStatesForPatchGroupInput, optFns ...func(*DescribeInstancePatchStatesForPatchGroupPaginatorOptions)) *DescribeInstancePatchStatesForPatchGroupPaginator { + options := DescribeInstancePatchStatesForPatchGroupPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeInstancePatchStatesForPatchGroupInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeInstancePatchStatesForPatchGroup(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribeInstancePatches.go b/service/ssm/api_op_DescribeInstancePatches.go index 88d6447a3ff..a9bd5cbb5bc 100644 --- a/service/ssm/api_op_DescribeInstancePatches.go +++ b/service/ssm/api_op_DescribeInstancePatches.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -123,6 +124,83 @@ func addOperationDescribeInstancePatchesMiddlewares(stack *middleware.Stack, opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeInstancePatchesPaginator returns a new +// DescribeInstancePatchesPaginator +func NewDescribeInstancePatchesPaginator(client DescribeInstancePatchesAPIClient, params *DescribeInstancePatchesInput, optFns ...func(*DescribeInstancePatchesPaginatorOptions)) *DescribeInstancePatchesPaginator { + options := DescribeInstancePatchesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeInstancePatchesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeInstancePatches(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribeInventoryDeletions.go b/service/ssm/api_op_DescribeInventoryDeletions.go index 9819695b775..b8b2d30ba32 100644 --- a/service/ssm/api_op_DescribeInventoryDeletions.go +++ b/service/ssm/api_op_DescribeInventoryDeletions.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -111,6 +112,84 @@ func addOperationDescribeInventoryDeletionsMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeInventoryDeletionsPaginator returns a new +// DescribeInventoryDeletionsPaginator +func NewDescribeInventoryDeletionsPaginator(client DescribeInventoryDeletionsAPIClient, params *DescribeInventoryDeletionsInput, optFns ...func(*DescribeInventoryDeletionsPaginatorOptions)) *DescribeInventoryDeletionsPaginator { + options := DescribeInventoryDeletionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeInventoryDeletionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeInventoryDeletions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribeMaintenanceWindowExecutionTaskInvocations.go b/service/ssm/api_op_DescribeMaintenanceWindowExecutionTaskInvocations.go index 56ff70369fe..15d5e65dbd0 100644 --- a/service/ssm/api_op_DescribeMaintenanceWindowExecutionTaskInvocations.go +++ b/service/ssm/api_op_DescribeMaintenanceWindowExecutionTaskInvocations.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -128,6 +129,85 @@ func addOperationDescribeMaintenanceWindowExecutionTaskInvocationsMiddlewares(st return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeMaintenanceWindowExecutionTaskInvocationsPaginator returns a new +// DescribeMaintenanceWindowExecutionTaskInvocationsPaginator +func NewDescribeMaintenanceWindowExecutionTaskInvocationsPaginator(client DescribeMaintenanceWindowExecutionTaskInvocationsAPIClient, params *DescribeMaintenanceWindowExecutionTaskInvocationsInput, optFns ...func(*DescribeMaintenanceWindowExecutionTaskInvocationsPaginatorOptions)) *DescribeMaintenanceWindowExecutionTaskInvocationsPaginator { + options := DescribeMaintenanceWindowExecutionTaskInvocationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeMaintenanceWindowExecutionTaskInvocationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeMaintenanceWindowExecutionTaskInvocations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribeMaintenanceWindowExecutionTasks.go b/service/ssm/api_op_DescribeMaintenanceWindowExecutionTasks.go index 43c3ac37dcc..bdeac01fe5a 100644 --- a/service/ssm/api_op_DescribeMaintenanceWindowExecutionTasks.go +++ b/service/ssm/api_op_DescribeMaintenanceWindowExecutionTasks.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -122,6 +123,84 @@ func addOperationDescribeMaintenanceWindowExecutionTasksMiddlewares(stack *middl return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeMaintenanceWindowExecutionTasksPaginator returns a new +// DescribeMaintenanceWindowExecutionTasksPaginator +func NewDescribeMaintenanceWindowExecutionTasksPaginator(client DescribeMaintenanceWindowExecutionTasksAPIClient, params *DescribeMaintenanceWindowExecutionTasksInput, optFns ...func(*DescribeMaintenanceWindowExecutionTasksPaginatorOptions)) *DescribeMaintenanceWindowExecutionTasksPaginator { + options := DescribeMaintenanceWindowExecutionTasksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeMaintenanceWindowExecutionTasksInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeMaintenanceWindowExecutionTasks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribeMaintenanceWindowExecutions.go b/service/ssm/api_op_DescribeMaintenanceWindowExecutions.go index bd3adc6b4ca..9eb49c224a1 100644 --- a/service/ssm/api_op_DescribeMaintenanceWindowExecutions.go +++ b/service/ssm/api_op_DescribeMaintenanceWindowExecutions.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -124,6 +125,84 @@ func addOperationDescribeMaintenanceWindowExecutionsMiddlewares(stack *middlewar return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeMaintenanceWindowExecutionsPaginator returns a new +// DescribeMaintenanceWindowExecutionsPaginator +func NewDescribeMaintenanceWindowExecutionsPaginator(client DescribeMaintenanceWindowExecutionsAPIClient, params *DescribeMaintenanceWindowExecutionsInput, optFns ...func(*DescribeMaintenanceWindowExecutionsPaginatorOptions)) *DescribeMaintenanceWindowExecutionsPaginator { + options := DescribeMaintenanceWindowExecutionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeMaintenanceWindowExecutionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeMaintenanceWindowExecutions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribeMaintenanceWindowSchedule.go b/service/ssm/api_op_DescribeMaintenanceWindowSchedule.go index 477b2418ddb..02a6b387a9b 100644 --- a/service/ssm/api_op_DescribeMaintenanceWindowSchedule.go +++ b/service/ssm/api_op_DescribeMaintenanceWindowSchedule.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -124,6 +125,84 @@ func addOperationDescribeMaintenanceWindowScheduleMiddlewares(stack *middleware. return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeMaintenanceWindowSchedulePaginator returns a new +// DescribeMaintenanceWindowSchedulePaginator +func NewDescribeMaintenanceWindowSchedulePaginator(client DescribeMaintenanceWindowScheduleAPIClient, params *DescribeMaintenanceWindowScheduleInput, optFns ...func(*DescribeMaintenanceWindowSchedulePaginatorOptions)) *DescribeMaintenanceWindowSchedulePaginator { + options := DescribeMaintenanceWindowSchedulePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeMaintenanceWindowScheduleInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeMaintenanceWindowSchedule(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribeMaintenanceWindowTargets.go b/service/ssm/api_op_DescribeMaintenanceWindowTargets.go index b21dcce6f46..915d7376d77 100644 --- a/service/ssm/api_op_DescribeMaintenanceWindowTargets.go +++ b/service/ssm/api_op_DescribeMaintenanceWindowTargets.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -121,6 +122,84 @@ func addOperationDescribeMaintenanceWindowTargetsMiddlewares(stack *middleware.S return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeMaintenanceWindowTargetsPaginator returns a new +// DescribeMaintenanceWindowTargetsPaginator +func NewDescribeMaintenanceWindowTargetsPaginator(client DescribeMaintenanceWindowTargetsAPIClient, params *DescribeMaintenanceWindowTargetsInput, optFns ...func(*DescribeMaintenanceWindowTargetsPaginatorOptions)) *DescribeMaintenanceWindowTargetsPaginator { + options := DescribeMaintenanceWindowTargetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeMaintenanceWindowTargetsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeMaintenanceWindowTargets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribeMaintenanceWindowTasks.go b/service/ssm/api_op_DescribeMaintenanceWindowTasks.go index b3f3e4102c8..4eb3e2824b0 100644 --- a/service/ssm/api_op_DescribeMaintenanceWindowTasks.go +++ b/service/ssm/api_op_DescribeMaintenanceWindowTasks.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -120,6 +121,84 @@ func addOperationDescribeMaintenanceWindowTasksMiddlewares(stack *middleware.Sta return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeMaintenanceWindowTasksPaginator returns a new +// DescribeMaintenanceWindowTasksPaginator +func NewDescribeMaintenanceWindowTasksPaginator(client DescribeMaintenanceWindowTasksAPIClient, params *DescribeMaintenanceWindowTasksInput, optFns ...func(*DescribeMaintenanceWindowTasksPaginatorOptions)) *DescribeMaintenanceWindowTasksPaginator { + options := DescribeMaintenanceWindowTasksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeMaintenanceWindowTasksInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeMaintenanceWindowTasks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribeMaintenanceWindows.go b/service/ssm/api_op_DescribeMaintenanceWindows.go index b4be0199b8f..a1a36bcb28c 100644 --- a/service/ssm/api_op_DescribeMaintenanceWindows.go +++ b/service/ssm/api_op_DescribeMaintenanceWindows.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -112,6 +113,84 @@ func addOperationDescribeMaintenanceWindowsMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeMaintenanceWindowsPaginator returns a new +// DescribeMaintenanceWindowsPaginator +func NewDescribeMaintenanceWindowsPaginator(client DescribeMaintenanceWindowsAPIClient, params *DescribeMaintenanceWindowsInput, optFns ...func(*DescribeMaintenanceWindowsPaginatorOptions)) *DescribeMaintenanceWindowsPaginator { + options := DescribeMaintenanceWindowsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeMaintenanceWindowsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeMaintenanceWindows(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribeMaintenanceWindowsForTarget.go b/service/ssm/api_op_DescribeMaintenanceWindowsForTarget.go index b8fdb7fcbc6..1b31268efc9 100644 --- a/service/ssm/api_op_DescribeMaintenanceWindowsForTarget.go +++ b/service/ssm/api_op_DescribeMaintenanceWindowsForTarget.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -124,6 +125,84 @@ func addOperationDescribeMaintenanceWindowsForTargetMiddlewares(stack *middlewar return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeMaintenanceWindowsForTargetPaginator returns a new +// DescribeMaintenanceWindowsForTargetPaginator +func NewDescribeMaintenanceWindowsForTargetPaginator(client DescribeMaintenanceWindowsForTargetAPIClient, params *DescribeMaintenanceWindowsForTargetInput, optFns ...func(*DescribeMaintenanceWindowsForTargetPaginatorOptions)) *DescribeMaintenanceWindowsForTargetPaginator { + options := DescribeMaintenanceWindowsForTargetPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeMaintenanceWindowsForTargetInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeMaintenanceWindowsForTarget(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribeOpsItems.go b/service/ssm/api_op_DescribeOpsItems.go index 6d4dcf971b4..cda031199f7 100644 --- a/service/ssm/api_op_DescribeOpsItems.go +++ b/service/ssm/api_op_DescribeOpsItems.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -160,6 +161,82 @@ func addOperationDescribeOpsItemsMiddlewares(stack *middleware.Stack, options Op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeOpsItemsPaginator returns a new DescribeOpsItemsPaginator +func NewDescribeOpsItemsPaginator(client DescribeOpsItemsAPIClient, params *DescribeOpsItemsInput, optFns ...func(*DescribeOpsItemsPaginatorOptions)) *DescribeOpsItemsPaginator { + options := DescribeOpsItemsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeOpsItemsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeOpsItems(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribeParameters.go b/service/ssm/api_op_DescribeParameters.go index 4cbad6b516a..671a26e2092 100644 --- a/service/ssm/api_op_DescribeParameters.go +++ b/service/ssm/api_op_DescribeParameters.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -122,6 +123,83 @@ func addOperationDescribeParametersMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeParametersPaginator returns a new DescribeParametersPaginator +func NewDescribeParametersPaginator(client DescribeParametersAPIClient, params *DescribeParametersInput, optFns ...func(*DescribeParametersPaginatorOptions)) *DescribeParametersPaginator { + options := DescribeParametersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeParametersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeParameters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribePatchBaselines.go b/service/ssm/api_op_DescribePatchBaselines.go index fd55f23f6fa..3b125bf9568 100644 --- a/service/ssm/api_op_DescribePatchBaselines.go +++ b/service/ssm/api_op_DescribePatchBaselines.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -112,6 +113,82 @@ func addOperationDescribePatchBaselinesMiddlewares(stack *middleware.Stack, opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribePatchBaselinesPaginator returns a new DescribePatchBaselinesPaginator +func NewDescribePatchBaselinesPaginator(client DescribePatchBaselinesAPIClient, params *DescribePatchBaselinesInput, optFns ...func(*DescribePatchBaselinesPaginatorOptions)) *DescribePatchBaselinesPaginator { + options := DescribePatchBaselinesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribePatchBaselinesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribePatchBaselines(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribePatchGroups.go b/service/ssm/api_op_DescribePatchGroups.go index 9d59d015ffc..562b5296fdb 100644 --- a/service/ssm/api_op_DescribePatchGroups.go +++ b/service/ssm/api_op_DescribePatchGroups.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -127,6 +128,82 @@ func addOperationDescribePatchGroupsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribePatchGroupsPaginator returns a new DescribePatchGroupsPaginator +func NewDescribePatchGroupsPaginator(client DescribePatchGroupsAPIClient, params *DescribePatchGroupsInput, optFns ...func(*DescribePatchGroupsPaginatorOptions)) *DescribePatchGroupsPaginator { + options := DescribePatchGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribePatchGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribePatchGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribePatchProperties.go b/service/ssm/api_op_DescribePatchProperties.go index c58a2de15f1..f2fda24bbb2 100644 --- a/service/ssm/api_op_DescribePatchProperties.go +++ b/service/ssm/api_op_DescribePatchProperties.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -137,6 +138,84 @@ func addOperationDescribePatchPropertiesMiddlewares(stack *middleware.Stack, opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribePatchPropertiesPaginator returns a new +// DescribePatchPropertiesPaginator +func NewDescribePatchPropertiesPaginator(client DescribePatchPropertiesAPIClient, params *DescribePatchPropertiesInput, optFns ...func(*DescribePatchPropertiesPaginatorOptions)) *DescribePatchPropertiesPaginator { + options := DescribePatchPropertiesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribePatchPropertiesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribePatchProperties(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribeSessions.go b/service/ssm/api_op_DescribeSessions.go index a032ba2ee23..67924e770db 100644 --- a/service/ssm/api_op_DescribeSessions.go +++ b/service/ssm/api_op_DescribeSessions.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -120,6 +121,82 @@ func addOperationDescribeSessionsMiddlewares(stack *middleware.Stack, options Op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeSessionsPaginator returns a new DescribeSessionsPaginator +func NewDescribeSessionsPaginator(client DescribeSessionsAPIClient, params *DescribeSessionsInput, optFns ...func(*DescribeSessionsPaginatorOptions)) *DescribeSessionsPaginator { + options := DescribeSessionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeSessionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeSessions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_GetInventory.go b/service/ssm/api_op_GetInventory.go index 9b530db0973..215c7f53c88 100644 --- a/service/ssm/api_op_GetInventory.go +++ b/service/ssm/api_op_GetInventory.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -123,6 +124,81 @@ func addOperationGetInventoryMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetInventoryPaginator returns a new GetInventoryPaginator +func NewGetInventoryPaginator(client GetInventoryAPIClient, params *GetInventoryInput, optFns ...func(*GetInventoryPaginatorOptions)) *GetInventoryPaginator { + options := GetInventoryPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetInventoryInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetInventory(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_GetInventorySchema.go b/service/ssm/api_op_GetInventorySchema.go index da37343e0e4..ef1f58a0e47 100644 --- a/service/ssm/api_op_GetInventorySchema.go +++ b/service/ssm/api_op_GetInventorySchema.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -120,6 +121,83 @@ func addOperationGetInventorySchemaMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetInventorySchemaPaginator returns a new GetInventorySchemaPaginator +func NewGetInventorySchemaPaginator(client GetInventorySchemaAPIClient, params *GetInventorySchemaInput, optFns ...func(*GetInventorySchemaPaginatorOptions)) *GetInventorySchemaPaginator { + options := GetInventorySchemaPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetInventorySchemaInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetInventorySchema(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_GetOpsSummary.go b/service/ssm/api_op_GetOpsSummary.go index 2036ba304d1..c9d7301395f 100644 --- a/service/ssm/api_op_GetOpsSummary.go +++ b/service/ssm/api_op_GetOpsSummary.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -123,6 +124,81 @@ func addOperationGetOpsSummaryMiddlewares(stack *middleware.Stack, options Optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetOpsSummaryPaginator returns a new GetOpsSummaryPaginator +func NewGetOpsSummaryPaginator(client GetOpsSummaryAPIClient, params *GetOpsSummaryInput, optFns ...func(*GetOpsSummaryPaginatorOptions)) *GetOpsSummaryPaginator { + options := GetOpsSummaryPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetOpsSummaryInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetOpsSummary(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_GetParameterHistory.go b/service/ssm/api_op_GetParameterHistory.go index 34e1fd0eb82..dcd77d63020 100644 --- a/service/ssm/api_op_GetParameterHistory.go +++ b/service/ssm/api_op_GetParameterHistory.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -120,6 +121,83 @@ func addOperationGetParameterHistoryMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetParameterHistoryPaginator returns a new GetParameterHistoryPaginator +func NewGetParameterHistoryPaginator(client GetParameterHistoryAPIClient, params *GetParameterHistoryInput, optFns ...func(*GetParameterHistoryPaginatorOptions)) *GetParameterHistoryPaginator { + options := GetParameterHistoryPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetParameterHistoryInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetParameterHistory(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_GetParametersByPath.go b/service/ssm/api_op_GetParametersByPath.go index ba57427a647..a1176fdf817 100644 --- a/service/ssm/api_op_GetParametersByPath.go +++ b/service/ssm/api_op_GetParametersByPath.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -140,6 +141,83 @@ func addOperationGetParametersByPathMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetParametersByPathPaginator returns a new GetParametersByPathPaginator +func NewGetParametersByPathPaginator(client GetParametersByPathAPIClient, params *GetParametersByPathInput, optFns ...func(*GetParametersByPathPaginatorOptions)) *GetParametersByPathPaginator { + options := GetParametersByPathPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetParametersByPathInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetParametersByPath(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_ListAssociationVersions.go b/service/ssm/api_op_ListAssociationVersions.go index 550e451f4f6..2b5e1746b3a 100644 --- a/service/ssm/api_op_ListAssociationVersions.go +++ b/service/ssm/api_op_ListAssociationVersions.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -116,6 +117,84 @@ func addOperationListAssociationVersionsMiddlewares(stack *middleware.Stack, opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAssociationVersionsPaginator returns a new +// ListAssociationVersionsPaginator +func NewListAssociationVersionsPaginator(client ListAssociationVersionsAPIClient, params *ListAssociationVersionsInput, optFns ...func(*ListAssociationVersionsPaginatorOptions)) *ListAssociationVersionsPaginator { + options := ListAssociationVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAssociationVersionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAssociationVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_ListAssociations.go b/service/ssm/api_op_ListAssociations.go index 76052b43853..c4eda6c19d2 100644 --- a/service/ssm/api_op_ListAssociations.go +++ b/service/ssm/api_op_ListAssociations.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -116,6 +117,82 @@ func addOperationListAssociationsMiddlewares(stack *middleware.Stack, options Op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAssociationsPaginator returns a new ListAssociationsPaginator +func NewListAssociationsPaginator(client ListAssociationsAPIClient, params *ListAssociationsInput, optFns ...func(*ListAssociationsPaginatorOptions)) *ListAssociationsPaginator { + options := ListAssociationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAssociationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAssociations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_ListCommandInvocations.go b/service/ssm/api_op_ListCommandInvocations.go index 19ef33d5f57..f14b13c89fd 100644 --- a/service/ssm/api_op_ListCommandInvocations.go +++ b/service/ssm/api_op_ListCommandInvocations.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -130,6 +131,84 @@ func addOperationListCommandInvocationsMiddlewares(stack *middleware.Stack, opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListCommandInvocationsPaginator returns a new ListCommandInvocationsPaginator +func NewListCommandInvocationsPaginator(client ListCommandInvocationsAPIClient, params *ListCommandInvocationsInput, optFns ...func(*ListCommandInvocationsPaginatorOptions)) *ListCommandInvocationsPaginator { + options := ListCommandInvocationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListCommandInvocationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListCommandInvocations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_ListCommands.go b/service/ssm/api_op_ListCommands.go index 49ce33c2d88..d6067be6694 100644 --- a/service/ssm/api_op_ListCommands.go +++ b/service/ssm/api_op_ListCommands.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -124,6 +125,82 @@ func addOperationListCommandsMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListCommandsPaginator returns a new ListCommandsPaginator +func NewListCommandsPaginator(client ListCommandsAPIClient, params *ListCommandsInput, optFns ...func(*ListCommandsPaginatorOptions)) *ListCommandsPaginator { + options := ListCommandsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListCommandsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListCommands(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_ListComplianceItems.go b/service/ssm/api_op_ListComplianceItems.go index 8e18603e8d1..a141b933c3f 100644 --- a/service/ssm/api_op_ListComplianceItems.go +++ b/service/ssm/api_op_ListComplianceItems.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -122,6 +123,83 @@ func addOperationListComplianceItemsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListComplianceItemsPaginator returns a new ListComplianceItemsPaginator +func NewListComplianceItemsPaginator(client ListComplianceItemsAPIClient, params *ListComplianceItemsInput, optFns ...func(*ListComplianceItemsPaginatorOptions)) *ListComplianceItemsPaginator { + options := ListComplianceItemsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListComplianceItemsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListComplianceItems(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_ListComplianceSummaries.go b/service/ssm/api_op_ListComplianceSummaries.go index 61d30d7f482..e28e29cf493 100644 --- a/service/ssm/api_op_ListComplianceSummaries.go +++ b/service/ssm/api_op_ListComplianceSummaries.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -117,6 +118,85 @@ func addOperationListComplianceSummariesMiddlewares(stack *middleware.Stack, opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListComplianceSummariesPaginator returns a new +// ListComplianceSummariesPaginator +func NewListComplianceSummariesPaginator(client ListComplianceSummariesAPIClient, params *ListComplianceSummariesInput, optFns ...func(*ListComplianceSummariesPaginatorOptions)) *ListComplianceSummariesPaginator { + options := ListComplianceSummariesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListComplianceSummariesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListComplianceSummaries(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_ListDocumentVersions.go b/service/ssm/api_op_ListDocumentVersions.go index a6303e18c0c..11dda0420a1 100644 --- a/service/ssm/api_op_ListDocumentVersions.go +++ b/service/ssm/api_op_ListDocumentVersions.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -116,6 +117,83 @@ func addOperationListDocumentVersionsMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDocumentVersionsPaginator returns a new ListDocumentVersionsPaginator +func NewListDocumentVersionsPaginator(client ListDocumentVersionsAPIClient, params *ListDocumentVersionsInput, optFns ...func(*ListDocumentVersionsPaginatorOptions)) *ListDocumentVersionsPaginator { + options := ListDocumentVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDocumentVersionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDocumentVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_ListDocuments.go b/service/ssm/api_op_ListDocuments.go index e9333b078ba..f584cff21a9 100644 --- a/service/ssm/api_op_ListDocuments.go +++ b/service/ssm/api_op_ListDocuments.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -123,6 +124,81 @@ func addOperationListDocumentsMiddlewares(stack *middleware.Stack, options Optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDocumentsPaginator returns a new ListDocumentsPaginator +func NewListDocumentsPaginator(client ListDocumentsAPIClient, params *ListDocumentsInput, optFns ...func(*ListDocumentsPaginatorOptions)) *ListDocumentsPaginator { + options := ListDocumentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDocumentsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDocuments(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_ListResourceComplianceSummaries.go b/service/ssm/api_op_ListResourceComplianceSummaries.go index ef45249ae3d..751ce103cb4 100644 --- a/service/ssm/api_op_ListResourceComplianceSummaries.go +++ b/service/ssm/api_op_ListResourceComplianceSummaries.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -115,6 +116,84 @@ func addOperationListResourceComplianceSummariesMiddlewares(stack *middleware.St return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListResourceComplianceSummariesPaginator returns a new +// ListResourceComplianceSummariesPaginator +func NewListResourceComplianceSummariesPaginator(client ListResourceComplianceSummariesAPIClient, params *ListResourceComplianceSummariesInput, optFns ...func(*ListResourceComplianceSummariesPaginatorOptions)) *ListResourceComplianceSummariesPaginator { + options := ListResourceComplianceSummariesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListResourceComplianceSummariesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListResourceComplianceSummaries(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_ListResourceDataSync.go b/service/ssm/api_op_ListResourceDataSync.go index 1113911aeb2..dfda6ae7d84 100644 --- a/service/ssm/api_op_ListResourceDataSync.go +++ b/service/ssm/api_op_ListResourceDataSync.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -121,6 +122,83 @@ func addOperationListResourceDataSyncMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListResourceDataSyncPaginator returns a new ListResourceDataSyncPaginator +func NewListResourceDataSyncPaginator(client ListResourceDataSyncAPIClient, params *ListResourceDataSyncInput, optFns ...func(*ListResourceDataSyncPaginatorOptions)) *ListResourceDataSyncPaginator { + options := ListResourceDataSyncPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListResourceDataSyncInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListResourceDataSync(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/go.mod b/service/ssm/go.mod index b1402f2bdd4..8b88f354852 100644 --- a/service/ssm/go.mod +++ b/service/ssm/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/ssm/go.sum b/service/ssm/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/ssm/go.sum +++ b/service/ssm/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 86d5bc81d3a..00000000000 --- a/service/ssm/paginators.go +++ /dev/null @@ -1,3330 +0,0 @@ -// 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/api_op_ListAccountRoles.go b/service/sso/api_op_ListAccountRoles.go index c676f0d11f6..2c431218a62 100644 --- a/service/sso/api_op_ListAccountRoles.go +++ b/service/sso/api_op_ListAccountRoles.go @@ -4,6 +4,7 @@ package sso import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/service/sso/types" "github.com/awslabs/smithy-go/middleware" @@ -116,6 +117,81 @@ func addOperationListAccountRolesMiddlewares(stack *middleware.Stack, options Op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAccountRolesPaginator returns a new ListAccountRolesPaginator +func NewListAccountRolesPaginator(client ListAccountRolesAPIClient, params *ListAccountRolesInput, optFns ...func(*ListAccountRolesPaginatorOptions)) *ListAccountRolesPaginator { + options := ListAccountRolesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAccountRolesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAccountRoles(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sso/api_op_ListAccounts.go b/service/sso/api_op_ListAccounts.go index a630d9f8e93..b65ab3edf13 100644 --- a/service/sso/api_op_ListAccounts.go +++ b/service/sso/api_op_ListAccounts.go @@ -4,6 +4,7 @@ package sso import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/service/sso/types" "github.com/awslabs/smithy-go/middleware" @@ -114,6 +115,80 @@ func addOperationListAccountsMiddlewares(stack *middleware.Stack, options Option return 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 { + // This is the number of items clients can request per page. + Limit *int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAccountsPaginator returns a new ListAccountsPaginator +func NewListAccountsPaginator(client ListAccountsAPIClient, params *ListAccountsInput, optFns ...func(*ListAccountsPaginatorOptions)) *ListAccountsPaginator { + options := ListAccountsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAccountsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAccounts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sso/go.mod b/service/sso/go.mod index 2af552b6e79..4b51fe8d299 100644 --- a/service/sso/go.mod +++ b/service/sso/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/sso/go.sum b/service/sso/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/sso/go.sum +++ b/service/sso/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index ea59e073a53..00000000000 --- a/service/sso/paginators.go +++ /dev/null @@ -1,157 +0,0 @@ -// 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/api_op_ListAccountAssignmentCreationStatus.go b/service/ssoadmin/api_op_ListAccountAssignmentCreationStatus.go index 0a133c66897..ab01eb6f865 100644 --- a/service/ssoadmin/api_op_ListAccountAssignmentCreationStatus.go +++ b/service/ssoadmin/api_op_ListAccountAssignmentCreationStatus.go @@ -4,6 +4,7 @@ package ssoadmin import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssoadmin/types" @@ -121,6 +122,83 @@ func addOperationListAccountAssignmentCreationStatusMiddlewares(stack *middlewar return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAccountAssignmentCreationStatusPaginator returns a new +// ListAccountAssignmentCreationStatusPaginator +func NewListAccountAssignmentCreationStatusPaginator(client ListAccountAssignmentCreationStatusAPIClient, params *ListAccountAssignmentCreationStatusInput, optFns ...func(*ListAccountAssignmentCreationStatusPaginatorOptions)) *ListAccountAssignmentCreationStatusPaginator { + options := ListAccountAssignmentCreationStatusPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAccountAssignmentCreationStatusInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAccountAssignmentCreationStatus(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssoadmin/api_op_ListAccountAssignmentDeletionStatus.go b/service/ssoadmin/api_op_ListAccountAssignmentDeletionStatus.go index 11ea3c19be0..43b5349a3d1 100644 --- a/service/ssoadmin/api_op_ListAccountAssignmentDeletionStatus.go +++ b/service/ssoadmin/api_op_ListAccountAssignmentDeletionStatus.go @@ -4,6 +4,7 @@ package ssoadmin import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssoadmin/types" @@ -121,6 +122,83 @@ func addOperationListAccountAssignmentDeletionStatusMiddlewares(stack *middlewar return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAccountAssignmentDeletionStatusPaginator returns a new +// ListAccountAssignmentDeletionStatusPaginator +func NewListAccountAssignmentDeletionStatusPaginator(client ListAccountAssignmentDeletionStatusAPIClient, params *ListAccountAssignmentDeletionStatusInput, optFns ...func(*ListAccountAssignmentDeletionStatusPaginatorOptions)) *ListAccountAssignmentDeletionStatusPaginator { + options := ListAccountAssignmentDeletionStatusPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAccountAssignmentDeletionStatusInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAccountAssignmentDeletionStatus(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssoadmin/api_op_ListAccountAssignments.go b/service/ssoadmin/api_op_ListAccountAssignments.go index 8309f229552..a99d3e716ce 100644 --- a/service/ssoadmin/api_op_ListAccountAssignments.go +++ b/service/ssoadmin/api_op_ListAccountAssignments.go @@ -4,6 +4,7 @@ package ssoadmin import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssoadmin/types" @@ -128,6 +129,82 @@ func addOperationListAccountAssignmentsMiddlewares(stack *middleware.Stack, opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAccountAssignmentsPaginator returns a new ListAccountAssignmentsPaginator +func NewListAccountAssignmentsPaginator(client ListAccountAssignmentsAPIClient, params *ListAccountAssignmentsInput, optFns ...func(*ListAccountAssignmentsPaginatorOptions)) *ListAccountAssignmentsPaginator { + options := ListAccountAssignmentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAccountAssignmentsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAccountAssignments(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssoadmin/api_op_ListAccountsForProvisionedPermissionSet.go b/service/ssoadmin/api_op_ListAccountsForProvisionedPermissionSet.go index a6fbe2d39e9..daa209f163c 100644 --- a/service/ssoadmin/api_op_ListAccountsForProvisionedPermissionSet.go +++ b/service/ssoadmin/api_op_ListAccountsForProvisionedPermissionSet.go @@ -4,6 +4,7 @@ package ssoadmin import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssoadmin/types" @@ -126,6 +127,83 @@ func addOperationListAccountsForProvisionedPermissionSetMiddlewares(stack *middl return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAccountsForProvisionedPermissionSetPaginator returns a new +// ListAccountsForProvisionedPermissionSetPaginator +func NewListAccountsForProvisionedPermissionSetPaginator(client ListAccountsForProvisionedPermissionSetAPIClient, params *ListAccountsForProvisionedPermissionSetInput, optFns ...func(*ListAccountsForProvisionedPermissionSetPaginatorOptions)) *ListAccountsForProvisionedPermissionSetPaginator { + options := ListAccountsForProvisionedPermissionSetPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAccountsForProvisionedPermissionSetInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAccountsForProvisionedPermissionSet(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssoadmin/api_op_ListInstances.go b/service/ssoadmin/api_op_ListInstances.go index a58454abbb3..cefe412772e 100644 --- a/service/ssoadmin/api_op_ListInstances.go +++ b/service/ssoadmin/api_op_ListInstances.go @@ -4,6 +4,7 @@ package ssoadmin import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssoadmin/types" @@ -107,6 +108,80 @@ func addOperationListInstancesMiddlewares(stack *middleware.Stack, options Optio return 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 results to display for the instance. + Limit *int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListInstancesPaginator returns a new ListInstancesPaginator +func NewListInstancesPaginator(client ListInstancesAPIClient, params *ListInstancesInput, optFns ...func(*ListInstancesPaginatorOptions)) *ListInstancesPaginator { + options := ListInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListInstancesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListInstances(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssoadmin/api_op_ListManagedPoliciesInPermissionSet.go b/service/ssoadmin/api_op_ListManagedPoliciesInPermissionSet.go index a307716f878..dc832ca63f4 100644 --- a/service/ssoadmin/api_op_ListManagedPoliciesInPermissionSet.go +++ b/service/ssoadmin/api_op_ListManagedPoliciesInPermissionSet.go @@ -4,6 +4,7 @@ package ssoadmin import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssoadmin/types" @@ -122,6 +123,83 @@ func addOperationListManagedPoliciesInPermissionSetMiddlewares(stack *middleware return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListManagedPoliciesInPermissionSetPaginator returns a new +// ListManagedPoliciesInPermissionSetPaginator +func NewListManagedPoliciesInPermissionSetPaginator(client ListManagedPoliciesInPermissionSetAPIClient, params *ListManagedPoliciesInPermissionSetInput, optFns ...func(*ListManagedPoliciesInPermissionSetPaginatorOptions)) *ListManagedPoliciesInPermissionSetPaginator { + options := ListManagedPoliciesInPermissionSetPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListManagedPoliciesInPermissionSetInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListManagedPoliciesInPermissionSet(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssoadmin/api_op_ListPermissionSetProvisioningStatus.go b/service/ssoadmin/api_op_ListPermissionSetProvisioningStatus.go index ffc4fa336fd..bfd1ed78745 100644 --- a/service/ssoadmin/api_op_ListPermissionSetProvisioningStatus.go +++ b/service/ssoadmin/api_op_ListPermissionSetProvisioningStatus.go @@ -4,6 +4,7 @@ package ssoadmin import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssoadmin/types" @@ -121,6 +122,83 @@ func addOperationListPermissionSetProvisioningStatusMiddlewares(stack *middlewar return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListPermissionSetProvisioningStatusPaginator returns a new +// ListPermissionSetProvisioningStatusPaginator +func NewListPermissionSetProvisioningStatusPaginator(client ListPermissionSetProvisioningStatusAPIClient, params *ListPermissionSetProvisioningStatusInput, optFns ...func(*ListPermissionSetProvisioningStatusPaginatorOptions)) *ListPermissionSetProvisioningStatusPaginator { + options := ListPermissionSetProvisioningStatusPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPermissionSetProvisioningStatusInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPermissionSetProvisioningStatus(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssoadmin/api_op_ListPermissionSets.go b/service/ssoadmin/api_op_ListPermissionSets.go index 8938355ab85..18498575010 100644 --- a/service/ssoadmin/api_op_ListPermissionSets.go +++ b/service/ssoadmin/api_op_ListPermissionSets.go @@ -4,6 +4,7 @@ package ssoadmin import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -116,6 +117,82 @@ func addOperationListPermissionSetsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListPermissionSetsPaginator returns a new ListPermissionSetsPaginator +func NewListPermissionSetsPaginator(client ListPermissionSetsAPIClient, params *ListPermissionSetsInput, optFns ...func(*ListPermissionSetsPaginatorOptions)) *ListPermissionSetsPaginator { + options := ListPermissionSetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPermissionSetsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPermissionSets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssoadmin/api_op_ListPermissionSetsProvisionedToAccount.go b/service/ssoadmin/api_op_ListPermissionSetsProvisionedToAccount.go index e23ea6f1621..de82b96d5f2 100644 --- a/service/ssoadmin/api_op_ListPermissionSetsProvisionedToAccount.go +++ b/service/ssoadmin/api_op_ListPermissionSetsProvisionedToAccount.go @@ -4,6 +4,7 @@ package ssoadmin import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssoadmin/types" @@ -125,6 +126,83 @@ func addOperationListPermissionSetsProvisionedToAccountMiddlewares(stack *middle return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListPermissionSetsProvisionedToAccountPaginator returns a new +// ListPermissionSetsProvisionedToAccountPaginator +func NewListPermissionSetsProvisionedToAccountPaginator(client ListPermissionSetsProvisionedToAccountAPIClient, params *ListPermissionSetsProvisionedToAccountInput, optFns ...func(*ListPermissionSetsProvisionedToAccountPaginatorOptions)) *ListPermissionSetsProvisionedToAccountPaginator { + options := ListPermissionSetsProvisionedToAccountPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPermissionSetsProvisionedToAccountInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPermissionSetsProvisionedToAccount(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssoadmin/api_op_ListTagsForResource.go b/service/ssoadmin/api_op_ListTagsForResource.go index 7377b64c1c6..6fe5e00699a 100644 --- a/service/ssoadmin/api_op_ListTagsForResource.go +++ b/service/ssoadmin/api_op_ListTagsForResource.go @@ -4,6 +4,7 @@ package ssoadmin import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssoadmin/types" @@ -119,6 +120,78 @@ func addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator +func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator { + options := ListTagsForResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTagsForResourceInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssoadmin/go.mod b/service/ssoadmin/go.mod index 06deea241f4..dde4638318d 100644 --- a/service/ssoadmin/go.mod +++ b/service/ssoadmin/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/ssoadmin/go.sum b/service/ssoadmin/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/ssoadmin/go.sum +++ b/service/ssoadmin/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index a6ba0cf0200..00000000000 --- a/service/ssoadmin/paginators.go +++ /dev/null @@ -1,768 +0,0 @@ -// 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.mod b/service/ssooidc/go.mod index d29a2b26026..0c8c812f06a 100644 --- a/service/ssooidc/go.mod +++ b/service/ssooidc/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/ssooidc/go.sum b/service/ssooidc/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/ssooidc/go.sum +++ b/service/ssooidc/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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/api_op_DescribeTapeArchives.go b/service/storagegateway/api_op_DescribeTapeArchives.go index 06320842ebc..73cab9238a7 100644 --- a/service/storagegateway/api_op_DescribeTapeArchives.go +++ b/service/storagegateway/api_op_DescribeTapeArchives.go @@ -4,6 +4,7 @@ package storagegateway import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/storagegateway/types" @@ -124,6 +125,83 @@ func addOperationDescribeTapeArchivesMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeTapeArchivesPaginator returns a new DescribeTapeArchivesPaginator +func NewDescribeTapeArchivesPaginator(client DescribeTapeArchivesAPIClient, params *DescribeTapeArchivesInput, optFns ...func(*DescribeTapeArchivesPaginatorOptions)) *DescribeTapeArchivesPaginator { + options := DescribeTapeArchivesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeTapeArchivesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeTapeArchives(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/storagegateway/api_op_DescribeTapeRecoveryPoints.go b/service/storagegateway/api_op_DescribeTapeRecoveryPoints.go index 689b120157c..cc256e6f98f 100644 --- a/service/storagegateway/api_op_DescribeTapeRecoveryPoints.go +++ b/service/storagegateway/api_op_DescribeTapeRecoveryPoints.go @@ -4,6 +4,7 @@ package storagegateway import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/storagegateway/types" @@ -130,6 +131,84 @@ func addOperationDescribeTapeRecoveryPointsMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeTapeRecoveryPointsPaginator returns a new +// DescribeTapeRecoveryPointsPaginator +func NewDescribeTapeRecoveryPointsPaginator(client DescribeTapeRecoveryPointsAPIClient, params *DescribeTapeRecoveryPointsInput, optFns ...func(*DescribeTapeRecoveryPointsPaginatorOptions)) *DescribeTapeRecoveryPointsPaginator { + options := DescribeTapeRecoveryPointsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeTapeRecoveryPointsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeTapeRecoveryPoints(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/storagegateway/api_op_DescribeTapes.go b/service/storagegateway/api_op_DescribeTapes.go index a5686d10b0d..63b63a5b9c6 100644 --- a/service/storagegateway/api_op_DescribeTapes.go +++ b/service/storagegateway/api_op_DescribeTapes.go @@ -4,6 +4,7 @@ package storagegateway import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/storagegateway/types" @@ -130,6 +131,81 @@ func addOperationDescribeTapesMiddlewares(stack *middleware.Stack, options Optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeTapesPaginator returns a new DescribeTapesPaginator +func NewDescribeTapesPaginator(client DescribeTapesAPIClient, params *DescribeTapesInput, optFns ...func(*DescribeTapesPaginatorOptions)) *DescribeTapesPaginator { + options := DescribeTapesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeTapesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeTapes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/storagegateway/api_op_DescribeVTLDevices.go b/service/storagegateway/api_op_DescribeVTLDevices.go index a5f8ac01ada..9d657491fbc 100644 --- a/service/storagegateway/api_op_DescribeVTLDevices.go +++ b/service/storagegateway/api_op_DescribeVTLDevices.go @@ -4,6 +4,7 @@ package storagegateway import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/storagegateway/types" @@ -134,6 +135,83 @@ func addOperationDescribeVTLDevicesMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeVTLDevicesPaginator returns a new DescribeVTLDevicesPaginator +func NewDescribeVTLDevicesPaginator(client DescribeVTLDevicesAPIClient, params *DescribeVTLDevicesInput, optFns ...func(*DescribeVTLDevicesPaginatorOptions)) *DescribeVTLDevicesPaginator { + options := DescribeVTLDevicesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeVTLDevicesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeVTLDevices(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/storagegateway/api_op_ListFileShares.go b/service/storagegateway/api_op_ListFileShares.go index 503fcf0d9f6..9f8a2f47bb6 100644 --- a/service/storagegateway/api_op_ListFileShares.go +++ b/service/storagegateway/api_op_ListFileShares.go @@ -4,6 +4,7 @@ package storagegateway import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/storagegateway/types" @@ -122,6 +123,82 @@ func addOperationListFileSharesMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListFileSharesPaginator returns a new ListFileSharesPaginator +func NewListFileSharesPaginator(client ListFileSharesAPIClient, params *ListFileSharesInput, optFns ...func(*ListFileSharesPaginatorOptions)) *ListFileSharesPaginator { + options := ListFileSharesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListFileSharesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextMarker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListFileShares(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/storagegateway/api_op_ListGateways.go b/service/storagegateway/api_op_ListGateways.go index 910b374aa81..5eabf965a39 100644 --- a/service/storagegateway/api_op_ListGateways.go +++ b/service/storagegateway/api_op_ListGateways.go @@ -4,6 +4,7 @@ package storagegateway import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/storagegateway/types" @@ -122,6 +123,81 @@ func addOperationListGatewaysMiddlewares(stack *middleware.Stack, options Option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListGatewaysPaginator returns a new ListGatewaysPaginator +func NewListGatewaysPaginator(client ListGatewaysAPIClient, params *ListGatewaysInput, optFns ...func(*ListGatewaysPaginatorOptions)) *ListGatewaysPaginator { + options := ListGatewaysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListGatewaysInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListGateways(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/storagegateway/api_op_ListTagsForResource.go b/service/storagegateway/api_op_ListTagsForResource.go index 3c0fd5b3797..4dada0dceed 100644 --- a/service/storagegateway/api_op_ListTagsForResource.go +++ b/service/storagegateway/api_op_ListTagsForResource.go @@ -4,6 +4,7 @@ package storagegateway import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/storagegateway/types" @@ -122,6 +123,83 @@ func addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator +func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator { + options := ListTagsForResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTagsForResourceInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/storagegateway/api_op_ListTapes.go b/service/storagegateway/api_op_ListTapes.go index b77b20ca5f5..5e49cb0039a 100644 --- a/service/storagegateway/api_op_ListTapes.go +++ b/service/storagegateway/api_op_ListTapes.go @@ -4,6 +4,7 @@ package storagegateway import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/storagegateway/types" @@ -138,6 +139,80 @@ func addOperationListTapesMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTapesPaginator returns a new ListTapesPaginator +func NewListTapesPaginator(client ListTapesAPIClient, params *ListTapesInput, optFns ...func(*ListTapesPaginatorOptions)) *ListTapesPaginator { + options := ListTapesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTapesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTapes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/storagegateway/api_op_ListVolumes.go b/service/storagegateway/api_op_ListVolumes.go index 2b3abb1122e..2f212684209 100644 --- a/service/storagegateway/api_op_ListVolumes.go +++ b/service/storagegateway/api_op_ListVolumes.go @@ -4,6 +4,7 @@ package storagegateway import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/storagegateway/types" @@ -140,6 +141,81 @@ func addOperationListVolumesMiddlewares(stack *middleware.Stack, options Options return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListVolumesPaginator returns a new ListVolumesPaginator +func NewListVolumesPaginator(client ListVolumesAPIClient, params *ListVolumesInput, optFns ...func(*ListVolumesPaginatorOptions)) *ListVolumesPaginator { + options := ListVolumesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListVolumesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListVolumes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/storagegateway/go.mod b/service/storagegateway/go.mod index dbcb35dceb2..48493c95525 100644 --- a/service/storagegateway/go.mod +++ b/service/storagegateway/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/storagegateway/go.sum b/service/storagegateway/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/storagegateway/go.sum +++ b/service/storagegateway/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 328b0af2dc3..00000000000 --- a/service/storagegateway/paginators.go +++ /dev/null @@ -1,692 +0,0 @@ -// 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.mod b/service/sts/go.mod index 74ded87b8df..bc74ed868bc 100644 --- a/service/sts/go.mod +++ b/service/sts/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/sts/go.sum b/service/sts/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/sts/go.sum +++ b/service/sts/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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/api_op_DescribeCases.go b/service/support/api_op_DescribeCases.go index 76478d861e3..3ad7bdaedf2 100644 --- a/service/support/api_op_DescribeCases.go +++ b/service/support/api_op_DescribeCases.go @@ -4,6 +4,7 @@ package support import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/support/types" @@ -160,6 +161,80 @@ func addOperationDescribeCasesMiddlewares(stack *middleware.Stack, options Optio return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeCasesPaginator returns a new DescribeCasesPaginator +func NewDescribeCasesPaginator(client DescribeCasesAPIClient, params *DescribeCasesInput, optFns ...func(*DescribeCasesPaginatorOptions)) *DescribeCasesPaginator { + options := DescribeCasesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeCasesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeCases(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/support/api_op_DescribeCommunications.go b/service/support/api_op_DescribeCommunications.go index 7fb4029f8c1..63838bbfafc 100644 --- a/service/support/api_op_DescribeCommunications.go +++ b/service/support/api_op_DescribeCommunications.go @@ -4,6 +4,7 @@ package support import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/support/types" @@ -140,6 +141,82 @@ func addOperationDescribeCommunicationsMiddlewares(stack *middleware.Stack, opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeCommunicationsPaginator returns a new DescribeCommunicationsPaginator +func NewDescribeCommunicationsPaginator(client DescribeCommunicationsAPIClient, params *DescribeCommunicationsInput, optFns ...func(*DescribeCommunicationsPaginatorOptions)) *DescribeCommunicationsPaginator { + options := DescribeCommunicationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeCommunicationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeCommunications(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/support/go.mod b/service/support/go.mod index 3edfe0ce906..9315707dbcf 100644 --- a/service/support/go.mod +++ b/service/support/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/support/go.sum b/service/support/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/support/go.sum +++ b/service/support/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 63769fb8b8c..00000000000 --- a/service/support/paginators.go +++ /dev/null @@ -1,158 +0,0 @@ -// 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/api_op_GetWorkflowExecutionHistory.go b/service/swf/api_op_GetWorkflowExecutionHistory.go index 82c6c57e39f..59a94a6e63f 100644 --- a/service/swf/api_op_GetWorkflowExecutionHistory.go +++ b/service/swf/api_op_GetWorkflowExecutionHistory.go @@ -4,6 +4,7 @@ package swf import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/swf/types" @@ -160,6 +161,84 @@ func addOperationGetWorkflowExecutionHistoryMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetWorkflowExecutionHistoryPaginator returns a new +// GetWorkflowExecutionHistoryPaginator +func NewGetWorkflowExecutionHistoryPaginator(client GetWorkflowExecutionHistoryAPIClient, params *GetWorkflowExecutionHistoryInput, optFns ...func(*GetWorkflowExecutionHistoryPaginatorOptions)) *GetWorkflowExecutionHistoryPaginator { + options := GetWorkflowExecutionHistoryPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetWorkflowExecutionHistoryInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetWorkflowExecutionHistory(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/swf/api_op_ListActivityTypes.go b/service/swf/api_op_ListActivityTypes.go index ff0f1964409..59d01f0d37e 100644 --- a/service/swf/api_op_ListActivityTypes.go +++ b/service/swf/api_op_ListActivityTypes.go @@ -4,6 +4,7 @@ package swf import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/swf/types" @@ -162,6 +163,82 @@ func addOperationListActivityTypesMiddlewares(stack *middleware.Stack, options O return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListActivityTypesPaginator returns a new ListActivityTypesPaginator +func NewListActivityTypesPaginator(client ListActivityTypesAPIClient, params *ListActivityTypesInput, optFns ...func(*ListActivityTypesPaginatorOptions)) *ListActivityTypesPaginator { + options := ListActivityTypesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListActivityTypesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListActivityTypes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/swf/api_op_ListClosedWorkflowExecutions.go b/service/swf/api_op_ListClosedWorkflowExecutions.go index 66ca5e7a99c..c5096768c1a 100644 --- a/service/swf/api_op_ListClosedWorkflowExecutions.go +++ b/service/swf/api_op_ListClosedWorkflowExecutions.go @@ -4,6 +4,7 @@ package swf import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/swf/types" @@ -201,6 +202,84 @@ func addOperationListClosedWorkflowExecutionsMiddlewares(stack *middleware.Stack return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListClosedWorkflowExecutionsPaginator returns a new +// ListClosedWorkflowExecutionsPaginator +func NewListClosedWorkflowExecutionsPaginator(client ListClosedWorkflowExecutionsAPIClient, params *ListClosedWorkflowExecutionsInput, optFns ...func(*ListClosedWorkflowExecutionsPaginatorOptions)) *ListClosedWorkflowExecutionsPaginator { + options := ListClosedWorkflowExecutionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListClosedWorkflowExecutionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListClosedWorkflowExecutions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/swf/api_op_ListDomains.go b/service/swf/api_op_ListDomains.go index 7596f6e614f..e174718b9ab 100644 --- a/service/swf/api_op_ListDomains.go +++ b/service/swf/api_op_ListDomains.go @@ -4,6 +4,7 @@ package swf import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/swf/types" @@ -155,6 +156,81 @@ func addOperationListDomainsMiddlewares(stack *middleware.Stack, options Options return 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 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDomainsPaginator returns a new ListDomainsPaginator +func NewListDomainsPaginator(client ListDomainsAPIClient, params *ListDomainsInput, optFns ...func(*ListDomainsPaginatorOptions)) *ListDomainsPaginator { + options := ListDomainsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDomainsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDomains(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/swf/api_op_ListOpenWorkflowExecutions.go b/service/swf/api_op_ListOpenWorkflowExecutions.go index 65517d9f2da..eee35bd38b8 100644 --- a/service/swf/api_op_ListOpenWorkflowExecutions.go +++ b/service/swf/api_op_ListOpenWorkflowExecutions.go @@ -4,6 +4,7 @@ package swf import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/swf/types" @@ -184,6 +185,84 @@ func addOperationListOpenWorkflowExecutionsMiddlewares(stack *middleware.Stack, return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListOpenWorkflowExecutionsPaginator returns a new +// ListOpenWorkflowExecutionsPaginator +func NewListOpenWorkflowExecutionsPaginator(client ListOpenWorkflowExecutionsAPIClient, params *ListOpenWorkflowExecutionsInput, optFns ...func(*ListOpenWorkflowExecutionsPaginatorOptions)) *ListOpenWorkflowExecutionsPaginator { + options := ListOpenWorkflowExecutionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListOpenWorkflowExecutionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListOpenWorkflowExecutions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/swf/api_op_ListWorkflowTypes.go b/service/swf/api_op_ListWorkflowTypes.go index e89fa96c579..b180ddbbb61 100644 --- a/service/swf/api_op_ListWorkflowTypes.go +++ b/service/swf/api_op_ListWorkflowTypes.go @@ -4,6 +4,7 @@ package swf import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/swf/types" @@ -159,6 +160,82 @@ func addOperationListWorkflowTypesMiddlewares(stack *middleware.Stack, options O return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListWorkflowTypesPaginator returns a new ListWorkflowTypesPaginator +func NewListWorkflowTypesPaginator(client ListWorkflowTypesAPIClient, params *ListWorkflowTypesInput, optFns ...func(*ListWorkflowTypesPaginatorOptions)) *ListWorkflowTypesPaginator { + options := ListWorkflowTypesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListWorkflowTypesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListWorkflowTypes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/swf/api_op_PollForDecisionTask.go b/service/swf/api_op_PollForDecisionTask.go index 14298594130..4b5c10fc20b 100644 --- a/service/swf/api_op_PollForDecisionTask.go +++ b/service/swf/api_op_PollForDecisionTask.go @@ -4,6 +4,7 @@ package swf import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/swf/types" @@ -214,6 +215,84 @@ func addOperationPollForDecisionTaskMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewPollForDecisionTaskPaginator returns a new PollForDecisionTaskPaginator +func NewPollForDecisionTaskPaginator(client PollForDecisionTaskAPIClient, params *PollForDecisionTaskInput, optFns ...func(*PollForDecisionTaskPaginatorOptions)) *PollForDecisionTaskPaginator { + options := PollForDecisionTaskPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &PollForDecisionTaskInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextPageToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opPollForDecisionTask(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/swf/go.mod b/service/swf/go.mod index 3b2f6debeb0..d8a6abb8b59 100644 --- a/service/swf/go.mod +++ b/service/swf/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/swf/go.sum b/service/swf/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/swf/go.sum +++ b/service/swf/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 0ae9e06de1e..00000000000 --- a/service/swf/paginators.go +++ /dev/null @@ -1,547 +0,0 @@ -// 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/api_op_DescribeCanaries.go b/service/synthetics/api_op_DescribeCanaries.go index ebddb503268..1c31afb2249 100644 --- a/service/synthetics/api_op_DescribeCanaries.go +++ b/service/synthetics/api_op_DescribeCanaries.go @@ -4,6 +4,7 @@ package synthetics import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/synthetics/types" @@ -114,6 +115,83 @@ func addOperationDescribeCanariesMiddlewares(stack *middleware.Stack, options Op return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeCanariesPaginator returns a new DescribeCanariesPaginator +func NewDescribeCanariesPaginator(client DescribeCanariesAPIClient, params *DescribeCanariesInput, optFns ...func(*DescribeCanariesPaginatorOptions)) *DescribeCanariesPaginator { + options := DescribeCanariesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeCanariesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeCanaries(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/synthetics/api_op_DescribeCanariesLastRun.go b/service/synthetics/api_op_DescribeCanariesLastRun.go index ad3463cbf31..cff7f74a308 100644 --- a/service/synthetics/api_op_DescribeCanariesLastRun.go +++ b/service/synthetics/api_op_DescribeCanariesLastRun.go @@ -4,6 +4,7 @@ package synthetics import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/synthetics/types" @@ -111,6 +112,85 @@ func addOperationDescribeCanariesLastRunMiddlewares(stack *middleware.Stack, opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeCanariesLastRunPaginator returns a new +// DescribeCanariesLastRunPaginator +func NewDescribeCanariesLastRunPaginator(client DescribeCanariesLastRunAPIClient, params *DescribeCanariesLastRunInput, optFns ...func(*DescribeCanariesLastRunPaginatorOptions)) *DescribeCanariesLastRunPaginator { + options := DescribeCanariesLastRunPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeCanariesLastRunInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeCanariesLastRun(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/synthetics/api_op_DescribeRuntimeVersions.go b/service/synthetics/api_op_DescribeRuntimeVersions.go index 73530d16ccf..8a5c9789b8b 100644 --- a/service/synthetics/api_op_DescribeRuntimeVersions.go +++ b/service/synthetics/api_op_DescribeRuntimeVersions.go @@ -4,6 +4,7 @@ package synthetics import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/synthetics/types" @@ -114,6 +115,85 @@ func addOperationDescribeRuntimeVersionsMiddlewares(stack *middleware.Stack, opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeRuntimeVersionsPaginator returns a new +// DescribeRuntimeVersionsPaginator +func NewDescribeRuntimeVersionsPaginator(client DescribeRuntimeVersionsAPIClient, params *DescribeRuntimeVersionsInput, optFns ...func(*DescribeRuntimeVersionsPaginatorOptions)) *DescribeRuntimeVersionsPaginator { + options := DescribeRuntimeVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeRuntimeVersionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeRuntimeVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/synthetics/api_op_GetCanaryRuns.go b/service/synthetics/api_op_GetCanaryRuns.go index 0ae107b8094..09154b8f75e 100644 --- a/service/synthetics/api_op_GetCanaryRuns.go +++ b/service/synthetics/api_op_GetCanaryRuns.go @@ -4,6 +4,7 @@ package synthetics import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/synthetics/types" @@ -117,6 +118,81 @@ func addOperationGetCanaryRunsMiddlewares(stack *middleware.Stack, options Optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetCanaryRunsPaginator returns a new GetCanaryRunsPaginator +func NewGetCanaryRunsPaginator(client GetCanaryRunsAPIClient, params *GetCanaryRunsInput, optFns ...func(*GetCanaryRunsPaginatorOptions)) *GetCanaryRunsPaginator { + options := GetCanaryRunsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetCanaryRunsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetCanaryRuns(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/synthetics/go.mod b/service/synthetics/go.mod index 591eac6a97c..2d8eb4df693 100644 --- a/service/synthetics/go.mod +++ b/service/synthetics/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/synthetics/go.sum b/service/synthetics/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/synthetics/go.sum +++ b/service/synthetics/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 92bc90018d8..00000000000 --- a/service/synthetics/paginators.go +++ /dev/null @@ -1,318 +0,0 @@ -// 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.mod b/service/textract/go.mod index afa6975f9d7..0d6c3ad2a75 100644 --- a/service/textract/go.mod +++ b/service/textract/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/textract/go.sum b/service/textract/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/textract/go.sum +++ b/service/textract/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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/api_op_Query.go b/service/timestreamquery/api_op_Query.go index c4c51ab8bbb..18581183bc4 100644 --- a/service/timestreamquery/api_op_Query.go +++ b/service/timestreamquery/api_op_Query.go @@ -153,6 +153,83 @@ func addOperationQueryMiddlewares(stack *middleware.Stack, options Options) (err return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewQueryPaginator returns a new QueryPaginator +func NewQueryPaginator(client QueryAPIClient, params *QueryInput, optFns ...func(*QueryPaginatorOptions)) *QueryPaginator { + options := QueryPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &QueryInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + type idempotencyToken_initializeOpQuery struct { tokenProvider IdempotencyTokenProvider } diff --git a/service/timestreamquery/go.mod b/service/timestreamquery/go.mod index b0f86398e03..8fe3f7b020e 100644 --- a/service/timestreamquery/go.mod +++ b/service/timestreamquery/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/timestreamquery/go.sum b/service/timestreamquery/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/timestreamquery/go.sum +++ b/service/timestreamquery/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 7de9ac9f692..00000000000 --- a/service/timestreamquery/paginators.go +++ /dev/null @@ -1,85 +0,0 @@ -// 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/api_op_ListDatabases.go b/service/timestreamwrite/api_op_ListDatabases.go index 2bca255be2b..9e86f7b6da7 100644 --- a/service/timestreamwrite/api_op_ListDatabases.go +++ b/service/timestreamwrite/api_op_ListDatabases.go @@ -4,6 +4,7 @@ package timestreamwrite import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/timestreamwrite/types" @@ -112,6 +113,83 @@ func addOperationListDatabasesMiddlewares(stack *middleware.Stack, options Optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDatabasesPaginator returns a new ListDatabasesPaginator +func NewListDatabasesPaginator(client ListDatabasesAPIClient, params *ListDatabasesInput, optFns ...func(*ListDatabasesPaginatorOptions)) *ListDatabasesPaginator { + options := ListDatabasesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDatabasesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDatabases(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/timestreamwrite/api_op_ListTables.go b/service/timestreamwrite/api_op_ListTables.go index 96368a11860..89c7b07d9d7 100644 --- a/service/timestreamwrite/api_op_ListTables.go +++ b/service/timestreamwrite/api_op_ListTables.go @@ -4,6 +4,7 @@ package timestreamwrite import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/timestreamwrite/types" @@ -114,6 +115,83 @@ func addOperationListTablesMiddlewares(stack *middleware.Stack, options Options) return 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 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTablesPaginator returns a new ListTablesPaginator +func NewListTablesPaginator(client ListTablesAPIClient, params *ListTablesInput, optFns ...func(*ListTablesPaginatorOptions)) *ListTablesPaginator { + options := ListTablesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTablesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTables(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/timestreamwrite/go.mod b/service/timestreamwrite/go.mod index fb05de20ff5..bc1baf3f1b0 100644 --- a/service/timestreamwrite/go.mod +++ b/service/timestreamwrite/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/timestreamwrite/go.sum b/service/timestreamwrite/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/timestreamwrite/go.sum +++ b/service/timestreamwrite/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index e2709eee966..00000000000 --- a/service/timestreamwrite/paginators.go +++ /dev/null @@ -1,162 +0,0 @@ -// 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/api_op_ListLanguageModels.go b/service/transcribe/api_op_ListLanguageModels.go index c02b784589d..a2e589210fd 100644 --- a/service/transcribe/api_op_ListLanguageModels.go +++ b/service/transcribe/api_op_ListLanguageModels.go @@ -4,6 +4,7 @@ package transcribe import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/transcribe/types" @@ -123,6 +124,83 @@ func addOperationListLanguageModelsMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListLanguageModelsPaginator returns a new ListLanguageModelsPaginator +func NewListLanguageModelsPaginator(client ListLanguageModelsAPIClient, params *ListLanguageModelsInput, optFns ...func(*ListLanguageModelsPaginatorOptions)) *ListLanguageModelsPaginator { + options := ListLanguageModelsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListLanguageModelsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListLanguageModels(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/transcribe/api_op_ListMedicalTranscriptionJobs.go b/service/transcribe/api_op_ListMedicalTranscriptionJobs.go index f71d47d457c..7abded47ba8 100644 --- a/service/transcribe/api_op_ListMedicalTranscriptionJobs.go +++ b/service/transcribe/api_op_ListMedicalTranscriptionJobs.go @@ -4,6 +4,7 @@ package transcribe import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/transcribe/types" @@ -126,6 +127,85 @@ func addOperationListMedicalTranscriptionJobsMiddlewares(stack *middleware.Stack return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListMedicalTranscriptionJobsPaginator returns a new +// ListMedicalTranscriptionJobsPaginator +func NewListMedicalTranscriptionJobsPaginator(client ListMedicalTranscriptionJobsAPIClient, params *ListMedicalTranscriptionJobsInput, optFns ...func(*ListMedicalTranscriptionJobsPaginatorOptions)) *ListMedicalTranscriptionJobsPaginator { + options := ListMedicalTranscriptionJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListMedicalTranscriptionJobsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListMedicalTranscriptionJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/transcribe/api_op_ListMedicalVocabularies.go b/service/transcribe/api_op_ListMedicalVocabularies.go index 86afed77dd3..8db736d36a0 100644 --- a/service/transcribe/api_op_ListMedicalVocabularies.go +++ b/service/transcribe/api_op_ListMedicalVocabularies.go @@ -4,6 +4,7 @@ package transcribe import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/transcribe/types" @@ -127,6 +128,83 @@ func addOperationListMedicalVocabulariesMiddlewares(stack *middleware.Stack, opt return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListMedicalVocabulariesPaginator returns a new +// ListMedicalVocabulariesPaginator +func NewListMedicalVocabulariesPaginator(client ListMedicalVocabulariesAPIClient, params *ListMedicalVocabulariesInput, optFns ...func(*ListMedicalVocabulariesPaginatorOptions)) *ListMedicalVocabulariesPaginator { + options := ListMedicalVocabulariesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListMedicalVocabulariesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListMedicalVocabularies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/transcribe/api_op_ListTranscriptionJobs.go b/service/transcribe/api_op_ListTranscriptionJobs.go index 0159d72c76a..3c771039b5a 100644 --- a/service/transcribe/api_op_ListTranscriptionJobs.go +++ b/service/transcribe/api_op_ListTranscriptionJobs.go @@ -4,6 +4,7 @@ package transcribe import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/transcribe/types" @@ -124,6 +125,83 @@ func addOperationListTranscriptionJobsMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTranscriptionJobsPaginator returns a new ListTranscriptionJobsPaginator +func NewListTranscriptionJobsPaginator(client ListTranscriptionJobsAPIClient, params *ListTranscriptionJobsInput, optFns ...func(*ListTranscriptionJobsPaginatorOptions)) *ListTranscriptionJobsPaginator { + options := ListTranscriptionJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTranscriptionJobsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTranscriptionJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/transcribe/api_op_ListVocabularies.go b/service/transcribe/api_op_ListVocabularies.go index 57fd6d5736c..bc5c94c14a8 100644 --- a/service/transcribe/api_op_ListVocabularies.go +++ b/service/transcribe/api_op_ListVocabularies.go @@ -4,6 +4,7 @@ package transcribe import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/transcribe/types" @@ -126,6 +127,82 @@ func addOperationListVocabulariesMiddlewares(stack *middleware.Stack, options Op return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListVocabulariesPaginator returns a new ListVocabulariesPaginator +func NewListVocabulariesPaginator(client ListVocabulariesAPIClient, params *ListVocabulariesInput, optFns ...func(*ListVocabulariesPaginatorOptions)) *ListVocabulariesPaginator { + options := ListVocabulariesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListVocabulariesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListVocabularies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/transcribe/api_op_ListVocabularyFilters.go b/service/transcribe/api_op_ListVocabularyFilters.go index 74bc5abe568..46adc142995 100644 --- a/service/transcribe/api_op_ListVocabularyFilters.go +++ b/service/transcribe/api_op_ListVocabularyFilters.go @@ -4,6 +4,7 @@ package transcribe import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/transcribe/types" @@ -118,6 +119,83 @@ func addOperationListVocabularyFiltersMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListVocabularyFiltersPaginator returns a new ListVocabularyFiltersPaginator +func NewListVocabularyFiltersPaginator(client ListVocabularyFiltersAPIClient, params *ListVocabularyFiltersInput, optFns ...func(*ListVocabularyFiltersPaginatorOptions)) *ListVocabularyFiltersPaginator { + options := ListVocabularyFiltersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListVocabularyFiltersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListVocabularyFilters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/transcribe/go.mod b/service/transcribe/go.mod index 51090c34d5d..1adb04d2f42 100644 --- a/service/transcribe/go.mod +++ b/service/transcribe/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/transcribe/go.sum b/service/transcribe/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/transcribe/go.sum +++ b/service/transcribe/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 3e28ceb4566..00000000000 --- a/service/transcribe/paginators.go +++ /dev/null @@ -1,471 +0,0 @@ -// 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/api_op_ListSecurityPolicies.go b/service/transfer/api_op_ListSecurityPolicies.go index f6504a44ca6..ad12db7ce88 100644 --- a/service/transfer/api_op_ListSecurityPolicies.go +++ b/service/transfer/api_op_ListSecurityPolicies.go @@ -4,6 +4,7 @@ package transfer import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -113,6 +114,83 @@ func addOperationListSecurityPoliciesMiddlewares(stack *middleware.Stack, option return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListSecurityPoliciesPaginator returns a new ListSecurityPoliciesPaginator +func NewListSecurityPoliciesPaginator(client ListSecurityPoliciesAPIClient, params *ListSecurityPoliciesInput, optFns ...func(*ListSecurityPoliciesPaginatorOptions)) *ListSecurityPoliciesPaginator { + options := ListSecurityPoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSecurityPoliciesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSecurityPolicies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/transfer/api_op_ListServers.go b/service/transfer/api_op_ListServers.go index ed42e861813..da5d1d26d0c 100644 --- a/service/transfer/api_op_ListServers.go +++ b/service/transfer/api_op_ListServers.go @@ -4,6 +4,7 @@ package transfer import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/transfer/types" @@ -113,6 +114,81 @@ func addOperationListServersMiddlewares(stack *middleware.Stack, options Options return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListServersPaginator returns a new ListServersPaginator +func NewListServersPaginator(client ListServersAPIClient, params *ListServersInput, optFns ...func(*ListServersPaginatorOptions)) *ListServersPaginator { + options := ListServersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListServersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListServers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/transfer/api_op_ListTagsForResource.go b/service/transfer/api_op_ListTagsForResource.go index 27c8ec95bab..f0ff9c7b408 100644 --- a/service/transfer/api_op_ListTagsForResource.go +++ b/service/transfer/api_op_ListTagsForResource.go @@ -4,6 +4,7 @@ package transfer import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/transfer/types" @@ -125,6 +126,83 @@ func addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator +func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator { + options := ListTagsForResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTagsForResourceInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/transfer/api_op_ListUsers.go b/service/transfer/api_op_ListUsers.go index 781d30c3600..86c6833d1f8 100644 --- a/service/transfer/api_op_ListUsers.go +++ b/service/transfer/api_op_ListUsers.go @@ -4,6 +4,7 @@ package transfer import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/transfer/types" @@ -126,6 +127,80 @@ func addOperationListUsersMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListUsersPaginator returns a new ListUsersPaginator +func NewListUsersPaginator(client ListUsersAPIClient, params *ListUsersInput, optFns ...func(*ListUsersPaginatorOptions)) *ListUsersPaginator { + options := ListUsersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListUsersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListUsers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/transfer/go.mod b/service/transfer/go.mod index 506516a778e..4dbac3eb34c 100644 --- a/service/transfer/go.mod +++ b/service/transfer/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/transfer/go.sum b/service/transfer/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/transfer/go.sum +++ b/service/transfer/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index b4a7dc35ead..00000000000 --- a/service/transfer/paginators.go +++ /dev/null @@ -1,311 +0,0 @@ -// 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/api_op_ListTerminologies.go b/service/translate/api_op_ListTerminologies.go index 611ea90b13b..71f61d10e14 100644 --- a/service/translate/api_op_ListTerminologies.go +++ b/service/translate/api_op_ListTerminologies.go @@ -4,6 +4,7 @@ package translate import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/translate/types" @@ -107,6 +108,81 @@ func addOperationListTerminologiesMiddlewares(stack *middleware.Stack, options O return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTerminologiesPaginator returns a new ListTerminologiesPaginator +func NewListTerminologiesPaginator(client ListTerminologiesAPIClient, params *ListTerminologiesInput, optFns ...func(*ListTerminologiesPaginatorOptions)) *ListTerminologiesPaginator { + options := ListTerminologiesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTerminologiesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTerminologies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/translate/api_op_ListTextTranslationJobs.go b/service/translate/api_op_ListTextTranslationJobs.go index e72d45886eb..8472055b64a 100644 --- a/service/translate/api_op_ListTextTranslationJobs.go +++ b/service/translate/api_op_ListTextTranslationJobs.go @@ -4,6 +4,7 @@ package translate import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/translate/types" @@ -111,6 +112,83 @@ func addOperationListTextTranslationJobsMiddlewares(stack *middleware.Stack, opt return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListTextTranslationJobsPaginator returns a new +// ListTextTranslationJobsPaginator +func NewListTextTranslationJobsPaginator(client ListTextTranslationJobsAPIClient, params *ListTextTranslationJobsInput, optFns ...func(*ListTextTranslationJobsPaginatorOptions)) *ListTextTranslationJobsPaginator { + options := ListTextTranslationJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTextTranslationJobsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTextTranslationJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/translate/go.mod b/service/translate/go.mod index 77bd58dadee..65b0e1ca9a4 100644 --- a/service/translate/go.mod +++ b/service/translate/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/translate/go.sum b/service/translate/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/translate/go.sum +++ b/service/translate/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index d4671dd2669..00000000000 --- a/service/translate/paginators.go +++ /dev/null @@ -1,160 +0,0 @@ -// 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.mod b/service/waf/go.mod index 6184a4cd54e..57024193193 100644 --- a/service/waf/go.mod +++ b/service/waf/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/waf/go.sum b/service/waf/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/waf/go.sum +++ b/service/waf/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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.mod b/service/wafregional/go.mod index 32c8fc2ce12..349e9c5303f 100644 --- a/service/wafregional/go.mod +++ b/service/wafregional/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/wafregional/go.sum b/service/wafregional/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/wafregional/go.sum +++ b/service/wafregional/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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.mod b/service/wafv2/go.mod index 671013dea1b..eb1122b2592 100644 --- a/service/wafv2/go.mod +++ b/service/wafv2/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/wafv2/go.sum b/service/wafv2/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/wafv2/go.sum +++ b/service/wafv2/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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/api_op_DescribeDocumentVersions.go b/service/workdocs/api_op_DescribeDocumentVersions.go index fec02e973f5..29d78e0e3d0 100644 --- a/service/workdocs/api_op_DescribeDocumentVersions.go +++ b/service/workdocs/api_op_DescribeDocumentVersions.go @@ -4,6 +4,7 @@ package workdocs import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/workdocs/types" @@ -128,6 +129,83 @@ func addOperationDescribeDocumentVersionsMiddlewares(stack *middleware.Stack, op return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeDocumentVersionsPaginator returns a new +// DescribeDocumentVersionsPaginator +func NewDescribeDocumentVersionsPaginator(client DescribeDocumentVersionsAPIClient, params *DescribeDocumentVersionsInput, optFns ...func(*DescribeDocumentVersionsPaginatorOptions)) *DescribeDocumentVersionsPaginator { + options := DescribeDocumentVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDocumentVersionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDocumentVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/workdocs/api_op_DescribeFolderContents.go b/service/workdocs/api_op_DescribeFolderContents.go index 09777bd28ad..dd8e447d051 100644 --- a/service/workdocs/api_op_DescribeFolderContents.go +++ b/service/workdocs/api_op_DescribeFolderContents.go @@ -4,6 +4,7 @@ package workdocs import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/workdocs/types" @@ -138,6 +139,82 @@ func addOperationDescribeFolderContentsMiddlewares(stack *middleware.Stack, opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeFolderContentsPaginator returns a new DescribeFolderContentsPaginator +func NewDescribeFolderContentsPaginator(client DescribeFolderContentsAPIClient, params *DescribeFolderContentsInput, optFns ...func(*DescribeFolderContentsPaginatorOptions)) *DescribeFolderContentsPaginator { + options := DescribeFolderContentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeFolderContentsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeFolderContents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/workdocs/api_op_DescribeUsers.go b/service/workdocs/api_op_DescribeUsers.go index 5129124243e..4a20759758a 100644 --- a/service/workdocs/api_op_DescribeUsers.go +++ b/service/workdocs/api_op_DescribeUsers.go @@ -4,6 +4,7 @@ package workdocs import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/workdocs/types" @@ -139,6 +140,80 @@ func addOperationDescribeUsersMiddlewares(stack *middleware.Stack, options Optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeUsersPaginator returns a new DescribeUsersPaginator +func NewDescribeUsersPaginator(client DescribeUsersAPIClient, params *DescribeUsersInput, optFns ...func(*DescribeUsersPaginatorOptions)) *DescribeUsersPaginator { + options := DescribeUsersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeUsersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.Marker + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeUsers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/workdocs/go.mod b/service/workdocs/go.mod index 96308890a7b..c5639eec3f1 100644 --- a/service/workdocs/go.mod +++ b/service/workdocs/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/workdocs/go.sum b/service/workdocs/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/workdocs/go.sum +++ b/service/workdocs/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 88d3bab7949..00000000000 --- a/service/workdocs/paginators.go +++ /dev/null @@ -1,235 +0,0 @@ -// 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/api_op_ListDevices.go b/service/worklink/api_op_ListDevices.go index 0763e521eea..fc526e33b27 100644 --- a/service/worklink/api_op_ListDevices.go +++ b/service/worklink/api_op_ListDevices.go @@ -4,6 +4,7 @@ package worklink import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/worklink/types" @@ -115,6 +116,80 @@ func addOperationListDevicesMiddlewares(stack *middleware.Stack, options Options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDevicesPaginator returns a new ListDevicesPaginator +func NewListDevicesPaginator(client ListDevicesAPIClient, params *ListDevicesInput, optFns ...func(*ListDevicesPaginatorOptions)) *ListDevicesPaginator { + options := ListDevicesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDevicesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDevices(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/worklink/api_op_ListDomains.go b/service/worklink/api_op_ListDomains.go index 79b4510ed41..06bf8d9516b 100644 --- a/service/worklink/api_op_ListDomains.go +++ b/service/worklink/api_op_ListDomains.go @@ -4,6 +4,7 @@ package worklink import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/worklink/types" @@ -115,6 +116,80 @@ func addOperationListDomainsMiddlewares(stack *middleware.Stack, options Options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListDomainsPaginator returns a new ListDomainsPaginator +func NewListDomainsPaginator(client ListDomainsAPIClient, params *ListDomainsInput, optFns ...func(*ListDomainsPaginatorOptions)) *ListDomainsPaginator { + options := ListDomainsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDomainsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDomains(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/worklink/api_op_ListFleets.go b/service/worklink/api_op_ListFleets.go index 9081fd81162..d29a20a1436 100644 --- a/service/worklink/api_op_ListFleets.go +++ b/service/worklink/api_op_ListFleets.go @@ -4,6 +4,7 @@ package worklink import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/worklink/types" @@ -107,6 +108,80 @@ func addOperationListFleetsMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListFleetsPaginator returns a new ListFleetsPaginator +func NewListFleetsPaginator(client ListFleetsAPIClient, params *ListFleetsInput, optFns ...func(*ListFleetsPaginatorOptions)) *ListFleetsPaginator { + options := ListFleetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListFleetsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListFleets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/worklink/api_op_ListWebsiteAuthorizationProviders.go b/service/worklink/api_op_ListWebsiteAuthorizationProviders.go index 05bd936daeb..6b5736e6de1 100644 --- a/service/worklink/api_op_ListWebsiteAuthorizationProviders.go +++ b/service/worklink/api_op_ListWebsiteAuthorizationProviders.go @@ -4,6 +4,7 @@ package worklink import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/worklink/types" @@ -116,6 +117,83 @@ func addOperationListWebsiteAuthorizationProvidersMiddlewares(stack *middleware. return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListWebsiteAuthorizationProvidersPaginator returns a new +// ListWebsiteAuthorizationProvidersPaginator +func NewListWebsiteAuthorizationProvidersPaginator(client ListWebsiteAuthorizationProvidersAPIClient, params *ListWebsiteAuthorizationProvidersInput, optFns ...func(*ListWebsiteAuthorizationProvidersPaginatorOptions)) *ListWebsiteAuthorizationProvidersPaginator { + options := ListWebsiteAuthorizationProvidersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListWebsiteAuthorizationProvidersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListWebsiteAuthorizationProviders(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/worklink/api_op_ListWebsiteCertificateAuthorities.go b/service/worklink/api_op_ListWebsiteCertificateAuthorities.go index d622edcbc48..39eba4ed676 100644 --- a/service/worklink/api_op_ListWebsiteCertificateAuthorities.go +++ b/service/worklink/api_op_ListWebsiteCertificateAuthorities.go @@ -4,6 +4,7 @@ package worklink import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/worklink/types" @@ -116,6 +117,83 @@ func addOperationListWebsiteCertificateAuthoritiesMiddlewares(stack *middleware. return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListWebsiteCertificateAuthoritiesPaginator returns a new +// ListWebsiteCertificateAuthoritiesPaginator +func NewListWebsiteCertificateAuthoritiesPaginator(client ListWebsiteCertificateAuthoritiesAPIClient, params *ListWebsiteCertificateAuthoritiesInput, optFns ...func(*ListWebsiteCertificateAuthoritiesPaginatorOptions)) *ListWebsiteCertificateAuthoritiesPaginator { + options := ListWebsiteCertificateAuthoritiesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListWebsiteCertificateAuthoritiesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListWebsiteCertificateAuthorities(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/worklink/go.mod b/service/worklink/go.mod index aebab200a6a..07ab963d4bb 100644 --- a/service/worklink/go.mod +++ b/service/worklink/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/worklink/go.sum b/service/worklink/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/worklink/go.sum +++ b/service/worklink/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index bfa83e7ced3..00000000000 --- a/service/worklink/paginators.go +++ /dev/null @@ -1,384 +0,0 @@ -// 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/api_op_ListAliases.go b/service/workmail/api_op_ListAliases.go index 4d4ac5c130f..1cf4b489851 100644 --- a/service/workmail/api_op_ListAliases.go +++ b/service/workmail/api_op_ListAliases.go @@ -4,6 +4,7 @@ package workmail import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/awslabs/smithy-go/middleware" @@ -119,6 +120,80 @@ func addOperationListAliasesMiddlewares(stack *middleware.Stack, options Options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListAliasesPaginator returns a new ListAliasesPaginator +func NewListAliasesPaginator(client ListAliasesAPIClient, params *ListAliasesInput, optFns ...func(*ListAliasesPaginatorOptions)) *ListAliasesPaginator { + options := ListAliasesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAliasesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAliases(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/workmail/api_op_ListGroupMembers.go b/service/workmail/api_op_ListGroupMembers.go index f5cfd6643e0..d414f7a6b69 100644 --- a/service/workmail/api_op_ListGroupMembers.go +++ b/service/workmail/api_op_ListGroupMembers.go @@ -4,6 +4,7 @@ package workmail import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/workmail/types" @@ -122,6 +123,81 @@ func addOperationListGroupMembersMiddlewares(stack *middleware.Stack, options Op return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListGroupMembersPaginator returns a new ListGroupMembersPaginator +func NewListGroupMembersPaginator(client ListGroupMembersAPIClient, params *ListGroupMembersInput, optFns ...func(*ListGroupMembersPaginatorOptions)) *ListGroupMembersPaginator { + options := ListGroupMembersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListGroupMembersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListGroupMembers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/workmail/api_op_ListGroups.go b/service/workmail/api_op_ListGroups.go index 2e194f67c65..90384288292 100644 --- a/service/workmail/api_op_ListGroups.go +++ b/service/workmail/api_op_ListGroups.go @@ -4,6 +4,7 @@ package workmail import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/workmail/types" @@ -115,6 +116,80 @@ func addOperationListGroupsMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListGroupsPaginator returns a new ListGroupsPaginator +func NewListGroupsPaginator(client ListGroupsAPIClient, params *ListGroupsInput, optFns ...func(*ListGroupsPaginatorOptions)) *ListGroupsPaginator { + options := ListGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/workmail/api_op_ListMailboxExportJobs.go b/service/workmail/api_op_ListMailboxExportJobs.go index 8827e66265f..ec7f861848d 100644 --- a/service/workmail/api_op_ListMailboxExportJobs.go +++ b/service/workmail/api_op_ListMailboxExportJobs.go @@ -4,6 +4,7 @@ package workmail import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/workmail/types" @@ -114,6 +115,82 @@ func addOperationListMailboxExportJobsMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListMailboxExportJobsPaginator returns a new ListMailboxExportJobsPaginator +func NewListMailboxExportJobsPaginator(client ListMailboxExportJobsAPIClient, params *ListMailboxExportJobsInput, optFns ...func(*ListMailboxExportJobsPaginatorOptions)) *ListMailboxExportJobsPaginator { + options := ListMailboxExportJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListMailboxExportJobsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListMailboxExportJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/workmail/api_op_ListMailboxPermissions.go b/service/workmail/api_op_ListMailboxPermissions.go index ca9795986e0..5c94e8f991f 100644 --- a/service/workmail/api_op_ListMailboxPermissions.go +++ b/service/workmail/api_op_ListMailboxPermissions.go @@ -4,6 +4,7 @@ package workmail import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/workmail/types" @@ -123,6 +124,82 @@ func addOperationListMailboxPermissionsMiddlewares(stack *middleware.Stack, opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListMailboxPermissionsPaginator returns a new ListMailboxPermissionsPaginator +func NewListMailboxPermissionsPaginator(client ListMailboxPermissionsAPIClient, params *ListMailboxPermissionsInput, optFns ...func(*ListMailboxPermissionsPaginatorOptions)) *ListMailboxPermissionsPaginator { + options := ListMailboxPermissionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListMailboxPermissionsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListMailboxPermissions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/workmail/api_op_ListOrganizations.go b/service/workmail/api_op_ListOrganizations.go index 4720b8a7cc4..5af7a154495 100644 --- a/service/workmail/api_op_ListOrganizations.go +++ b/service/workmail/api_op_ListOrganizations.go @@ -4,6 +4,7 @@ package workmail import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/workmail/types" @@ -108,6 +109,81 @@ func addOperationListOrganizationsMiddlewares(stack *middleware.Stack, options O return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListOrganizationsPaginator returns a new ListOrganizationsPaginator +func NewListOrganizationsPaginator(client ListOrganizationsAPIClient, params *ListOrganizationsInput, optFns ...func(*ListOrganizationsPaginatorOptions)) *ListOrganizationsPaginator { + options := ListOrganizationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListOrganizationsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListOrganizations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/workmail/api_op_ListResourceDelegates.go b/service/workmail/api_op_ListResourceDelegates.go index 1352b2e4e2d..86c5c1a30e9 100644 --- a/service/workmail/api_op_ListResourceDelegates.go +++ b/service/workmail/api_op_ListResourceDelegates.go @@ -4,6 +4,7 @@ package workmail import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/workmail/types" @@ -122,6 +123,82 @@ func addOperationListResourceDelegatesMiddlewares(stack *middleware.Stack, optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListResourceDelegatesPaginator returns a new ListResourceDelegatesPaginator +func NewListResourceDelegatesPaginator(client ListResourceDelegatesAPIClient, params *ListResourceDelegatesInput, optFns ...func(*ListResourceDelegatesPaginatorOptions)) *ListResourceDelegatesPaginator { + options := ListResourceDelegatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListResourceDelegatesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListResourceDelegates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/workmail/api_op_ListResources.go b/service/workmail/api_op_ListResources.go index b60b41318ab..e2f818afbbb 100644 --- a/service/workmail/api_op_ListResources.go +++ b/service/workmail/api_op_ListResources.go @@ -4,6 +4,7 @@ package workmail import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/workmail/types" @@ -116,6 +117,80 @@ func addOperationListResourcesMiddlewares(stack *middleware.Stack, options Optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListResourcesPaginator returns a new ListResourcesPaginator +func NewListResourcesPaginator(client ListResourcesAPIClient, params *ListResourcesInput, optFns ...func(*ListResourcesPaginatorOptions)) *ListResourcesPaginator { + options := ListResourcesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListResourcesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListResources(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/workmail/api_op_ListUsers.go b/service/workmail/api_op_ListUsers.go index e37c18fbd7a..bd2354e3fd5 100644 --- a/service/workmail/api_op_ListUsers.go +++ b/service/workmail/api_op_ListUsers.go @@ -4,6 +4,7 @@ package workmail import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/workmail/types" @@ -115,6 +116,80 @@ func addOperationListUsersMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewListUsersPaginator returns a new ListUsersPaginator +func NewListUsersPaginator(client ListUsersAPIClient, params *ListUsersInput, optFns ...func(*ListUsersPaginatorOptions)) *ListUsersPaginator { + options := ListUsersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListUsersInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListUsers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/workmail/go.mod b/service/workmail/go.mod index c78d1e3c58e..3df608580d1 100644 --- a/service/workmail/go.mod +++ b/service/workmail/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/workmail/go.sum b/service/workmail/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/workmail/go.sum +++ b/service/workmail/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index e0177267448..00000000000 --- a/service/workmail/paginators.go +++ /dev/null @@ -1,682 +0,0 @@ -// 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.mod b/service/workmailmessageflow/go.mod index 9394a95309c..97172462566 100644 --- a/service/workmailmessageflow/go.mod +++ b/service/workmailmessageflow/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/workmailmessageflow/go.sum b/service/workmailmessageflow/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/workmailmessageflow/go.sum +++ b/service/workmailmessageflow/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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/api_op_DescribeWorkspaceBundles.go b/service/workspaces/api_op_DescribeWorkspaceBundles.go index 73b286e8979..6e904454357 100644 --- a/service/workspaces/api_op_DescribeWorkspaceBundles.go +++ b/service/workspaces/api_op_DescribeWorkspaceBundles.go @@ -4,6 +4,7 @@ package workspaces import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/workspaces/types" @@ -115,6 +116,79 @@ func addOperationDescribeWorkspaceBundlesMiddlewares(stack *middleware.Stack, op return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeWorkspaceBundlesPaginator returns a new +// DescribeWorkspaceBundlesPaginator +func NewDescribeWorkspaceBundlesPaginator(client DescribeWorkspaceBundlesAPIClient, params *DescribeWorkspaceBundlesInput, optFns ...func(*DescribeWorkspaceBundlesPaginatorOptions)) *DescribeWorkspaceBundlesPaginator { + options := DescribeWorkspaceBundlesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeWorkspaceBundlesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeWorkspaceBundles(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/workspaces/api_op_DescribeWorkspaceDirectories.go b/service/workspaces/api_op_DescribeWorkspaceDirectories.go index a83fe770f3c..58b75d835a6 100644 --- a/service/workspaces/api_op_DescribeWorkspaceDirectories.go +++ b/service/workspaces/api_op_DescribeWorkspaceDirectories.go @@ -4,6 +4,7 @@ package workspaces import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/workspaces/types" @@ -111,6 +112,79 @@ func addOperationDescribeWorkspaceDirectoriesMiddlewares(stack *middleware.Stack return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeWorkspaceDirectoriesPaginator returns a new +// DescribeWorkspaceDirectoriesPaginator +func NewDescribeWorkspaceDirectoriesPaginator(client DescribeWorkspaceDirectoriesAPIClient, params *DescribeWorkspaceDirectoriesInput, optFns ...func(*DescribeWorkspaceDirectoriesPaginatorOptions)) *DescribeWorkspaceDirectoriesPaginator { + options := DescribeWorkspaceDirectoriesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeWorkspaceDirectoriesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeWorkspaceDirectories(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/workspaces/api_op_DescribeWorkspaces.go b/service/workspaces/api_op_DescribeWorkspaces.go index 22dfb0e79a1..ed864b937bd 100644 --- a/service/workspaces/api_op_DescribeWorkspaces.go +++ b/service/workspaces/api_op_DescribeWorkspaces.go @@ -4,6 +4,7 @@ package workspaces import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/workspaces/types" @@ -129,6 +130,82 @@ func addOperationDescribeWorkspacesMiddlewares(stack *middleware.Stack, options return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewDescribeWorkspacesPaginator returns a new DescribeWorkspacesPaginator +func NewDescribeWorkspacesPaginator(client DescribeWorkspacesAPIClient, params *DescribeWorkspacesInput, optFns ...func(*DescribeWorkspacesPaginatorOptions)) *DescribeWorkspacesPaginator { + options := DescribeWorkspacesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeWorkspacesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeWorkspaces(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/workspaces/go.mod b/service/workspaces/go.mod index 09b312eadcd..a6058e5cadf 100644 --- a/service/workspaces/go.mod +++ b/service/workspaces/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/workspaces/go.sum b/service/workspaces/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/workspaces/go.sum +++ b/service/workspaces/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 58bbf204b30..00000000000 --- a/service/workspaces/paginators.go +++ /dev/null @@ -1,230 +0,0 @@ -// 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/api_op_BatchGetTraces.go b/service/xray/api_op_BatchGetTraces.go index 7ac7b7feba1..922b101486f 100644 --- a/service/xray/api_op_BatchGetTraces.go +++ b/service/xray/api_op_BatchGetTraces.go @@ -4,6 +4,7 @@ package xray import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/xray/types" @@ -115,6 +116,77 @@ func addOperationBatchGetTracesMiddlewares(stack *middleware.Stack, options Opti return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewBatchGetTracesPaginator returns a new BatchGetTracesPaginator +func NewBatchGetTracesPaginator(client BatchGetTracesAPIClient, params *BatchGetTracesInput, optFns ...func(*BatchGetTracesPaginatorOptions)) *BatchGetTracesPaginator { + options := BatchGetTracesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &BatchGetTracesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opBatchGetTraces(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/xray/api_op_GetGroups.go b/service/xray/api_op_GetGroups.go index 3828c604f4b..5c1915876fd 100644 --- a/service/xray/api_op_GetGroups.go +++ b/service/xray/api_op_GetGroups.go @@ -4,6 +4,7 @@ package xray import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/xray/types" @@ -102,6 +103,76 @@ func addOperationGetGroupsMiddlewares(stack *middleware.Stack, options Options) return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetGroupsPaginator returns a new GetGroupsPaginator +func NewGetGroupsPaginator(client GetGroupsAPIClient, params *GetGroupsInput, optFns ...func(*GetGroupsPaginatorOptions)) *GetGroupsPaginator { + options := GetGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetGroupsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/xray/api_op_GetSamplingRules.go b/service/xray/api_op_GetSamplingRules.go index 79bcad9174b..03b0e4e04d4 100644 --- a/service/xray/api_op_GetSamplingRules.go +++ b/service/xray/api_op_GetSamplingRules.go @@ -4,6 +4,7 @@ package xray import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/xray/types" @@ -102,6 +103,77 @@ func addOperationGetSamplingRulesMiddlewares(stack *middleware.Stack, options Op return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetSamplingRulesPaginator returns a new GetSamplingRulesPaginator +func NewGetSamplingRulesPaginator(client GetSamplingRulesAPIClient, params *GetSamplingRulesInput, optFns ...func(*GetSamplingRulesPaginatorOptions)) *GetSamplingRulesPaginator { + options := GetSamplingRulesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetSamplingRulesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetSamplingRules(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/xray/api_op_GetSamplingStatisticSummaries.go b/service/xray/api_op_GetSamplingStatisticSummaries.go index 355d9cd970e..25e0a4f9990 100644 --- a/service/xray/api_op_GetSamplingStatisticSummaries.go +++ b/service/xray/api_op_GetSamplingStatisticSummaries.go @@ -4,6 +4,7 @@ package xray import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/xray/types" @@ -102,6 +103,79 @@ func addOperationGetSamplingStatisticSummariesMiddlewares(stack *middleware.Stac return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetSamplingStatisticSummariesPaginator returns a new +// GetSamplingStatisticSummariesPaginator +func NewGetSamplingStatisticSummariesPaginator(client GetSamplingStatisticSummariesAPIClient, params *GetSamplingStatisticSummariesInput, optFns ...func(*GetSamplingStatisticSummariesPaginatorOptions)) *GetSamplingStatisticSummariesPaginator { + options := GetSamplingStatisticSummariesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetSamplingStatisticSummariesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetSamplingStatisticSummaries(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/xray/api_op_GetServiceGraph.go b/service/xray/api_op_GetServiceGraph.go index 88ea30f85ae..e5ddd9f3837 100644 --- a/service/xray/api_op_GetServiceGraph.go +++ b/service/xray/api_op_GetServiceGraph.go @@ -4,6 +4,7 @@ package xray import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/xray/types" @@ -140,6 +141,77 @@ func addOperationGetServiceGraphMiddlewares(stack *middleware.Stack, options Opt return nil } +// 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetServiceGraphPaginator returns a new GetServiceGraphPaginator +func NewGetServiceGraphPaginator(client GetServiceGraphAPIClient, params *GetServiceGraphInput, optFns ...func(*GetServiceGraphPaginatorOptions)) *GetServiceGraphPaginator { + options := GetServiceGraphPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetServiceGraphInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetServiceGraph(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/xray/api_op_GetTimeSeriesServiceStatistics.go b/service/xray/api_op_GetTimeSeriesServiceStatistics.go index e91c259a5ab..495c40cfed0 100644 --- a/service/xray/api_op_GetTimeSeriesServiceStatistics.go +++ b/service/xray/api_op_GetTimeSeriesServiceStatistics.go @@ -4,6 +4,7 @@ package xray import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/xray/types" @@ -135,6 +136,79 @@ func addOperationGetTimeSeriesServiceStatisticsMiddlewares(stack *middleware.Sta return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetTimeSeriesServiceStatisticsPaginator returns a new +// GetTimeSeriesServiceStatisticsPaginator +func NewGetTimeSeriesServiceStatisticsPaginator(client GetTimeSeriesServiceStatisticsAPIClient, params *GetTimeSeriesServiceStatisticsInput, optFns ...func(*GetTimeSeriesServiceStatisticsPaginatorOptions)) *GetTimeSeriesServiceStatisticsPaginator { + options := GetTimeSeriesServiceStatisticsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetTimeSeriesServiceStatisticsInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetTimeSeriesServiceStatistics(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/xray/api_op_GetTraceGraph.go b/service/xray/api_op_GetTraceGraph.go index 97b2d9154c0..382f0a1d340 100644 --- a/service/xray/api_op_GetTraceGraph.go +++ b/service/xray/api_op_GetTraceGraph.go @@ -4,6 +4,7 @@ package xray import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/xray/types" @@ -110,6 +111,76 @@ func addOperationGetTraceGraphMiddlewares(stack *middleware.Stack, options Optio return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetTraceGraphPaginator returns a new GetTraceGraphPaginator +func NewGetTraceGraphPaginator(client GetTraceGraphAPIClient, params *GetTraceGraphInput, optFns ...func(*GetTraceGraphPaginatorOptions)) *GetTraceGraphPaginator { + options := GetTraceGraphPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetTraceGraphInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetTraceGraph(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/xray/api_op_GetTraceSummaries.go b/service/xray/api_op_GetTraceSummaries.go index 00a527b1aa9..e65482e7116 100644 --- a/service/xray/api_op_GetTraceSummaries.go +++ b/service/xray/api_op_GetTraceSummaries.go @@ -4,6 +4,7 @@ package xray import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/xray/types" @@ -152,6 +153,77 @@ func addOperationGetTraceSummariesMiddlewares(stack *middleware.Stack, options O return 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 a pagination token + // that matches the most recent token provided to the service. + 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 +} + +// NewGetTraceSummariesPaginator returns a new GetTraceSummariesPaginator +func NewGetTraceSummariesPaginator(client GetTraceSummariesAPIClient, params *GetTraceSummariesInput, optFns ...func(*GetTraceSummariesPaginatorOptions)) *GetTraceSummariesPaginator { + options := GetTraceSummariesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetTraceSummariesInput{} + } + + 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 { + return p.firstPage || p.nextToken != nil +} + +// 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 + prevToken := p.nextToken + p.nextToken = result.NextToken + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetTraceSummaries(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/xray/go.mod b/service/xray/go.mod index 0247d7046d5..d0f58f85c22 100644 --- a/service/xray/go.mod +++ b/service/xray/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.20201104233911-38864709e183 + github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 ) replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/xray/go.sum b/service/xray/go.sum index 32595049f96..4c337b66cbc 100644 --- a/service/xray/go.sum +++ b/service/xray/go.sum @@ -1,5 +1,7 @@ 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/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= +github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/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 deleted file mode 100644 index 3dd6fd982e4..00000000000 --- a/service/xray/paginators.go +++ /dev/null @@ -1,578 +0,0 @@ -// 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 -}